Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 01:02
    Carreau synchronize #13374
  • 00:33

    Carreau on 7.x

    Backport PR #13372: use full-al… Merge pull request #13375 from … (compare)

  • 00:33
    Carreau closed #13375
  • Dec 06 23:33
    meeseeksdev[bot] milestoned #13375
  • Dec 06 23:33
    meeseeksmachine opened #13375
  • Dec 06 23:33

    Carreau on master

    use alphachannel for aliased pn… Merge pull request #13372 from … (compare)

  • Dec 06 23:33
    Carreau closed #13372
  • Dec 06 18:41
    Kojoley opened #13374
  • Dec 06 18:36
    Carreau synchronize #13372
  • Dec 06 18:11
    Kojoley commented #13371
  • Dec 06 18:04
    Carreau synchronize #13372
  • Dec 06 18:03
    Carreau milestoned #13372
  • Dec 06 18:02

    Carreau on master

    Remove many deprecated things f… Merge pull request #13368 from … (compare)

  • Dec 06 18:02
    Carreau closed #13368
  • Dec 06 18:02
    Carreau milestoned #13368
  • Dec 06 18:02

    Carreau on master

    Everything is an object and has… Handle OSError from inspect.get… Merge pull request #13371 from … (compare)

  • Dec 06 18:02
    Carreau closed #13371
  • Dec 06 18:02
    Carreau labeled #13371
  • Dec 06 18:02
    Carreau milestoned #13371
  • Dec 06 18:00

    Carreau on master

    Tweak tests for PyPy and add CI… Merge pull request #13373 from … (compare)

Dr. Muhammad Anjum
@anjumuaf123_twitter
@skgbanga hi sir , I am beginner in ubuntu and python .@anjumuaf123_twitter
I need some help to open jupyter notebok in ubuntu
I followed these instructions https://www.digitalocean.com/community/tutorials/how-to-set-up-jupyter-notebook-with-python-3-on-ubuntu-18-04
for installation and to create python virtual environment for jupyter
and same codes and names of directory and others
matrixbot
@matrixbot
testiosis What's the prob?
aaronxiong
@aaronxiongli
Hello, I built a Python plugin for display machine state.
Would anyone try and give me some feedback? Thanks a lot ~
https://github.com/yoobool/flask-state
scorp08
@scorp08
Hello all
Hello all
I want to get list of %load_ext modules , looked some places in ipython.magic and core dirs but could not find any solution or function to get all modules. sys.modules gives all the libraries which is not neccessary. How can I get list of %load_ext??
2 replies
Andreas Mueller
@amueller
Hey! quick question, is there an alternative way to hook into the autocomplete that is not __dir__? and/or is there a way to change the order in the autocomplete?
Min RK
@minrk
Not currently, I believe. Do you have a specific use case in mind? Since objects come from multiple sources, e.g. set(dir(obj)) | set(dir(obj.__class__)), ordering is enforced to be alphabetical.
Min RK
@minrk
However, completions that come from jedi may be grouped by type in the UI, I believe
Andreas Mueller
@amueller
Thanks @minrk! Well, basically I'm trying to make suggestions better for my particular use-case (which is data-science related, shocker). I want nice autocomplete in notebooks. If you look at autocomplete in IDEs, they are ranked by relevance which makes it much more likely that you can do <tab><return> to finish the command. Hm jedi is pretty deeply integrated in ipython, right? I figure I could monkey-patch ipython but that seems not very sustainable ;) I could try to hook into Jupyter but I would love it to work across different notebook implementations, so IPython would be the easiest place to do it.
Michał Krassowski
@krassowski
But if you just want to add new suggestions you could use complete_command hook I believe get_ipython().set_hook('complete_command', your_func, re_key='.*')
Andreas Mueller
@amueller
Thanks @krassowski. The reason I was looking at ipython was that I'd love to have this work across front-ends. I'm at Microsoft these days and having this work in their web interfaces as well as VSCode and JupyterLab and classic notebook would be great ;) I'll look at those extensions though, thanks! It's a bit unfortunate that there is no more homogeneous plug-in ecosystem for the frontends right now :-/
6 replies
RK
@sonthonaxrk

