Installation de Django dans un environnement virtuel.

51 views
Skip to first unread message

Philippe Idlas

unread,
Jul 24, 2016, 8:46:15 AM7/24/16
to Django users
Bonjour,

J'ai créé deux environnements virtuels sous Python avec 'virtualenv'. L'un fonctionne avec python2.7 et s'appelle 'gandalf'. L'autre avec python3.4 et s'appelle 'tuto_env'. Sous 'gandalf' j'ai installé django + mezzanine selon le tutoriel de Ross Laird. Sous 'tuto_env' je n'ai installé pour l'instant que django avec la commande : pip install django. Sous 'gandalf' tout fonctionne correctement. Sous 'tuto_env' j'ai le problème suivant. Au moment de l'installation de django, le message d'erreur suivant apparaît:
(tuto_env) philippe@srv-web-idlas:~/www-dev/.virtualenvs/tuto_env$ sudo pip install django

Requirement already satisfied (use --upgrade to upgrade): django in /usr/local/lib/python2.7/dist-packages
Cleaning up...

Pourtant avant de lancer l'installation de django je me connecte bien dans mon environnement 'tuto_env' comme ceci :

workon tuto_env


J'ai également installé 'yolk' et la liste des packages installés montre que le seul environnement actif pour python est python2.7.

(tuto_env) philippe@srv-web-idlas:~/www-dev/.virtualenvs/tuto_env$ yolk -l
Django 1.9.8 has no metadata
Pillow          - 2.6.1        - active
South           - 1.0.2        - active development (/usr/local/lib/python2.7/dist-packages)
argparse        - 1.2.1        - active development (/usr/lib/python2.7)
cffi            - 0.8.6        - active
chardet         - 2.3.0        - active
colorama        - 0.3.2        - active
cryptography    - 0.6.1        - active
filebrowser-safe 0.4.3 has no metadata
html5lib        - 0.999        - active
lxml            - 3.4.0        - active
ndg-httpsclient - 0.3.2        - active development (/usr/lib/pymodules/python2.7)
numpy           - 1.8.2        - active
pbr 1.8.1 has no metadata
pip             - 1.5.6        - active
ply             - 3.4          - active
psycopg2        - 2.5.4        - active
pyOpenSSL       - 0.14         - active
pyasn1          - 0.1.7        - active
pycparser       - 2.10         - active
pycups          - 1.9.63       - active
pycurl          - 7.19.5       - active
PyGObject       - 3.14.0       - active
pysmbc          - 1.0.15.3     - active
pyxdg           - 0.25         - active
requests        - 2.4.3        - active
setuptools      - 5.5.1        - active
six 1.10.0 has no metadata
six             - 1.8.0        - non-active
stevedore 1.12.0 has no metadata
urllib3         - 1.9.1        - active
virtualenv-clone - 0.2.6        - active development (/usr/local/lib/python2.7/dist-packages)
virtualenv      - 1.11.6       - non-active
virtualenv 14.0.6 has no metadata
virtualenvwrapper 4.7.1 has no metadata
wheel           - 0.24.0       - active
wsgiref         - 0.1.2        - active development (/usr/lib/python2.7)
yolk            - 0.4.3        - active development (/usr/local/lib/python2.7/dist-packages)
 
Je ne comprends pas bien d'où vient mon erreur. Si quelqu'un pouvez me donner une idée ou une piste ?

Cordialement.

webmam...@gmail.com

unread,
Jul 24, 2016, 10:17:30 AM7/24/16
to Django users
Can You, please, in English describe what a problem You have? I understand just that this is some with virtualenv.


ludovic coues

unread,
Jul 24, 2016, 2:20:56 PM7/24/16
to django...@googlegroups.com
Est-ce que l'erreur survient aussi si la commande est lancé sans sudo ?
Dans un virtualenv, sudo ne devrait pas etre utilisé, on travail avec
des fichiers que l'on a crée, dans notre dossier personnel.

2016-07-24 16:17 GMT+02:00 <webmam...@gmail.com>:
> Can You, please, in English describe what a problem You have? I understand
> just that this is some with virtualenv.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users...@googlegroups.com.
> To post to this group, send email to django...@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/36fed426-aa40-4ab0-bf7a-430de2888240%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.



--

Cordialement, Coues Ludovic
+336 148 743 42

Siddharth Ghumre

unread,
Jul 25, 2016, 4:44:39 AM7/25/16
to django...@googlegroups.com
I think "sudo pip install django" is the problem here as when you so sudo it installs it in the host machine not in virtualenv so the thumb rule says -  dont use sudo when you are working in vitrual env. 

I guess pip install Django==1.X.X would solve the problem.

Suggestion - use pip freeze to list all the installed packages in the virtual env.

Hope this helps.

Bonne Chance
-Sid

Shem Geek

unread,
Jul 25, 2016, 10:41:25 AM7/25/16
to Django users
Chances are high that one of the apps you are installing is already installed and in its latest version, however, I dont understand what you are asking

Quentin Fulsher

unread,
Jul 25, 2016, 7:50:14 PM7/25/16
to Django users
Je aussi pense que le probleme est quand tu utilizes le command `sudo`. J'irai essayer le installation sans le `sudo`.

Aussi français n'est pas mon premiere lang donc si tu ne comprend je peux essayer encore.

Bon chance!
Reply all
Reply to author
Forward
0 new messages