繁体   English   中英

如何将python符号链接到osx默认python?

[英]How do I symlink python to the osx default python?

目前,我使用conda来管理python的安装,而我仅安装了python3

$ which python
/Users/username/miniconda3/bin/python
$ which python3
/Users/username/miniconda3/bin/python3

所以现在pythonpython3指向同一个目标:

$ python
Python 3.5.1 |Continuum Analytics, Inc.| (default, Dec  7 2015, 11:24:55) 
[GCC 4.2.1 (Apple Inc. build 5577)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 
$ python3
Python 3.5.1 |Continuum Analytics, Inc.| (default, Dec  7 2015, 11:24:55) 
[GCC 4.2.1 (Apple Inc. build 5577)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 

我想这可能不是一个好主意, brew doctor也抱怨

Warning: python is symlinked to python3
This will confuse build scripts and in general lead to subtle breakage.

那么如何将python指向osx系统默认的python 2.x版本呢?

用户/ your_username /

在其中单击:“ Shift” +“ Command” +“。” (显示隐藏文件)。 有一个文件“ .bash-profile”->右键单击-> textedit。

糊:

export PATH=/usr/local/bin:/usr/local/sbin:~/bin:$PATH 

“命令” +“ s”。 现在您有了一个符号链接。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM