mac下如何有效管理python的各个版本?
高洛峰
高洛峰 2017-04-17 17:16:10
0
8
389

由于不太懂系统这方面,之前一直没管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?

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(8)
小葫芦

Now the versions I see in pycharm include these. Can anyone give me some advice on how to manage them?

It is recommended to use the https://github.com/yyuu/pyenv project for version management of Python.


I want to know the difference between installation in different directories and how to set the installation path.

The installation path is the default for the package and generally cannot be modified.


What does this mean? Does it mean that my default version of python is 3.5, but when I open python in the terminal, the default version is 2.7?

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 :)

Ty80

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/

PHPzhong

pycharm is very easy to use and does not require any configuration!

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!