1

Why the module has been installed but not seen?

foo@bar:~/PycharmProjects/my$ virtualenv env
New python executable in /home/foo/PycharmProjects/my/env/bin/python
Installing setuptools, pip, wheel...done.
foo@bar:~/PycharmProjects/my$ source ./env/bin/activate
(env) foo@bar:~/PycharmProjects/my$ pip install django
Traceback (most recent call last):
  File "/home/pavel/PycharmProjects/my/env/bin/pip", line 7, in <module>
    from pip import main
ImportError: No module named pip

(env) foo@bar:~/PycharmProjects/my$ which pip
  /home/foo/PycharmProjects/my/env/bin/pip
das-g
  • 9,718
  • 4
  • 38
  • 80
Ivegotaquestion
  • 187
  • 1
  • 9
  • Why do you `source ./env/bin/activate` when your virtualenv is already activated? Try not to do this and see? – valentin Feb 25 '16 at 09:54
  • Why do you think it was already activated? – Ivegotaquestion Feb 25 '16 at 10:52
  • @Ivegotaquestion because of this line `(env) foo@bar:~/PycharmProjects/my$ source ./env/bin/activate`, (env) indicates that you have already activated env and trying to do same – Kamlesh Feb 25 '16 at 11:07
  • 1
    Possible duplicate of [ImportError: No module named pip when trying to install packages](http://stackoverflow.com/questions/22391580/importerror-no-module-named-pip-when-trying-to-install-packages) – Kamlesh Feb 25 '16 at 11:20
  • @Kjjassy: sorry, I was replacing my real username with foo@bar, this is where this (env) appeared. – Ivegotaquestion Feb 25 '16 at 15:18

1 Answers1

0

If you are already activated your virtualenv then deactivate it

(env)foo@bar:~/PycharmProjects/my$ deactivate

and try to create virtualenv with different name

foo@bar:~/PycharmProjects/my$ virtualenv venv

then activate virtualenv with this commands

foo@bar:~/PycharmProjects/my$ source venv/bin/activate

Now it should look like this

(venv) foo@bar:~/PycharmProjects/my$

And finally you can install packages

(venv) foo@bar:~/PycharmProjects/my$ pip install django
Kamlesh
  • 2,032
  • 2
  • 19
  • 35