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.