PYTHONPATH vs. sys.path
Another developer and I disagree about whether PYTHONPATH
or sys.path
should be used to allow Python to find a Python package in a user (e.g., development) directory.
Another developer and I disagree about whether PYTHONPATH
or sys.path
should be used to allow Python to find a Python package in a user (e.g., development) directory.
I had a file called example_file.py
, which I wanted to use from various other files, so I decided to add example_file.py
to sys.path
and import this file in another file to use the file. To do so, I ran the following in IPython.