Sitemap

Adding python searching path

Aug 25, 2024

--

  • The best choice is to add the path to the system environment variable
  • Get Kevin Hu’s stories in your inbox

    Join Medium for free to get updates from this writer.

  • If you have more than one paths, just use the semicolon to add multiple paths, then when you import sys, and use the sys.path, it will automatically add what you have stored in the PYTHONPATH(not PATH, the PATH variable is not the same as the PYTHONPATH variable) system environment variable to the sys.path, and avoid using the sys.path.append(“path”), i have encountered so mant trouble while doing this, it does not make ant effect and even no temporart effect.
  • The PYTHONPATH system variable is the best practice

--

--

Kevin Hu
Kevin Hu

Written by Kevin Hu

Current master in EEE, Nanyang Technological University, Singapore