Question

I have both Python 2.7 and 3.3 installed on my system. I'm trying to hopefully write everything for 3.3. I've run into a snag. I need to install Pillow on 3.3 so I can use Images. How do I get it to install on 3.3. If I try

pip install Pillow

It comes up and says 'Requirement already satisfied(use --upgrade to upgrade): Pillow in /usr/lib/python2.7/dist-packages'

How do I get Pillow to install on 3.3, since that is where I need it?

I ran through the rest of the install(setuptools and prerequisites). Not sure where they installed. I did use the python3-setuptools for the initial install attempt. I don't know if that helped to control the flow of the prerequisites to 3.3 or not.

This is on a Linux system.

Was it helpful?

Solution

Your 2.7 and 3.3 have their own separate site-packages locations.

And, just as they have their own separate executables (usually python and python2.7 for 2.7, and python3 and python3.3 for 3.3), when you install pip for each one, they'll each have their own pip scripts (usually pip, pip2, and pip2.7 vs. pip3 and pip3.3).

So, just do this:

pip3.3 install Pillow

As a side note, if you use virtual environments, either via the third-party virtualenv package or the stdlib venv package (3.3+ only, and really not worth using until 3.4), this problem goes away: when you're inside a virtual environment, it's either a 2.7 environment or a 3.3 environment, and it's as if nothing else exists.


The basic design is explained in PEP 394. How pip fits into that design is explained in… as far as I know, docs that haven't been written yet, but will hopefully be part of Python 3.4.0 and/or pip 1.5.something.

Older versions of pip (I believe before 1.5.0) would use pip and pip-2.7 vs. pip and pip-3.3, which obviously leads to a bit of confusion.

And some distros have their own python-pip packages that do things differently. And then there's Arch, where python actually means 3.2. And so on.

But the basic idea is that when you have Python X.Y and V.W side by side, there will be some way to differentiate explicitly.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top