Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making NEST importable from Python Kernel #3

Open
JavierGOrdonnez opened this issue Apr 21, 2023 · 4 comments
Open

Making NEST importable from Python Kernel #3

JavierGOrdonnez opened this issue Apr 21, 2023 · 4 comments

Comments

@JavierGOrdonnez
Copy link
Collaborator

I finally got NEST installed properly.
image

~/.venv/bin/python3 -c "import nest" works with python, python3, and python3.9 ( which are all the python executables available in ~/.venv/bin/ folder), which are the default python (i.e. what shows when doing which python(3).

Nevertheless, this does not seem to work from inside the Jupyter Kernel:
image

@JavierGOrdonnez
Copy link
Collaborator Author

JavierGOrdonnez commented Apr 21, 2023

import sys
sys.executable

yields '/home/jovyan/.venv/bin/python', which is the same as I get in the terminal when doing which python.

In the terminal I can run python -c "import nest" successfully.
However, the same comand (with !) in the Jupyter Notebook, or simply import nest inside the Jupyter Notebook, leads to ModuleNotFoundError.

@JavierGOrdonnez
Copy link
Collaborator Author

So I believe the issue is that NEST is automatically added to the python3.8 installation, but the default python in the IPyKernel is 3.9, and that one does not have NEST in the path? Well, actually, that python seems to find it when doing python -c "import nest" in the terminal, so the 3.8 - 3.9 python version/executable is probably not the issue.

@JavierGOrdonnez
Copy link
Collaborator Author

From terminal, it also works to import it using ipython: ipython3 -c "import nest"

@JavierGOrdonnez
Copy link
Collaborator Author

Another option could be to install the package through conda. However, I do not know how feasible that is from the current structure (which uses a python venv and pip)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant