English 中文(简体)
如何在乌班图安装三版包装材料?
原标题:How to install python3 version of package via pip on Ubuntu?

I have both python2.7 and python3.2 installed in Ubuntu 12.04.
The symbolic link python links to python2.7.

第一类:

sudo pip install package-name

它将安装<代码>python2版本>>。

Some package supports both python2 and python3.
How to install python3 version of package-name via pip?

最佳回答

您不妨在启动虚拟平台后,建立virtualenv。 因此,你的制度赢得了以下信息:

这可能是:

virtualenv -p /usr/bin/python3 py3env
source py3env/bin/activate
pip install package-name
问题回答

python3-pip。 将安装pip-3.2(或pip-3.3,pip-3.4pip3,供新版本使用),但无需通过黄布()。


我来到这里,确定这一点,不需要<代码>wget或虚拟版(假设乌班图12.04):

  1. Install package python3-setuptools: run sudo aptitude install python3-setuptools, this will give you the command easy_install3.
  2. Install pip using Python 3 s setuptools: run sudo easy_install3 pip, this will give you the command pip-3.2 like kev s solution.
  3. Install your PyPI packages: run sudo pip-3.2 install <package> (installing python packages into your base system requires root, of course).
  4. Profit!

Short Answer

sudo apt-get install python3-pip
sudo pip3 install MODULE_NAME

资料来源: Bharadwaj s comment

Long Answer

简短的答复只适用于较新的系统。 乌班图的一些版本的指挥为pip-3.2:

sudo pip-3.2 install MODULE_NAME

If it doesn t work, this method should work for any Linux distro and supported version:

sudo apt-get install curl
curl https://bootstrap.pypa.io/get-pip.py | sudo python3
sudo pip3 install MODULE_NAME

如果没有<代码>curl,则使用<代码>wget。 如果没有<代码>sudo,改用<代码>root。 pip3 互不相干,如Pip-3。

大量的on包也要求开发公司包裹,这样也安装了:

sudo apt-get install python3-dev

Sources:
python installing packages with pip
Pip latest install

查询Tobu swer,如果你想得到一个更加升级的Sharma。

I want to add that using a virtual environment is usually the preferred way to develop a python application, so @felixyan answer is probably the best in an ideal world. But if you really want to install that package globally, or if need to test / use it frequently without activating a virtual environment, I suppose installing it as a global package is the way to go.

Well, on ubuntu 13.10/14.04, things are a little different.

Install

$ sudo apt-get install python3-pip

Install packages

$ sudo pip3 install packagename

安装最新<代码>pip2/_pip3和相应的包裹的最容易方式:

curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2
pip2 install package-name    

curl https://bootstrap.pypa.io/get-pip.py | python3
pip3 install package-name

Note: please run these commands as root

在试图安装皮拉布时,我也存在同样的问题,我发现,link

因此,我在3号楼内安装皮拉布是:

python3 -m pip install SomePackage

它工作得当,而且正如你能够看到的,你可以为你的每一版古典做这项工作,因此,我猜想这个问题会得到解决。

老问题,但回答中没有一个涉及我。 我的一个系统是乌班图12.04 LTS,由于某种原因,没有包装<代码>python3-pip或python-pip。 3. 因此,我做了些什么(所有指挥都是作为根基执行的):

  • Install setuptools f或-0303 in case You haven t.

    apt-get install python3-setuptools
    

    aptitude install python3-setuptools
    
  • With Python 2.4+ you can invoke easy_install with specific Python version by using python -m easy_install. So pip f或 Python 3 could be installed by:

    python3 -m easy_install pip
    
  • That s it, you got pip f或 Python 3. Now just invoke pip with the specific version of Python to install package f或 Python 3. F或 example, with Python 3.2 installed on my system, I used:

    pip-3.2 install [package]
    

If you have pip installed in both pythons, and both are in your path, just use:

$ pip-2.7 install PACKAGENAME
$ pip-3.2 install PACKAGENAME

参考资料:

这是一个重复的问题:#28125

If your system has python2 as default, use below command to install packages to python3

$ python3 -m pipstalment; Package-name>

足够容易:

sudo aptitude install python3-pip
pip-3.2 install --user pkg

如果你想要Sharma 3.3,那是乌班图12.10的缺省。

sudo aptitude install python3-pip python3.3
python3.3 -m pip.runner install --user pkg

否则,你只能操作<代码>pip3 安装成套名称而不是pip

