About 617,000 results
Open links in new tab
  1. Python: Best way to add to sys.path relative to the current running ...

    Dec 29, 2011 · Python: Best way to add to sys.path relative to the current running script Asked 13 years, 11 months ago Modified 1 year, 4 months ago Viewed 365k times

  2. What sets up sys.path with Python, and when? - Stack Overflow

    From Learning Python: sys.path is the module search path. Python configures it at program startup, automatically merging the home directory of the top-level file (or an empty string to designate the …

  3. Where is Python's sys.path initialized from? - Stack Overflow

    Oct 30, 2016 · The directory of the script which python is executing is added to sys.path. On Windows, this is always the empty string, which tells python to use the full path where the script is located …

  4. python - Avoiding `sys.path.append (..)` for imports - Stack Overflow

    Jun 18, 2021 · The Python interpreter will search the sys.path and PYTHONPATH directories list for modules and packages to resolve when it sees an import statement A Python package is a directory …

  5. Permanently adding a file path to sys.path in Python

    Sep 4, 2012 · 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.

  6. python - PYTHONPATH vs. sys.path - Stack Overflow

    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. We have a Python project …

  7. How do I find out my PYTHONPATH using Python? - Stack Overflow

    Sep 28, 2009 · How do I find out which directories are listed in my system’s PYTHONPATH variable, from within a Python script (or the interactive shell)?

  8. python - Permanently add a directory to PYTHONPATH? - Stack Overflow

    Aug 4, 2010 · Whenever I use sys.path.append, the new directory will be added. However, once I close python, the list will revert to the previous (default?) values. How do I permanently add a directory to …

  9. How to add a Python module to syspath? - Ask Ubuntu

    May 23, 2014 · How python finds its modules Strictly taken, a module is a single python file, while a package is a folder containing python files, accompanied by a (can be empty) file named __init__.py, …

  10. How to globally modify the default PYTHONPATH (sys.path)?

    There are two ways to do it. .pth file PYTHONPATH Any .pth file which is found on the default path (see bellow) will get its content included into sys.path. Format of said .pth file is simple: one (folder) path …