What’s the “right” way to install python packages in a Paperspace PyTorch Notebook? If I just use pip
, it works, but I get a warning recommending that I use a virtual environment. That makes sense, but presumably the notebook won’t just automatically use it if I create one, so additional steps would be needed.
Is this explained somewhere in the documentation that I’m missing? (docs.digitalocean.com/products/paperspace/notebooks/)
Do I:
pip install --user ...
has the same warning because the user is root
.) By the way, this would need to be done every time the machine is started.pip
anyway, every time you start the machine?)It seems odd to me that this isn’t a common need that would be documented somewhere. (Or that they wouldn’t at least say to ignore the warning, if plain old pip is what to use.) Am I totally missing something, or asking the wrong question?
Even if I didn’t need to install a new package, if down the road I need to upgrade existing packages, how is that done? Like I said, it seems that anything I do with regular pip has to be redone each time the machine is started.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hi there,
I believe that you’re not missing anything. While
pip
works, changes don’t persist between restarts unless you build your own custom container. Using a virtual environment is possible, but it requires extra steps to make the notebook use it explicitly.Since this is more about Paperspace’s notebook environment specifically, it might be best to reach out to the Paperspace support team or community forum for guidance on best practices. They can give you the most accurate steps for persistent package management or customizing your environment.
- Bobby