0

I'm using pyenv to deal with different python installations. For that, I'd like to add my local python scripts (module) into the python path library. So, for all the python installations within Pyenv, when it's in use I'd like to "hook" the 'sys.path' and add my custom location. Does someone know where I can make it general for all python version? If it's not possible, where to hook it for a single python installation?

Rodrigo Farias Rezino
  • 2,687
  • 3
  • 33
  • 60

1 Answers1

0

For a single installation on /usr/lib/pythonx.x/, for example, you can add the code:

sys.path.append("my_modules_path")

in /usr/lib/pythonx.x/site.py.

For more background on the site module, check.

fbraga
  • 711
  • 4
  • 9