Summarize the pits that have been Python3 under the Mac for the next few days.

Source: Internet
Author: User
Tags virtual environment

The situation at that time: The Mac comes with Python2,

1, installation Pyhon3:

The first download from the official website installation package installation, installation directory in/library/frameworks/python.framework/versions/3.6/python/... Next, the package installed with PIP3 is also inside this (Site-package),

Then uninstalled, using homebrew installation, the installation directory is changed under/usr/local/lib

But it is also not possible to generate environment variables in/usr/local/bin, regardless of the direct use of the command, because SIP is not the highest privilege.

Toss a day, choose to give up, uninstall the native installation of the Python3, start again

In order to get SIP permissions, and toss a day, under the wireless keyboard, anyway, press command+r regardless of entering the safe mode, finally in the company engaged in a wired keyboard, suddenly entered, with the command csrutil disable set the right

Start reinstall PYTHON3, and PIP3 installed package, under/usr/local/bin also generated environment variables, installation problems finally resolved

2. Virtual Environment

Originally used virtualenv with its extended vitualenvwrapper, but because of installation problems, regardless of the use, after the installation of the problem solved there is no time to test

Instead of pipenv, in the directory with pipenv install is actually the default in Python2 under the creation of virtual environment, this does not have any hint, and pits me.

Because I created the environment after the installation of what module, with Python3 after running all the errors did not find the module,

Later on GitHub to see the specific use of pipenv know Pipenv--two is created with Python2, Pipenv--three is created with Python3, the final

To solve the virtual environment problem

3. Running the application

Be sure to use sudo

Summarize the pits that have been Python3 under the Mac for the next few days.

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.