Non-Beginner Discussion

Does anyone see any issue with installing packages to Paperspace persistent storage and then adding this location to system path?

To save time I have been doing the following:

  • Create a directory in /notebooks (the home dir) called libs
  • Install packages to this dir using the --target argument: !pip install --target=./libs wandb.
  • Set this location to the sys.path:
import sys
pkg_path = "./libs"
sys.path.append(pkg_path)

The above cell is then the only cell you need to run each time you restart a Paperspace machine.

Does anyone see any fault in this approach? It saves me precious minutes (package install is a little slow in Paperspace) when I have a quick idea to try out, but unsure if setting sys.path has any other impacts (none that I can see so far).

1 Like