Hey IPython developers :) thanks for all your awesome work.

Recently I've been trying out some GUI based workflows in Jupyter, and I've hit some stumbling blocks around asyncio. Where I get deadlocks when trying to wait on Comm events. As it turns out the kernel will do process one message at a time. Since running a cell creates a message, and waiting for a Comm depends on a message, the kernel will hang if I try to wait for a Comm in a cell.

I thought the problem would be somewhat intractable, but actually I think it's quite simple to solve. I'm happy to do it myself. I think all I would need to do is to treat Comm events as a special case that can send asynchronous messages. I think this makes sense, because the other message types are definitely synchronous (like execute_request); but Comm events are not. For example, cell execution obviously needs to happen atomically; but should a button click really be blocked by another cell doing an await asyncio.sleep()?

Happy to do this work myself, as I've spent quite a bit of time figuring out how IPython works. Just wondering what you all think :)

RK
@sonthonaxrk

Hey all,

Quick question: how do I add custom kernels to the registry of kernels Jupyter can use? Is there a hook for that?

So, for instance, when I install xeus-python, how does Jupyter know it's installed?
RK
@sonthonaxrk

https://jupyter-client.readthedocs.io/en/stable/api/kernelspec.html?highlight=install-kernel.html#jupyter_client.kernelspec.KernelSpecManager.install_kernel_spec

Cool found it :)

Sorry should have searched more. I suppose disperate docs is the side effect of splitting everything up into different concerns.

5 replies
ipython, jupyter, jupyter-client, ipykernel, ends up being a lot.
RK
@sonthonaxrk

https://github.com/sonthonaxrk/async_gui_ipython_kernel

I think I've done something kinda cool and opens up some possibilities with IPython.

RK
@sonthonaxrk
Hey I've written a pull request, that I think could be really useful for IPython. ipython/ipykernel#589
That fixes the issue I described in my earlier messages.
However, I'm getting test failures on (ubuntu, 3.6) and (macos, pypy3), but not on (macos, 3.6) or (ubuntu pypy3). I'm really struggling to reproduce them locally.
Is this an issue with the tests or my code?
RK
@sonthonaxrk
Ah, it's just flakey. Rerunning the tests.
Some sort of timeout, maybe the github ci runners share some state.
evidlo
@Evidlo:matrix.org
[m]
A few months ago I work on a plugin for supporting 'cells' in a regular .py file
I was hoping somebody might give input or comment on its usefulness: https://github.com/UIUC-SINE/ipython-cells
onus tepolov
@blastoporeus_twitter
can %run accept a variable as a file name? I can't seem to get it to work. eg) %run '/some/path/file.ipynb' works, but if I have target = 'some/path/file.ipynb' then %run target, it says ERROR:root:File 'target.py' not found.
Min RK
@minrk
@blastoporeus_twitter try %run $target to get variable expansion
1 reply
nbuntrust
@nbuntrust
Is there any way to gain access to the SingleUserNotebookApp data from an ipython extension?
nbuntrust
@nbuntrust
Right now I'm parsing syslog data on the fly to get the IP of the connected user, but of course if SingleUserNotebookApp is writing it into a log, it knows it somewhere that I would think I could access more efficiently... :-)
Nicholas Bollweg
@bollwyvl
they are in different processes. you can talk to the API like any other client, however.
nbuntrust
@nbuntrust
This API is documented somewhere? I guess that's what I'm trying to find
siddharth99
@siddharth99
Hi, I am running into an error with cython code and the jupyter kernel ends up restarting itself.. I don't see where the actual error happens, don't see a core file and not sure how to debug further
[I 13:59:36.224 NotebookApp] KernelRestarter: restarting kernel (1/5), keep random ports kernel b4f40812-cf7d-4f97-925b-84780f946bc9 restarted
anyone has any suggestions?
1 reply
pritimanbala
@pritimanbala
hii
there
there is a problem that i am running code in the for loop of python and now I cant configure it out that how can I run my loop in the cmd of my pc
wraptile
@wraptile:matrix.org
[m]

