简体   繁体   English

我想为python3.6安装pip。 当我已经安装了另一个版本的 python3 时。

[英]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.

相关问题 我在Mac上安装了python 2.7和3.6。 如何找到与Python3相关的pip版本? - I have python 2.7 and 3.6 installed on my mac. How to find the version of pip associated with Python3? 我在 pip install src python3.6 上有错误 - i have error on pip install src python3.6 当我尝试为Python 3.6安装Pygame时,Pip无法正常工作[已过时] - Pip not working when I try to install Pygame for Python 3.6 [Outdated] 我可以pip安装python3.6吗? - Can I pip install python3.6? 使用python3.6抓取网站。 我无法通过登录页面 - Scraping a site with python3.6. I can't progress past the login page 看来我安装了2个版本的os python 3。 理想情况下,我想将3.6.4用于pygame,但我有Tcl / Tk错误(我该如何解决?) - It seems I have 2 versions os python 3 installed. Ideally I Would want to use 3.6.4 for pygame but I have Tcl/Tk error(how do i fix this?) Python pip安装qibuild异常,然后我安装了pip呢。 - Python pip install qibuild exception then I installed pip yet. 我想为python安装pyOpt,但是pyopt已经安装并且pip不区分大小写 - I want to install pyOpt for python, but pyopt is already installed and pip is case insensitive 为什么我不能pip安装Python3包? - Why cannot I pip install a Python3 package? Pip安装到python3.6但是我在Ubuntu 18.04上使用带有VS Code的python3.7 - Pip is installed to python3.6 but I'm using python3.7 with VS Code on Ubuntu 18.04
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM