[英]I want to install pip for python3.6. When i allready have another version of python3 is installed.
But when i run command sudo apt-get install python3-pip.但是当我运行命令 sudo apt-get install python3-pip 时。 It is installed but inot as python3.6.
它已安装但未安装为 python3.6。 It is installed in python3.5.I have also specified the version in command ie sudo apt-get install python3.6-pip.But it gives me an error.
它安装在python3.5中。我还在命令中指定了版本,即sudo apt-get install python3.6-pip。但它给了我一个错误。
Reading package lists... Done Building dependency tree正在阅读包列表...完成构建依赖树
Reading state information... Done E: Unable to locate package python3.6-pip E: Couldn't find any package by glob 'python3.6-pip' E: Couldn't find any package by regex 'python3.6-pip'正在读取状态信息...完成 E: 无法找到包 python3.6-pip E: 找不到任何包通过 glob 'python3.6-pip' E: 找不到任何包通过正则表达式 'python3.6-点'
您可以立即使用python3.6 -m pip install [Package_to_install]
安装 python 包。
I use PipEnv for working in different environments with different python versions.我使用PipEnv在具有不同 python 版本的不同环境中工作。
the usage would be something like pipenv --python 3.X
and it will install that version of python if its not installed.用法类似于
pipenv --python 3.X
,如果未安装,它将安装该版本的 python。
It also makes things really helpful if you are collaborating with other developers, because it creates a PipFile (alt to requirements.pip
) which will contain the version of python used for the project so all developers will use the same version of python on a project without doing any prep work.如果您与其他开发人员合作,它也会使事情变得非常有用,因为它创建了一个 PipFile(替代到
requirements.pip
),其中将包含用于项目的 Python 版本,因此所有开发人员将在项目中使用相同版本的 Python无需做任何准备工作。
If you don't want to use pipenv you can use pip3.5 or create a python3.5 environment like virtualenv [NAME] --python=/usr/lib/python3.5
and then install the package using pip install somepackage
如果你不想使用 pipenv 你可以使用 pip3.5 或者创建一个 python3.5 环境,比如
virtualenv [NAME] --python=/usr/lib/python3.5
然后使用pip install somepackage
安装包
It was easy.很容易。 I just changed my default python3 version:
我刚刚更改了我的默认 python3 版本:
sudo gedit ~/.bashrc alias python3="python3.6"
Now I can install the packages using python3.6 with现在我可以使用 python3.6 安装软件包
-m pip install 'packagenae'
This will help you fix the above problem这将帮助您解决上述问题
You need to add following personal package repository:您需要添加以下个人软件包存储库:
sudo add-apt-repository ppa:deadsnakes/ppa
Check for updates检查更新
sudo apt-get update
install python using following command使用以下命令安装python
sudo apt-get install python3.6
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.