Hello, can I embed ipython in an async program? can't seem to find any docs on it. I've tried:

    import nest_asyncio
    nest_asyncio.apply()
    IPython.embed(using='asyncio')

with no luck 😐️

Thomas A Caswell
@tacaswell
On a very new version of everything (CPython, traitlets, and IPython) I'm seeing AttributeError: 'Namespace' object has no attribute '_flags' when starting with ipython --simple-prompt. Has anyone else seen this or have hints of where to start looking?
`
Thomas A Caswell
@tacaswell
Looks like this is a change it CPython :/
Min RK
@minrk
@tacaswell 3.10 or 3.9?
Min RK
@minrk
Ah, I see it. Merged, thanks!
Thomas A Caswell
@tacaswell
Thanks @minrk !
Cassiel-girl
@Cassiel-girl
When I enter ipython, I enter python code and the result is returned. Which function can realize that the input parameter is Python code and the result of function execution is similar to the result of ipython after executing that python code?
Cassiel-girl
@Cassiel-girl
An ipython backend is running on one machine A. This backend receives commands from a user on another machine B, sends them to A for execution, and then returns the results to B. The program running on the other machine B is a pyqt5 GUI that can type strings, but machine B cannot install anything ipython related. What programming interface should the program on machine A call to implement? Or an example of the relevant code.
Min RK
@minrk
That's potentically a big task, but the main core function for evaluating code is exec. What 'results' might be is tricky for exec.
IPython's implementation is mostly here but it has lots of handling of different async situations that you probably don't need. Other things to consider include a persistent namespace or not, etc.
Jerry Johns
@mrjerryjohns

Hello! I'm seeing an issue with my IPython setup on Mac, where attempting to use await with an async command results in the following error:

    648 
    649         if self._local._loop is None:
--> 650             raise RuntimeError('There is no current event loop in thread %r.'
    651                                % threading.current_thread().name)
    652 

RuntimeError: There is no current event loop in thread 'MainThread'.

I've traced it to the fact that the following call always errors out:

import asyncio
asyncio.get_event_loop()
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-6-6908e23590ee> in <module>
----> 1 asyncio.get_event_loop()

/usr/local/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/events.py in get_event_loop(self)
    648 
    649         if self._local._loop is None:
--> 650             raise RuntimeError('There is no current event loop in thread %r.'
    651                                % threading.current_thread().name)
    652 

RuntimeError: There is no current event loop in thread 'MainThread'.
Extensive search of stack-overflow didn't yield any answers unfortunately :(
Min RK
@minrk
@mrjerryjohns what's your IPython version? I wouldn't expect that on recent IPython.
Jerry Johns
@mrjerryjohns

Python 3.9.7, IPython 7.30.0.

Reproducible test case:

Python 3.9.7 (default, Oct 13 2021, 06:45:31) 
Type 'copyright', 'credits' or 'license' for more information
IPython 7.30.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: async def ping():
   ...:     pass
   ...: 

In [2]: 

In [2]: await ping()
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
/usr/local/lib/python3.9/site-packages/IPython/core/async_helpers.py in __call__(self, coro)
     26         import asyncio
     27 
---> 28         return asyncio.get_event_loop().run_until_complete(coro)
     29 
     30     def __str__(self):

/usr/local/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/events.py in get_event_loop(self)
    644 
    645         if self._local._loop is None:
--> 646             raise RuntimeError('There is no current event loop in thread %r.'
    647                                % threading.current_thread().name)
    648 

RuntimeError: There is no current event loop in thread 'MainThread'.

In [2]:
9 replies