如何将python符号链接到osx默认python?
目前我使用如何将python符号链接到osx默认python?,python,macos,path,homebrew,Python,Macos,Path,Homebrew,目前我使用conda来管理python安装,我只安装了python3 $ which python /Users/username/miniconda3/bin/python $ which python3 /Users/username/miniconda3/bin/python3 因此,现在python和python3都指向同一个目标: $ python Python 3.5.1 |Continuum Analytics, Inc.| (default, Dec 7 2015, 11:2
conda
来管理python安装,我只安装了python3
$ which python
/Users/username/miniconda3/bin/python
$ which python3
/Users/username/miniconda3/bin/python3
因此,现在python
和python3
都指向同一个目标:
$ 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版本呢
用户/您的用户名/
在其内部单击:“Shift”+“Command”+”(显示隐藏文件)。
有一个文件“.bash profile”->右键单击->文本编辑
粘贴:
export PATH=/usr/local/bin:/usr/local/sbin:~/bin:$PATH
“命令”+“s”。现在您有了一个符号链接。IDK如果这是最好的方法,但是如果
/username/miniconda3/bin/python
是一个符号链接,删除它可能会起作用。您是否尝试过修改.bash\u配置文件中的路径
。我也有同样的问题,因为Anaconda3安装程序创建了这个符号链接。