Python include non-standard site packages

read documents:

  • https://docs.python.org/3/install/index.html
  • https://docs.python.org/3/library/site.html

then you will know that the site-packages or dist-packages will be concluded into sys.path

there are several ways to include a non-standard location for python-module-import, here is a non-executive methods:

  • sys.path.append()
  • PYTHONPATH
  • via of path-file: name.pth
  • via of configuration-file: name.cfg (discouraged)
  • via of symbolic link (strongly suggested!)