I`m trying to use tinkerpop3.2.3 to conncet janusgraph0.1.1 on my centOS7, everything works fine in gremlin shell. I tried to use gremlin-python3.2.3 in python shell, it also works well. But when I moved my codes to jupyter notebook, I got RuntimeError:IOLoop is already running when excuting
g = graph.traversal().withRemote(DriverRemoteConnection('ws://localhost:8182/gremlin','g'))
So, is that possible to make gremlinpython work in jupyter notebook?
I tried both python2.7 & python3.5
The issue you are seeing is more at the Apache TinkerPop level. JanusGraph 0.1.1 ships with TinkerPop 3.2.3, and the error you are seeing was resolved with TinkerPop 3.2.5.
The master branch of JanusGraph is already at TinkerPop 3.2.6, so it is compatible with Jupyter notebooks, but you'd have to build JanusGraph from source code. I'd expect the next release of JanusGraph to be out later this month.
Related
My Jupyter notebook is displaying text rather than ipywidgets. Here is a screenshot:
I read several posts about similar problems, like this one:
Jupyter Notebook not rendering ipywidgets.
Most of them indicate that the solution is to enable an extension, e.g: https://stackoverflow.com/a/38001920/11692496
But it seems to apply to older version of jupyter notebooks. I tried it anyway (with the --sys-prefix argument, which is required for virtualenv), but it didn't fix it.
I'm working with a jupyter notebook and a virtualenv. Just to be sure, I created a fresh venv and installed the minimal packages. No luck.
I'm using Python 3.10.6 and here is my versions list:
Thanks for your help!
For the record, I didn't manage to solve this issue on my virtualenv.
As #Wayne suggested above, I went for a workaround, namely a docker container based on jupyter/tensorflow-notebook
Imagine the situation like below. There must be simple explanation.
I have a program written in Jupyter notebook and use Python 3.7. There is no errors while executing the program and works on two PC computers. As I remember there where just only Python 3.7 (and adds like matplotlib etc. all what is needed).
Then on the others computers where is Python 3.8 the same programs gives me an error. Why?
I took another two PC removed all Python installation and install 3.7 3.8 3.9 3.10 Python (tried every of them) and I can't execute the programs without error. Why is like that? All extensions like matplotlib, numpy , scipy which is needed every time are install in proper way by pip etc...Path in Windows are always correct.
It seems to me that on those two computer where program work fine was only Python 3.7 (but I am not sure in 100% that there hadn't been installed previous version of the Python) the programs works. Any other installation or refreshment of the Python makes that teh program gives me errors.
The only one what I should to do is 100% reset Windows and do fresh and the newest one Python instillation (Jupyther etc.) and check whether the error exist or not. But I would like to know what makes the problem and not to refresh all my Windows installation every time.
The problem is even more interesting when I am taking the same program
and put them to the virtual Jupyther using the Internet and browser they always work fine without any errors and there is for sure the news Python engine I guess not 3.7.
Did you try to execute "pip freeze" or "conda list" on these computers (with Ananconda Powershell for ex.) to verify that all the libraries' versions you are using are the same?
Looking at the error on the screenshot, I would bet that the problem does not come from your Python version but more from a higher version on matplotlib installed on the first two PCs, which makes that the third one (with potentially an older version of matplotlib) does not support the arguments given.
Just try executing:
(base) PS C:\XXX\Python> conda list matplotlib
and should get the version of matplotlib installed on each PC, like this:
# packages in environment at C:\XXX\Miniconda3:
#
# Name Version Build Channel
matplotlib 3.4.2 pypi_0 pypi
matplotlib-inline 0.1.2 pypi_0 pypi
If they are different, this might be where the issue comes from.
I've been using vscode with Jupyter notebook extension (now maintain by Microsoft) for two years but It's weird to encouter the problem never met before as the error said:
Error: Session cannot generate requests
at S.executeCodeCell (c:\Users\alex0\.vscode\extensions\ms-toolsai.jupyter-2021.10.1101450599\out\client\extension.js:66:301742)
at S.execute (c:\Users\alex0\.vscode\extensions\ms-toolsai.jupyter-2021.10.1101450599\out\client\extension.js:66:300732)
at S.start (c:\Users\alex0\.vscode\extensions\ms-toolsai.jupyter-2021.10.1101450599\out\client\extension.js:66:296408)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at t.CellExecutionQueue.executeQueuedCells (c:\Users\alex0\.vscode\extensions\ms-toolsai.jupyter-2021.10.1101450599\out\client\extension.js:66:312326)
at t.CellExecutionQueue.start (c:\Users\alex0\.vscode\extensions\ms-toolsai.jupyter-2021.10.1101450599\out\client\extension.js:66:311862)
The problem shows when I train the CNN model. The model I've built previously bumped into this problem, but it works fine when preparing other deep learning models. What I've tried:
Install anaconda, use its kernel.
re-install Jupyter notebook extension and re-open vscode.
run vscode as administrator.
All of them get no luck. The script has been tested and run sucessfully on Google Colab, and it's the alternative I am using now. Is there any way I can fix it?
Other information:
windows 11
vscode version: 1.62.3
jupyter notebook extention: v2021.10.1101450599
anaconda with its Python 3.9.6 version package
Python(self-installed): 3.9.7
I'll provide extra information if necessary. Thanks.
It's likely your kernel is crashing for some reason. Can you log an issue here?
https://github.com/microsoft/vscode-jupyter/issues.
Issue: I am having issues with the environment and version of Python not matching the settings in VSCode, and causing issues with the packages I am trying to use in Jupyter notebooks. I am using a Windows 10 machine with Python 3.9.1 installed (including older versions), with Visual Studio Code 1.52.1 . Short summary - I install a package using pip. My guess is that it associates with the latest version of Python. I set up an interpreter in VS Code for that version of python, and try to import the package. The package is not found. If I call sys.version from the Jupyter notebook, I see that a default version of Python is running (3.8.5). The simple notebook throws an error because it cannot find that package that I installed with pip.
Screenshot that shows the associations:
This error is reproducible with only the
import pygmt
command in the notebook, i.e. it does not depend on the other packages imported.
Question: How can I control the version that Jupyter notebooks will run in VSCode if changing the interpreter doesn't work? Every other issue like this that I have found was due to not choosing the correct interpreter. In this case, I have. Why is it not running that version of the interpreter?
Thank you.
Edit
This edit is in response to #Jill Cheng's answer (see my comment below for tl;dr). I can change the interpreter (lower left corner of VSCode) to match the default that VSCode wants to run. No problem.
But there still are problems.
I cannot install pygmt, the targeted package, into this version of Python (see the command in in the terminal).
I cannot make VSCode operate in the opposite direction - i.e. I can never get it to run Python 3.9.1 even when that is the interpreter I chose.
I have reinstalled VSCode now several times, and Python 3.8.5 seems to always be the default. To me, the easiest solution seems to be changing the default Python version of VSCode - in fact, isn't that the point of selecting an interpreter? It is more nebulous to me why I cannot install pygmt into Python 3.8.5, and I don't know if it is beneficial to have multiple different versions of Python all with different packages (or is this just what Python users deal with daily?).
In VS Code, the Python kernel (Python environment) used by Jupyter notebook can be independent of the Python environment we selected in VS Code (shown in the lower left corner of VS Code).
As the output in the screenshot shows, the Python kernel of Jupyter you are using is "Python3.8.5", but the module "pygmt" is not installed in this environment. (Jupyter uses the last selected Python environment by default.)
Solution: Click the Python kernel on the upper right in the Jupyter notebook, and select the python environment where the module "pygmt" has been installed. In addition, it is recommended that you reopen the jupyter file after switching Jupyter's Python kernel so that it can reload the new python kernel.
Reference: Jupyter notebooks in VS Code.
I'm starting to use Python and Jupyter notebook for data analysis. I like Jupyter notebook but I sometimes prefers to use Spyder to have a quick look at the objets saved in memory (variables, dataframes, ...)
That's why I'd like to know if it's possible to have a shared
workspace between a Python session open in an IDE (like Spyder or Rodeo) and a notebook, so I can share object and avoid executing the same code twice to have the best of both world.
At least in theory, Spyder supports connecting to an external IPython kernel (e.g. one managed by Jupyter Notebook) via the "Connect to existing kernel" option: https://pythonhosted.org/spyder/ipythonconsole.html
The connection info for that can be obtained as described in http://jupyter-notebook.readthedocs.io/en/latest/examples/Notebook/Connecting%20with%20the%20Qt%20Console.html#Manual-connection
Unfortunately, that isn't actually working for me with Fedora 24's Spyder (2.3.9) and IPython (3.2.1), so I'm marking this answer as Community Wiki.