Mac Python Path Summary __python

Source: Internet
Author: User

Python can coexist with multiple versions of the Mac, and there are several Python directories, but in general, it's easy to get a Mac with Python.

Mac system with Python, perhaps the Python version needs to be updated, so the directory structure to understand the

The system's own Python path

The Mac system comes with a program that will be viewed under the library.
Go to Folder/lib (resource pool)
The system's own Python path is:
/library/frameworks/python.framework/versions/2.7

The current version is 2.7.6 directory structure and Windows similarity here next Bin,lib

Bin directory, which is equivalent to the main program's directory


Lib directory, which is the directory of the Python program module

System with Python installation module package path

In the Lib directory python2.7, there is a site-packages this package inside the module are all through

Python setup.py Install

This Python command installs the module


If the system's own Python uses the PIP, or if Easy_install has installed the module, you will see a Python folder in the Lib (repository) directory
For example:
/library/python/2.7/site-packages

In this site-packages, the modules inside this package are all passed

Pip Install xxxxxx

This PIP command installs the module

Python installed by using brew
The MAC has a powerful brew tool, similar to Apt-get, that can be used to install some system modules, and can also update the installation of Python
Reference:
Https://github.com/Homebrew/homebrew/tree/master/share/doc/homebrew#readme

The path that will exist with brew installed:/usr/local

The Python path that is also installed with brew is as follows:
/usr/local/frameworks/python.framework/versions/

Ps:
/usr/local/This folder is equivalent to a local user's system folder

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.