python - pip 正在安装到 Python 3.7,但我只能访问 Python 3.5
问题描述
我安装了 Python 3.5.7 和一些版本的 Python 3.7。Python 3.7 肯定是通过自制软件安装的,但我可能已经手动安装了 Python 3.5。pip3 正在将包安装到 Python 3.7 的文件夹中,我想使用 Python 3.7,但我不知道如何。命令 python3 使用 Python 3.5,似乎没有 Python 3.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
解决方案
我实际上只是使用
brew link --overwrite python
这工作得很好。我的 Python 3.5 文件夹已被删除,但 Python 3.7 一切正常。
推荐阅读
- python - Python Django 应用程序记录器记录在不同的应用程序目录中
- json - 在 Swift 中使用多个组值解码 JSON
- jquery - Clone() 离开 [object HTMLSpanElement]
- ios - 注册为 Apple 开发者 - 作为公司
- sass - SASS @each 语句中的多个变量
- java - 是否鼓励使用方法变量而不是类变量进行单元测试?
- python - 读取 MDF 文件 int Pandas DataFrame
- css - Angular Material 2 带有固定(粘性)标签标签的标签
- anaconda - 全新 conda 环境中的 Spyder 启动错误
- makefile - 是否有目标特定变量的非传递版本?