Python Custom Module Location

Source: Internet
Author: User

1, need to find out where the Python interpreter to find the module;

Specific methods:

>>> Import Sys,pprint
>>> Pprint.pprint (Sys.path)
[‘‘,
' C:\\python27\\lib\\site-packages\\jinja2-2.8-py2.7.egg ',
' C:\\python27\\lib\\site-packages\\markupsafe-0.23-py2.7.egg ',
' C:\\python27\\lib\\site-packages\\mysql_connector_python-2.0.4-py2.7.egg ',
' C:\\windows\\system32\\python27.zip ',
' C:\\python27\\dlls ',
' C:\\python27\\lib ',
' C:\\python27\\lib\\plat-win ',
' C:\\python27\\lib\\lib-tk ',
' C:\\python27 ',
' C:\\python27\\lib\\site-packages ']

Put your. py file in any directory

' C:\\python27\\lib\\site-packages ' This is the best choice,

2, customize the location, let the Python interpreter automatically need to find a custom module

Python contains the directory where the module resides in Add environment variables.

    

Python Custom Module Location

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.