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

Installed packages persist on terminal/ipython but not in Jupyter notebook. #5

Open
giordafrancis opened this issue Feb 28, 2024 · 0 comments

Comments

@giordafrancis
Copy link

giordafrancis commented Feb 28, 2024

Using pipi -U and mambai commands I cannot use installed packages in jupyter notebooks. These are however available in python/ipython when using the terminal

sys.path in terminal ipython
['/storage/cfg/.conda/bin', '/root/.conda/lib/python312.zip', '/root/.conda/lib/python3.12', '/root/.conda/lib/python3.12/lib-download', '', '/root/.local/lib/python3.12/site-packages', '/root/.conda/lib/python3.12/site-packages']

When launching a notebook I cannot use any previously installed packages (ie import timm) the sys.path variable is also different

sys.path in jupyter notebook
['/notebooks', '/usr/lib/python39.zip', '/usr/lib/python3.9', '/usr/lib/python3.9/lib-download', '', '/usr/local/lib/python3.9/dist-packages', '/usr/lib/python3/dist-packages']

What I have tried so far

In jupyter, I've tried to add ['/root/.local/lib/python3.12/site-packages', '/root/.conda/lib/python3.12/site-packages'] to python sys.path, I've also tried to delete '/usr/local/lib/python3.9/dist-packages' , but no luck in either. Tested this across several sessions and kernel restarts and no joy.

Any suggestions on accessing and persisting packages across jupyter notebook across sessions?

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