pip正在安装到python3.7,但我只能访问python3.5

2024-04-26 10:36:39 发布

您现在位置:Python中文网/ 问答频道 /正文

我已经安装了python3.5.7和python3.7的一些版本。Python3.7肯定是通过homebrew安装的,但我可能是手动安装了Python3.5。pip3正在为python3.7安装包,我想使用python3.7,但我不知道如何使用。python3命令使用python3.5,但似乎没有python3.7的文件。在

usern$ which python3 
/usr/local/bin/python3
usern$ python3
Python 3.5.7 (default, Apr 18 2019, 12:58:07) 
[GCC 4.2.1 Compatible Apple LLVM 10.0.1 (clang-1001.0.46.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
exit()
usern$ python3 --version
Python 3.5.7
usern$ pip3 --version
pip 19.0.3 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)
usern$ /usr/local/lib/python3.7
-bash: /usr/local/lib/python3.7: is a directory
usern$ /usr/local/bin/python3.7
-bash: /usr/local/bin/python3.7: No such file or directory
usern$ python3.7
-bash: python3.7: command not found

Tags: pipor版本bashbinversionlibusr
2条回答

其实我只是用过

brew link  overwrite python

这很好用。我的python3.5文件夹被删除了,但是在python3.7中一切都能正常工作。在

  1. 在finder中转到“go”,然后按Alt/option
  2. 然后单击库文件夹并将其打开
  3. 你会在里面找到一个python文件夹
  4. 删除它,然后从网站重新安装python的最新版本
  5. 在这之后,你的版本将会改变

相关问题 更多 >