Mac Python Path Summary __python

Source: Internet
Author: User

Mac brought python2.6 and python2.7, their own this time and installed the python3.6 (already configured environment variables), all of a sudden by the three version of the Python path dizzy. The path to the three versions is as follows: The path to python2.6 is:/system/library/frameworks/python.framework/versions/2.6 python2.7 path is:/system The/library/frameworks/python.framework/versions/2.7 python3.6 path is:/library/frameworks/python.framework/versions/ 3.6
two ways to view the Python path (for example, python3.6): which python3.6 uses Python's sys library

Import sys
print (sys.path)
HomeBrew, pyenv, OpenCV matters of concernHomebrew installed Third-party packages download OpenCV's dependent libraries (Numpy,python2) in the/usr/local/cellar/directory when brew install OPENCV homebrew Python2.7/site-packages directory to establish cv2.so->/usr/local/cellar/opencv/3.3.0_3/lib/python2.7/site-packages/soft Links To identify OpenCV in the import module, you need to do the following:
Mkdir-p/users/weisuzhong/.local/lib/python2.7/site-packages Echo ' import site; Site.addsitedir ("/usr/local/lib/python2.7/site-packages") ' >>/users/weisuzhong/.local/lib/python2.7/ Site-packages/homebrew.pth

Of course, this is a third-party library installation path (PIP) system that is based on the homebrew installation OpenCV. Python:/system/library/frameworks/python.framework/ Versions/2.7/extras/lib/python/pyenv-installed Python:/users/weisuzhong/.pyenv/versions/2.7.10/lib/python2.7/ site-packages/

The best way to know the installation of a version of Python and the location of a Third-party library is to use the pycharm!

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.