Skip to content

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

@giordafrancis

Description

@giordafrancis

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions