由于不太懂系统这方面,之前一直没管python的不同版本。
今天安装包的时候折腾惨了。现在想把mac上的不同python版本整理一下。
现在我在pycharm里看到的版本有这些,请问有哪位能指点一下怎么管理吗。
想知道安装在不同目录下有什么区别,怎么设置安装路径。
在terminal里执行export
命令,PATH为
PATH=/Library/Frameworks/Python.framework/Versions/3.5/bin:/usr/local/mysql/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/texbin
这是什么意思?是说我的python默认版本是3.5吗,但我在终端打开python默认是2.7?
It is recommended to use the https://github.com/yyuu/pyenv project for version management of Python.
The installation path is the default for the package and generally cannot be modified.
If you can clearly understand https://github.com/yyuu/pyenv#how-it-works how pyenv works, this problem will be easy to understand.
Finally, don’t delete the Python that comes with the system, and don’t upgrade easily unless you know what to pay attention to. Because there are some applications in the OSX system that need to call the Python that comes with the system.
Can you try Pyenv?
pyenv suits you
virtualenv, you will be satisfied :)
pyenv has version management and environment management
while virtualenv can only manage the environment
Mac comes with python by default, because some system software itself uses python. If you install a higher version of python, it will not be overwritten, and the input when opening the terminal is still the default of the mac system. My approach is to put Link the high version python execution file to the bin directory
Use pyenv. For specific usage, please refer to the following blog post
http://cenalulu.github.io/python/multi-version-python-on-mac/
pycharm is very easy to use and does not require any configuration!