Python's Sys.path

Source: Internet
Author: User
The module is not detected by Python: No module named is because the module is not in Sys.path, the method of viewing Sys.path import Syssys.path The discovery does not actually load into the module. Windows Public environment variable path and user environment variable path and Python path are not the same, Windows's path is used to do Windows Application search path, the python3.4 installation path and Pip, Easy_ The install path variable that is loaded into windows can be called quickly in CMD. Loading a non-default module in Python with an environment variable is required to create and increase the path to Pythonpath,pythonpath in the module path to be added to Sys.path. Let Python identify non-default modules in the method rollup 1.python dynamically temporarily add import Syssys.path.append (Tmppath) 2: PTH file increases the Site-packages path under the Add. pth file, where each line of records in the file represents a valid path 3.PYTHONPATH adds a module path pythonpath is a system environment variable that can be identified by all Python, such as installing python2.7 and Pytho at the same time n3.4

Note: Part of the method is the online excerpt, only verified the Pythonpath way.

Python's Sys.path

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.