首先,你需要安装Pip,安装你想要的3座大楼。 然后,你会跑到这个时候,为这颗灰色版本安装包裹。

由于你在P/usr/bin上有两个Pip和Python 3,我假定他们都是用某种包装经理安装的。 这个一揽子管理人员也应该有3台Pip。 这是你应当安装的。

虚拟校车建议很好。 如果你只是测试,或者你正在做开发工作,那么你就没有在系统晚间安装成套设备。 在这些情况下,利用虚拟或甚至建造自己的宝石以促进发展更好。

但是,如果你真的希望把这套设备安装在系统台上,那么将铺设第3号飞机是行走的路。

虽然这个问题与乌兰巴托有关,但请允许我指出,在Mac和我的<代码>python上,I m对2.7.5的指挥违约。 我还通过<代码>python3获取第3条,这样,我才知道“普惠制”的原产地,然后下载并印发了<代码>sudo python3。 pystal/code> against it, and, 当然,就足够了,那么现在只有Adhur 3在其现场包裹内有这个模块。 希望有助于浪费Mastranger。

直接向学生赠送。

首先确定你想要的PIP版本。

jon-mint python3.3 # whereis ip
ip: /bin/ip /sbin/ip /usr/share/man/man8/ip.8.gz /usr/share/man/man7/ip.7.gz

然后执行。

jon-mint python3.3 # pip3.3 install pexpect
Downloading/unpacking pexpect
  Downloading pexpect-3.2.tar.gz (131kB): 131kB downloaded
  Running setup.py (path:/tmp/pip_build_root/pexpect/setup.py) egg_info for package pexpect

Installing collected packages: pexpect
  Running setup.py install for pexpect

Successfully installed pexpect
Cleaning up...
  1. 应安装所有附属设施:

    sudo aptget establishing-essential python3-dev python3-setuptools python3-numpy python3-scipy libatlas-dev libatlas3gf-base

  2. 请参看第3步:

    <代码>sudo aptgetstalthon3-pip

  3. Iinstall scikit-learn by pip3

    <代码>pip3 安装——U scikit-learn

  4. 开放您的终端和入口层3环境,import sklearn以检查。

To install pip for python3 use should use pip3 instead of pip. To install python in ubuntu 18.08 bionic
before installing a version of python, activate virtual environment so that it won t have any problem in a future versions of python.

virtualenv -p /usr/bin/python3 py3env
source py3env/bin/activate

然后安装了你想要的实际版面。

>> sudo aptget establishing python3.7

To install the required pip package in ubuntu
>> sudo apt-get install python3-pip

页: 1 简便的终端/集装箱。

指挥部

sudo apt update
sudo apt upgrade
sudo apt install python3-pip3
pip3 install package-name

您可使用pip3.2安装包装名称或python3.2-m pip安装包装名称。

Another way to install python3 is using wget. Below are the steps for installation.

wget http://www.python.org/ftp/python/3.3.5/Python-3.3.5.tar.xz
tar xJf ./Python-3.3.5.tar.xz
cd ./Python-3.3.5
./configure --prefix=/opt/python3.3
make && sudo make install

而且,人们也可以利用他人为同一人创造其他东西。

echo  alias py="/opt/python3.3/bin/python3.3"  >> ~/.bashrc

现在开放一个新的终点站和类型py和报到。





相关问题
Can Django models use MySQL functions?

Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...

An enterprise scheduler for python (like quartz)

I am looking for an enterprise tasks scheduler for python, like quartz is for Java. Requirements: Persistent: if the process restarts or the machine restarts, then all the jobs must stay there and ...

How to remove unique, then duplicate dictionaries in a list?

Given the following list that contains some duplicate and some unique dictionaries, what is the best method to remove unique dictionaries first, then reduce the duplicate dictionaries to single ...

What is suggested seed value to use with random.seed()?

Simple enough question: I m using python random module to generate random integers. I want to know what is the suggested value to use with the random.seed() function? Currently I am letting this ...

How can I make the PyDev editor selectively ignore errors?

I m using PyDev under Eclipse to write some Jython code. I ve got numerous instances where I need to do something like this: import com.work.project.component.client.Interface.ISubInterface as ...

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

Pragmatically adding give-aways/freebies to an online store

Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...

Converting Dictionary to List? [duplicate]

I m trying to convert a Python dictionary into a Python list, in order to perform some calculations. #My dictionary dict = {} dict[ Capital ]="London" dict[ Food ]="Fish&Chips" dict[ 2012 ]="...

热门标签