1

I have python3.6.5 and pip 19.0.2 on my ubuntu. I need to install a package which works in python2.6. I created a virtual environment using

conda create -n myenv python=2.6

I activated the virtual environment and installed pip using

sudo apt install python-pip.

It gave no errors and installed pip. However, when I try to use pip it gives the following error:

Traceback (most recent call last): File "/home/leila/anaconda3/envs/myenv/bin/pip", line 4, in from pip import main ImportError: cannot import name main

Thanks, Leila

Leila
  • 61
  • 2
  • As conda provides own pip in myenv, installing another system-wide instance of pip with the sudo command was excessive. Mixing both pips causes problems. If you use conda, try to rollback by `sudo apt remove python-pip`, then just close/open the terminal. Please check out [here](https://stackoverflow.com/a/49988228/9575715) for more. – stop.climatechange.now Feb 14 '19 at 08:15

0 Answers0