我在Mac上安装了两个python,一个在usr / bin / python上,另一个在/ library / frameworks / python上

时间:2019-04-09 20:10:42

标签: python python-3.x macos terminal

我在Mac上,我正在尝试解决固定路径的问题,因为在运行python脚本时未读取模块。

我发现我安装了两组python,如何消除这个问题并解决我的问题?

我将提供我在终端::: p上运行的命令

-

$ python

Python 2.7.10 

$ python3

Python 3.7.3 

$ which python

/usr/bin/python

which python3

/Library/Frameworks/Python.framework/Versions/3.7/bin/python3


echo $PATH

/Library/Frameworks/Python.framework/Versions/3.7/bin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/Library/Frameworks/Python.framework/Versions/3.5/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/MacGPG2/bin


which -a python python3

/usr/bin/python
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3
/usr/local/bin/python3


which -a python python

/usr/bin/python
/usr/bin/python

当我有两个位置时运行python脚本时会出现问题吗? ,我的路径错了吗?最佳做法是什么!

谢谢

0 个答案:

没有答案