python - 如何删除其他 python 版本并继续使用 python 3.5
问题描述
我已经安装了 Python3.5.6,但是当我检查我的终端时,我发现我还有 Python 2.7.15rc1 和 Python 3.6.7 当我输入 Python 时,我会导致 Python 2.7.15rc1 当我输入 Python3 时,我会导致 Python 3.5。 6 当我输入 Python3.5 时,我会导致 Python 3.5.6 当我输入 Python3.6 时,我会导致 Python 3.6.7
请帮忙,因为我无法在 Python 3.5 上使用 pip3 安装像 numpy 这样的包
我想继续使用 Python 3.5
解决方案
使用虚拟环境
$ python3.x -m venv <venvname>
linux $ source venvname/bin/activate
windows > source venvname/bin/activate.ps1
终端中的虚拟环境以安装到该本地单独副本。
或使用“make altinstall”重新安装-> https://stackoverflow.com/a/2547577/6529424
推荐阅读
- office-js - 当用户以内联模式回复/转发时如何关闭 UI
- python - 带有热图的 Matplotlib 用于在后台进行预测
- c# - 具有相同 ID 的多个对象的实体框架跟踪问题
- azure-devops - 企业网络背后的 Azure Devops Pull Request 和 Jenkins
- python - 使用 youtube_dl 下载字幕
- c - 如何使用c将增量值打印0.1?
- node.js - 预计第 32 行第 1 列远程的另一个键值对:!无法解析 package.json
- python - 使用行数从 CSV 处理到 CSV 时出现问题
- soap - Kotlin 中的 Retrofit2 + SimpleXML + SOAP 请求
- css - 获取 BrowserslistError: Unknown browser query `dead` when try tocompile the react application