I encounter a problem with pip
installation on linux. I've python 2.7 and 3.4, also Django in 1.7 installed. Currently I'm working on a project which uses different versions and I'm unable to install packages trough pip
on python 2.7. Everything goes to directory of 3.4.
Is there any way to "force" pip
to install packages in concrete version of python?
Asked
Active
Viewed 681 times
0

advena
- 83
- 13
-
you should use virtual enviornment if you have multiple version of python. – Vishnu Upadhyay Oct 09 '14 at 06:31
-
Your system seems to be using python3 as the default python version. What os are you using? Are you on Gentoo or Arch? – John Smith Optional Oct 09 '14 at 06:57
-
no it's mint and as default python 2.7 is used. If I want to use python 3.4 I need to force the system by `python3` command. But `pip install` uses python 3.4. – advena Oct 09 '14 at 07:15
-
check for packages in your distro for pip. There should be one for python2 and one for python3. Install the one for python2. You should then be able to run `pip-2.7` or `pip-python2` to install packages for python2. – John Smith Optional Oct 09 '14 at 07:23
-
If you can't find it in your distro, install it by hand. Have a look at this question, particularly this comment: http://stackoverflow.com/questions/11268501/how-to-use-pip-with-python-3-x-alongside-python-2-x#comment14822876_11272201 – John Smith Optional Oct 09 '14 at 08:03
1 Answers
0
The usual, and recommended by most users, way of working with Django is to use a separate, virtual environment per project.
Use virtualenv to set up your Python 2.x environment and venv for Python 3.x. Both will install their own, local version of pip. Google lists lots of tutorials if you need help beyond the documentation.

Phillip
- 13,448
- 29
- 41