Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/285.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何将python符号链接到osx默认python?_Python_Macos_Path_Homebrew - Fatal编程技术网

如何将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安装程序创建了这个符号链接。