change PYTHONPATH
UserBird
Dataiker, Alpha Tester Posts: 535 Dataiker
In order to change the python path and be able to use some of my libraries, i added to env-sites.sh the following line:
export PYTHONPATH=$PYTHONPATH:mylibspath
I restarted Dataiku. However, when I open a Notebook and print sys.path, or os.environ['PYTHONPATH'], "mylibspath" is not present.
What is more, some other environment variables are well loaded, like os.environ['PATH'], where I also appended some paths.
Should I modify the PYTHONPATH in another place ?
export PYTHONPATH=$PYTHONPATH:mylibspath
I restarted Dataiku. However, when I open a Notebook and print sys.path, or os.environ['PYTHONPATH'], "mylibspath" is not present.
What is more, some other environment variables are well loaded, like os.environ['PATH'], where I also appended some paths.
Should I modify the PYTHONPATH in another place ?
Tagged:
Answers
-
The sanctioned way of adding packages/modules to your python environment is not to add them in the PYTHONPATH. See The Python Environment doc page:
- You can install pip packages using DATA_DIR/bin/pip
- You can add locally-managed python source in DATA_DIR/lib/python