1

I have two Django installations:

  • Django 1.4 in the base physical python env,
  • Django 1.7 in a virtualenv.

When I try to install django-rest-swagger working on virtualenv through:

pip install django-rest-swagger

It uninstalls Django 1.4 in my base physical python env, upgrading it to the last version.

How can I install django-rest-swagger in my virtualenv without modifications of Django version in my physical env?

floatingpurr
  • 7,749
  • 9
  • 46
  • 106
  • Did you get into the virtualenv first with `source bin/activate`? You can also use the virtualenv's pip directly from `/yourvenv/bin/pip`. – dukebody Sep 24 '15 at 11:02
  • I entered `workon myvirtualenvname` before pip ([virtualenvwrapper](http://thecodeship.com/deployment/deploy-django-apache-virtualenv-and-mod_wsgi/)), as I usually do for installing on virtualenv but, in that case, It did not work. – floatingpurr Sep 24 '15 at 11:06
  • 2
    Try using the `--no-site-packages` option when creating the virtualenv with virtualenvwrapper. Also check answers in http://stackoverflow.com/questions/1382925/virtualenv-no-site-packages-and-pip-still-finding-global-packages – dukebody Sep 24 '15 at 11:46
  • I read, but my virtualenv is already using `--no-site-packages` option – floatingpurr Sep 24 '15 at 11:53
  • 1
    Check your `PYTHONPATH` variable after activating the venv. You might have something in your `.bashrc` or other shell profile files injecting the system path before the virtualenv one. – dukebody Sep 24 '15 at 11:55
  • @dukebody I'm sorry it was my fault: I'm doing it as sudo. Without sudo, it works fine. – floatingpurr Sep 24 '15 at 15:33

0 Answers0