0

I have a problem with my Pip version. I am trying out to install the pyDatalog package, which isn't supported by Anaconda.

   The following specifications were found to be in conflict:
  - pydatalog
  - python 3.5*

In my Ubuntu, I have two versions of Python (2.7 and Anaconda with 3.5). For Python 2.7 I don't even know whether or not Pip is installed.

How can I have two different versions of Pip for different versions of Python on one computer? Can I use one version of Pip for both version of Python?

Zac Crites
  • 822
  • 10
  • 14
Alex
  • 3,923
  • 3
  • 25
  • 43
  • in general i have pip only for anaconda, but it doesn't work for python 2.7 – Alex Oct 02 '16 at 16:52
  • you can try 'whereis python 2.7' it should shows where is python installed. Also as far asi remember pip supports command like 'pip-2.7 command' – nick_gabpe Oct 02 '16 at 16:54
  • when i wrote this i got: pip2.7 `Traceback (most recent call last): File "/usr/local/bin/pip2.7", line 9, in load_entry_point('pip==7.1.0', 'console_scripts', 'pip2.7')() File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 558, in load_entry_point File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 2682, in load_entry_point File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 2355, in load File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 2361, in resolve ImportError: No module named pip` – Alex Oct 02 '16 at 16:56
  • Sorry my fault i forget syntax. Correct command "pip2.7 command" as you can see in stacktrace "/usr/local/bin/pip2.7". For python 3.5 correct command is "pip3.5 command". This is two different versions of pip. – nick_gabpe Oct 02 '16 at 17:06
  • older Python2 did not install `pip` and you have to do it on your own - on `Ubuntu` use `apt-get` or `apt` - `sudo apt-get install python-pip` – furas Oct 02 '16 at 17:06
  • Thanks you then i don't understand conception of this, because if i install pip and default version of python is 3.5, will it wrong for pip? As i have understood that for each version of python there is its pip, isn't it? or pip will work for all versions python? – Alex Oct 02 '16 at 17:18
  • This is not a good practice but it's possible. Yes each python have own version of pip. – nick_gabpe Oct 02 '16 at 17:24
  • All works now. But i don't understand why? pip worked for python 3.5 why by default it was downloaded for 2.7, when python 3.5 was by default – Alex Oct 02 '16 at 17:25
  • doesn't it matter what version of python is? will pip work correctly? – Alex Oct 02 '16 at 17:27
  • That's why this is bad practice. – nick_gabpe Oct 03 '16 at 19:06

1 Answers1

1

Take a look at pyenv located in https://github.com/yyuu/pyenv/blob/master/README.md.

You can install multiple versions of python and pip.

The README has instructions for installing pyenv, installing wanted python versions and switching between them.

ge7600
  • 401
  • 3
  • 8