Jan-31-2021, 10:55 AM
(This post was last modified: Jan-31-2021, 10:55 AM by Gribouillis.)
DO NOT USE PYTHONPATH. Instead do this:
Edit: Sorry, it is usercustomize and not sitecustomize. The latter also exists but it is usually stored in the global site-packages directory.
- Find the per user site-packages directory. For this, start python and run
>>> import site >>> site.getusersitepackages()
On the computer where I'm writing this, it prints'/home/eric/.local/lib/python3.6/site-packages'
. This is the path to the directory
- In this directory, create a file named
usercustomize.py
. In this file add code
# usercustomize.py import sys sys.path.extend(['/home/pi/Code',])
Edit: Sorry, it is usercustomize and not sitecustomize. The latter also exists but it is usually stored in the global site-packages directory.