Discussion:
importError: Count Not import Django inside Virtualenv
tango ward
2018-02-13 20:43:45 UTC
Permalink
Hi,

I want to seek some advice about the error. All of my pet projects in my
desktop are getting the same error even though virtualenv is activated. I
can confirm that when I started playing around with the projects, I have
installed Django inside virtualenv without using "sudo". Now, I can't run
python manage.py runserver and the packages that I am getting whenever I
run pip freeze are different from before which doesn't include Django in
the list.


Any advice pls?


Thanks,
Jarvis
--
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/CAA6wQLKp3oz-6FfDzQ%3Dip4XRsuLPSeOCuwkbUuWbe1JNx2YhFA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Jason
2018-02-13 22:53:04 UTC
Permalink
if pip freeze doesn't include django in the output, then the django package
is not installed in the virtualenv. are you sure the virtualenv was active
when you installed django?

also, remember that if you installed latest django, eg *pip install django*,
it won't install for python2 venvs.
Post by tango ward
Hi,
I want to seek some advice about the error. All of my pet projects in my
desktop are getting the same error even though virtualenv is activated. I
can confirm that when I started playing around with the projects, I have
installed Django inside virtualenv without using "sudo". Now, I can't run
python manage.py runserver and the packages that I am getting whenever I
run pip freeze are different from before which doesn't include Django in
the list.
Any advice pls?
Thanks,
Jarvis
--
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/9ddf691d-6d16-4fa1-aab0-f534fef445ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
PASCUAL Eric
2018-02-13 21:38:54 UTC
Permalink
Hi Jarvis,


Can you provide the error messages trace ? It can greatly help understanding what's happening.


If you haven't already done this, try to restart from a fresh new virtualenv inside which you'll install Django and the additional packages you've added (if any). Then restore a copy of your project in this context (if by chance you work with git, a simple git clone will do the trick) and test your app again.


Hoping you haven't already messed your system Python by installing stuff in sudo mode. The situation could be a little more complicated then.


Best.


Eric
________________________________
From: django-***@googlegroups.com <django-***@googlegroups.com> on behalf of tango ward <***@gmail.com>
Sent: Tuesday, February 13, 2018 9:43:45 PM
To: django-***@googlegroups.com
Subject: importError: Count Not import Django inside Virtualenv

Hi,

I want to seek some advice about the error. All of my pet projects in my desktop are getting the same error even though virtualenv is activated. I can confirm that when I started playing around with the projects, I have installed Django inside virtualenv without using "sudo". Now, I can't run python manage.py runserver and the packages that I am getting whenever I run pip freeze are different from before which doesn't include Django in the list.


Any advice pls?


Thanks,
Jarvis

--
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<mailto:django-users+***@googlegroups.com>.
To post to this group, send email to django-***@googlegroups.com<mailto: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/CAA6wQLKp3oz-6FfDzQ%3Dip4XRsuLPSeOCuwkbUuWbe1JNx2YhFA%40mail.gmail.com<https://groups.google.com/d/msgid/django-users/CAA6wQLKp3oz-6FfDzQ%3Dip4XRsuLPSeOCuwkbUuWbe1JNx2YhFA%40mail.gmail.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
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/AM5P193MB0083C66FCD689270720750708CF60%40AM5P193MB0083.EURP193.PROD.OUTLOOK.COM.
For more options, visit https://groups.google.com/d/optout.
tango ward
2018-02-14 02:13:39 UTC
Permalink
Hi,

The error message that I am getting is:

Traceback (most recent call last):
File "manage.py", line 8, in <module>
from django.core.management import execute_from_command_line
ModuleNotFoundError: No module named 'django'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "manage.py", line 14, in <module>
) from exc
ImportError: Couldn't import Django. Are you sure it's installed and
available on your PYTHONPATH environment variable? Did you forget to
activate a virtual environment?


@Jason,

It's weird because couple of days, I can still run these pet projects
without any error. If I go to venv folder
virtual/lib/python3.6/site-packages, I can see django there. It seems that
even though virtualenv is activated, the packages I installed inside it are
not recognized by the system.
Post by PASCUAL Eric
Hi Jarvis,
Can you provide the error messages trace ? It can greatly help
understanding what's happening.
If you haven't already done this, try to restart from a fresh new
virtualenv inside which you'll install Django and the additional packages
you've added (if any). Then restore a copy of your project in this context
(if by chance you work with git, a simple git clone will do the trick) and
test your app again.
Hoping you haven't already messed your system Python by installing stuff
in sudo mode. The situation could be a little more complicated then.
Best.
Eric
------------------------------
*Sent:* Tuesday, February 13, 2018 9:43:45 PM
*Subject:* importError: Count Not import Django inside Virtualenv
Hi,
I want to seek some advice about the error. All of my pet projects in my
desktop are getting the same error even though virtualenv is activated. I
can confirm that when I started playing around with the projects, I have
installed Django inside virtualenv without using "sudo". Now, I can't run
python manage.py runserver and the packages that I am getting whenever I
run pip freeze are different from before which doesn't include Django in
the list.
Any advice pls?
Thanks,
Jarvis
--
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
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/CAA6wQLKp3oz-6FfDzQ%3Dip4XRsuLPSeOCuwkbUuWbe1JNx2Y
hFA%40mail.gmail.com
<https://groups.google.com/d/msgid/django-users/CAA6wQLKp3oz-6FfDzQ%3Dip4XRsuLPSeOCuwkbUuWbe1JNx2YhFA%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
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
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/AM5P193MB0083C66FCD689270720750708CF60%40AM5P193MB0083.
EURP193.PROD.OUTLOOK.COM
<https://groups.google.com/d/msgid/django-users/AM5P193MB0083C66FCD689270720750708CF60%40AM5P193MB0083.EURP193.PROD.OUTLOOK.COM?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
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/CAA6wQLLZyeuQiFL6fe4HvC4a6ogZnTh7kGrc62ni95aPggChyA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
tango ward
2018-02-14 02:40:04 UTC
Permalink
Hi Eric,


I tried what you suggested and it works! I was just wondering why my
existing pet projects have the same problem?
Post by tango ward
Hi,
File "manage.py", line 8, in <module>
from django.core.management import execute_from_command_line
ModuleNotFoundError: No module named 'django'
File "manage.py", line 14, in <module>
) from exc
ImportError: Couldn't import Django. Are you sure it's installed and
available on your PYTHONPATH environment variable? Did you forget to
activate a virtual environment?
@Jason,
It's weird because couple of days, I can still run these pet projects
without any error. If I go to venv folder virtual/lib/python3.6/site-packages,
I can see django there. It seems that even though virtualenv is activated,
the packages I installed inside it are not recognized by the system.
Post by PASCUAL Eric
Hi Jarvis,
Can you provide the error messages trace ? It can greatly help
understanding what's happening.
If you haven't already done this, try to restart from a fresh new
virtualenv inside which you'll install Django and the additional packages
you've added (if any). Then restore a copy of your project in this context
(if by chance you work with git, a simple git clone will do the trick) and
test your app again.
Hoping you haven't already messed your system Python by installing stuff
in sudo mode. The situation could be a little more complicated then.
Best.
Eric
------------------------------
*Sent:* Tuesday, February 13, 2018 9:43:45 PM
*Subject:* importError: Count Not import Django inside Virtualenv
Hi,
I want to seek some advice about the error. All of my pet projects in my
desktop are getting the same error even though virtualenv is activated. I
can confirm that when I started playing around with the projects, I have
installed Django inside virtualenv without using "sudo". Now, I can't run
python manage.py runserver and the packages that I am getting whenever I
run pip freeze are different from before which doesn't include Django in
the list.
Any advice pls?
Thanks,
Jarvis
--
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
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/ms
gid/django-users/CAA6wQLKp3oz-6FfDzQ%3Dip4XRsuLPSeOCuwkbUuWb
e1JNx2YhFA%40mail.gmail.com
<https://groups.google.com/d/msgid/django-users/CAA6wQLKp3oz-6FfDzQ%3Dip4XRsuLPSeOCuwkbUuWbe1JNx2YhFA%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
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
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/ms
gid/django-users/AM5P193MB0083C66FCD689270720750708CF60%
40AM5P193MB0083.EURP193.PROD.OUTLOOK.COM
<https://groups.google.com/d/msgid/django-users/AM5P193MB0083C66FCD689270720750708CF60%40AM5P193MB0083.EURP193.PROD.OUTLOOK.COM?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
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/CAA6wQLJCkd0B-0ep8jrUFk1QUp%3D_jQ_AuundhzBMwOSYf7h4fg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
PASCUAL Eric
2018-02-14 08:44:10 UTC
Permalink
Hi,


Hard to say without knowing the exact context, but my gut feeling is that you've modified a system wide library at a moment (maybe inadvertently).


My own experience is that it's easy to mess with Python libraries when installing packages with sudo , which may happen form time to time when working with virtualenv (or pyenv) since not very long, and being caught up by old habits (they tend to survive longer that wanted 😊).


Even if far less harmful, then --user option is to avoid for projects related libs, for the same reasons.


Eric
________________________________
From: django-***@googlegroups.com <django-***@googlegroups.com> on behalf of tango ward <***@gmail.com>
Sent: Wednesday, February 14, 2018 3:40:04 AM
To: django-***@googlegroups.com
Subject: Re: importError: Count Not import Django inside Virtualenv

Hi Eric,


I tried what you suggested and it works! I was just wondering why my existing pet projects have the same problem?

On Wed, Feb 14, 2018 at 10:13 AM, tango ward <***@gmail.com<mailto:***@gmail.com>> wrote:
Hi,

The error message that I am getting is:

Traceback (most recent call last):
File "manage.py", line 8, in <module>
from django.core.management import execute_from_command_line
ModuleNotFoundError: No module named 'django'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "manage.py", line 14, in <module>
) from exc
ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?


@Jason,

It's weird because couple of days, I can still run these pet projects without any error. If I go to venv folder virtual/lib/python3.6/site-packages, I can see django there. It seems that even though virtualenv is activated, the packages I installed inside it are not recognized by the system.


On Wed, Feb 14, 2018 at 5:38 AM, PASCUAL Eric <***@cstb.fr<mailto:***@cstb.fr>> wrote:

Hi Jarvis,


Can you provide the error messages trace ? It can greatly help understanding what's happening.


If you haven't already done this, try to restart from a fresh new virtualenv inside which you'll install Django and the additional packages you've added (if any). Then restore a copy of your project in this context (if by chance you work with git, a simple git clone will do the trick) and test your app again.


Hoping you haven't already messed your system Python by installing stuff in sudo mode. The situation could be a little more complicated then.


Best.


Eric
________________________________
From: django-***@googlegroups.com<mailto:django-***@googlegroups.com> <django-***@googlegroups.com<mailto:django-***@googlegroups.com>> on behalf of tango ward <***@gmail.com<mailto:***@gmail.com>>
Sent: Tuesday, February 13, 2018 9:43:45 PM
To: django-***@googlegroups.com<mailto:django-***@googlegroups.com>
Subject: importError: Count Not import Django inside Virtualenv

Hi,

I want to seek some advice about the error. All of my pet projects in my desktop are getting the same error even though virtualenv is activated. I can confirm that when I started playing around with the projects, I have installed Django inside virtualenv without using "sudo". Now, I can't run python manage.py runserver and the packages that I am getting whenever I run pip freeze are different from before which doesn't include Django in the list.


Any advice pls?


Thanks,
Jarvis

--
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<mailto:django-users+***@googlegroups.com>.
To post to this group, send email to django-***@googlegroups.com<mailto: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/CAA6wQLKp3oz-6FfDzQ%3Dip4XRsuLPSeOCuwkbUuWbe1JNx2YhFA%40mail.gmail.com<https://groups.google.com/d/msgid/django-users/CAA6wQLKp3oz-6FfDzQ%3Dip4XRsuLPSeOCuwkbUuWbe1JNx2YhFA%40mail.gmail.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

--
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<mailto:django-users+***@googlegroups.com>.
To post to this group, send email to django-***@googlegroups.com<mailto: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/AM5P193MB0083C66FCD689270720750708CF60%40AM5P193MB0083.EURP193.PROD.OUTLOOK.COM<https://groups.google.com/d/msgid/django-users/AM5P193MB0083C66FCD689270720750708CF60%40AM5P193MB0083.EURP193.PROD.OUTLOOK.COM?utm_medium=email&utm_source=footer>.

For more options, visit https://groups.google.com/d/optout.



--
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<mailto:django-users+***@googlegroups.com>.
To post to this group, send email to django-***@googlegroups.com<mailto: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/CAA6wQLJCkd0B-0ep8jrUFk1QUp%3D_jQ_AuundhzBMwOSYf7h4fg%40mail.gmail.com<https://groups.google.com/d/msgid/django-users/CAA6wQLJCkd0B-0ep8jrUFk1QUp%3D_jQ_AuundhzBMwOSYf7h4fg%40mail.gmail.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
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/AM5P193MB008390FC972C3F8D22B625968CF50%40AM5P193MB0083.EURP193.PROD.OUTLOOK.COM.
For more options, visit https://groups.google.com/d/optout.
tango ward
2018-02-14 09:09:51 UTC
Permalink
that's odd. Whenever I test a pacakge, it's always installed first in
virtualenv. Maybe when I updated my system? Btw, I have some projects which
are not yet in github, can I just copy and paste them in a new folder with
new virtualenv?
Post by PASCUAL Eric
Hi,
Hard to say without knowing the exact context, but my gut feeling is that
you've modified a system wide library at a moment (maybe inadvertently).
My own experience is that it's easy to mess with Python libraries when
installing packages with sudo , which may happen form time to time
when working with virtualenv (or pyenv) since not very long, and being
caught up by old habits (they tend to survive longer that wanted 😊).
Even if far less harmful, then --user option is to avoid for projects
related libs, for the same reasons.
Eric
------------------------------
*Sent:* Wednesday, February 14, 2018 3:40:04 AM
*Subject:* Re: importError: Count Not import Django inside Virtualenv
Hi Eric,
I tried what you suggested and it works! I was just wondering why my
existing pet projects have the same problem?
Hi,
File "manage.py", line 8, in <module>
from django.core.management import execute_from_command_line
ModuleNotFoundError: No module named 'django'
File "manage.py", line 14, in <module>
) from exc
ImportError: Couldn't import Django. Are you sure it's installed and
available on your PYTHONPATH environment variable? Did you forget to
activate a virtual environment?
@Jason,
It's weird because couple of days, I can still run these pet projects
without any error. If I go to venv folder virtual/lib/python3.6/site-packages,
I can see django there. It seems that even though virtualenv is activated,
the packages I installed inside it are not recognized by the system.
Hi Jarvis,
Can you provide the error messages trace ? It can greatly help
understanding what's happening.
If you haven't already done this, try to restart from a fresh new
virtualenv inside which you'll install Django and the additional packages
you've added (if any). Then restore a copy of your project in this context
(if by chance you work with git, a simple git clone will do the trick) and
test your app again.
Hoping you haven't already messed your system Python by installing stuff
in sudo mode. The situation could be a little more complicated then.
Best.
Eric
------------------------------
*Sent:* Tuesday, February 13, 2018 9:43:45 PM
*Subject:* importError: Count Not import Django inside Virtualenv
Hi,
I want to seek some advice about the error. All of my pet projects in my
desktop are getting the same error even though virtualenv is activated. I
can confirm that when I started playing around with the projects, I have
installed Django inside virtualenv without using "sudo". Now, I can't run
python manage.py runserver and the packages that I am getting whenever I
run pip freeze are different from before which doesn't include Django in
the list.
Any advice pls?
Thanks,
Jarvis
--
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
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/ms
gid/django-users/CAA6wQLKp3oz-6FfDzQ%3Dip4XRsuLPSeOCuwkbUuWb
e1JNx2YhFA%40mail.gmail.com
<https://groups.google.com/d/msgid/django-users/CAA6wQLKp3oz-6FfDzQ%3Dip4XRsuLPSeOCuwkbUuWbe1JNx2YhFA%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
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
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/ms
gid/django-users/AM5P193MB0083C66FCD689270720750708CF60%40AM
5P193MB0083.EURP193.PROD.OUTLOOK.COM
<https://groups.google.com/d/msgid/django-users/AM5P193MB0083C66FCD689270720750708CF60%40AM5P193MB0083.EURP193.PROD.OUTLOOK.COM?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
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
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/CAA6wQLJCkd0B-0ep8jrUFk1QUp%3D_jQ_AuundhzBMwOSYf7h4fg%
40mail.gmail.com
<https://groups.google.com/d/msgid/django-users/CAA6wQLJCkd0B-0ep8jrUFk1QUp%3D_jQ_AuundhzBMwOSYf7h4fg%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
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
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/AM5P193MB008390FC972C3F8D22B625968CF50%40AM5P193MB0083.
EURP193.PROD.OUTLOOK.COM
<https://groups.google.com/d/msgid/django-users/AM5P193MB008390FC972C3F8D22B625968CF50%40AM5P193MB0083.EURP193.PROD.OUTLOOK.COM?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
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/CAA6wQLLEEZtDmmoV9eg1AWL3Mfsu_-nF_DC%3D%2Bi%2B-isMWLp6zSw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
PASCUAL Eric
2018-02-14 11:29:39 UTC
Permalink
Hi,


The copy/paste of the project tree will work of course. Chances are that unwanted files can be brought too, but this should not be a problem in a first stage.


I have used rsync or tar archives to deploy Django projects in some cases, and it worked fine.


Eric

________________________________
From: django-***@googlegroups.com <django-***@googlegroups.com> on behalf of tango ward <***@gmail.com>
Sent: Wednesday, February 14, 2018 10:09:51 AM
To: django-***@googlegroups.com
Subject: Re: importError: Count Not import Django inside Virtualenv

that's odd. Whenever I test a pacakge, it's always installed first in virtualenv. Maybe when I updated my system? Btw, I have some projects which are not yet in github, can I just copy and paste them in a new folder with new virtualenv?

On Wed, Feb 14, 2018 at 4:44 PM, PASCUAL Eric <***@cstb.fr<mailto:***@cstb.fr>> wrote:

Hi,


Hard to say without knowing the exact context, but my gut feeling is that you've modified a system wide library at a moment (maybe inadvertently).


My own experience is that it's easy to mess with Python libraries when installing packages with sudo , which may happen form time to time when working with virtualenv (or pyenv) since not very long, and being caught up by old habits (they tend to survive longer that wanted 😊).


Even if far less harmful, then --user option is to avoid for projects related libs, for the same reasons.


Eric
________________________________
From: django-***@googlegroups.com<mailto:django-***@googlegroups.com> <django-***@googlegroups.com<mailto:django-***@googlegroups.com>> on behalf of tango ward <***@gmail.com<mailto:***@gmail.com>>
Sent: Wednesday, February 14, 2018 3:40:04 AM
To: django-***@googlegroups.com<mailto:django-***@googlegroups.com>
Subject: Re: importError: Count Not import Django inside Virtualenv

Hi Eric,


I tried what you suggested and it works! I was just wondering why my existing pet projects have the same problem?

On Wed, Feb 14, 2018 at 10:13 AM, tango ward <***@gmail.com<mailto:***@gmail.com>> wrote:
Hi,

The error message that I am getting is:

Traceback (most recent call last):
File "manage.py", line 8, in <module>
from django.core.management import execute_from_command_line
ModuleNotFoundError: No module named 'django'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "manage.py", line 14, in <module>
) from exc
ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?


@Jason,

It's weird because couple of days, I can still run these pet projects without any error. If I go to venv folder virtual/lib/python3.6/site-packages, I can see django there. It seems that even though virtualenv is activated, the packages I installed inside it are not recognized by the system.


On Wed, Feb 14, 2018 at 5:38 AM, PASCUAL Eric <***@cstb.fr<mailto:***@cstb.fr>> wrote:

Hi Jarvis,


Can you provide the error messages trace ? It can greatly help understanding what's happening.


If you haven't already done this, try to restart from a fresh new virtualenv inside which you'll install Django and the additional packages you've added (if any). Then restore a copy of your project in this context (if by chance you work with git, a simple git clone will do the trick) and test your app again.


Hoping you haven't already messed your system Python by installing stuff in sudo mode. The situation could be a little more complicated then.


Best.


Eric
________________________________
From: django-***@googlegroups.com<mailto:django-***@googlegroups.com> <django-***@googlegroups.com<mailto:django-***@googlegroups.com>> on behalf of tango ward <***@gmail.com<mailto:***@gmail.com>>
Sent: Tuesday, February 13, 2018 9:43:45 PM
To: django-***@googlegroups.com<mailto:django-***@googlegroups.com>
Subject: importError: Count Not import Django inside Virtualenv

Hi,

I want to seek some advice about the error. All of my pet projects in my desktop are getting the same error even though virtualenv is activated. I can confirm that when I started playing around with the projects, I have installed Django inside virtualenv without using "sudo". Now, I can't run python manage.py runserver and the packages that I am getting whenever I run pip freeze are different from before which doesn't include Django in the list.


Any advice pls?


Thanks,
Jarvis

--
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<mailto:django-users+***@googlegroups.com>.
To post to this group, send email to django-***@googlegroups.com<mailto: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/CAA6wQLKp3oz-6FfDzQ%3Dip4XRsuLPSeOCuwkbUuWbe1JNx2YhFA%40mail.gmail.com<https://groups.google.com/d/msgid/django-users/CAA6wQLKp3oz-6FfDzQ%3Dip4XRsuLPSeOCuwkbUuWbe1JNx2YhFA%40mail.gmail.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

--
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<mailto:django-users+***@googlegroups.com>.
To post to this group, send email to django-***@googlegroups.com<mailto: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/AM5P193MB0083C66FCD689270720750708CF60%40AM5P193MB0083.EURP193.PROD.OUTLOOK.COM<https://groups.google.com/d/msgid/django-users/AM5P193MB0083C66FCD689270720750708CF60%40AM5P193MB0083.EURP193.PROD.OUTLOOK.COM?utm_medium=email&utm_source=footer>.

For more options, visit https://groups.google.com/d/optout.



--
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<mailto:django-users+***@googlegroups.com>.
To post to this group, send email to django-***@googlegroups.com<mailto: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/CAA6wQLJCkd0B-0ep8jrUFk1QUp%3D_jQ_AuundhzBMwOSYf7h4fg%40mail.gmail.com<https://groups.google.com/d/msgid/django-users/CAA6wQLJCkd0B-0ep8jrUFk1QUp%3D_jQ_AuundhzBMwOSYf7h4fg%40mail.gmail.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

--
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<mailto:django-users+***@googlegroups.com>.
To post to this group, send email to django-***@googlegroups.com<mailto: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/AM5P193MB008390FC972C3F8D22B625968CF50%40AM5P193MB0083.EURP193.PROD.OUTLOOK.COM<https://groups.google.com/d/msgid/django-users/AM5P193MB008390FC972C3F8D22B625968CF50%40AM5P193MB0083.EURP193.PROD.OUTLOOK.COM?utm_medium=email&utm_source=footer>.

For more options, visit https://groups.google.com/d/optout.


--
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<mailto:django-users+***@googlegroups.com>.
To post to this group, send email to django-***@googlegroups.com<mailto: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/CAA6wQLLEEZtDmmoV9eg1AWL3Mfsu_-nF_DC%3D%2Bi%2B-isMWLp6zSw%40mail.gmail.com<https://groups.google.com/d/msgid/django-users/CAA6wQLLEEZtDmmoV9eg1AWL3Mfsu_-nF_DC%3D%2Bi%2B-isMWLp6zSw%40mail.gmail.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
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/AM5P193MB00837B56D569079507A3B8B08CF50%40AM5P193MB0083.EURP193.PROD.OUTLOOK.COM.
For more options, visit https://groups.google.com/d/optout.
Etienne Robillard
2018-02-14 10:07:07 UTC
Permalink
Hi Eric,
Post by PASCUAL Eric
Hi,
Hard to say without knowing the exact context, but my gut feeling is
that you've modified a system wide library at a moment (maybe
inadvertently).
My own experience is that it's easy to mess with Python libraries when
installing packages with sudo , which may happen form time to  time
when working with virtualenv (or pyenv) since not very long, and being
caught up by old habits (they tend to survive longer that wanted 😊).
I prefer messing with standard distutils/setuptools commands to avoid
situations like this... ;-)

Cheers,
Etienne
Post by PASCUAL Eric
------------------------------------------------------------------------
*Sent:* Wednesday, February 14, 2018 3:40:04 AM
*Subject:* Re: importError: Count Not import Django inside Virtualenv
Hi Eric,
I tried what you suggested and it works! I was just wondering why my
existing pet projects have the same problem?
Hi,
  File "manage.py", line 8, in <module>
    from django.core.management import execute_from_command_line
ModuleNotFoundError: No module named 'django'
  File "manage.py", line 14, in <module>
    ) from exc
ImportError: Couldn't import Django. Are you sure it's installed
and available on your PYTHONPATH environment variable? Did you
forget to activate a virtual environment?
@Jason,
It's weird because couple of days, I can still run these pet
projects without any error. If I go to venv folder
virtual/lib/python3.6/site-packages, I can see django there. It
seems that even though virtualenv is activated, the packages I
installed inside it are not recognized by the system.
On Wed, Feb 14, 2018 at 5:38 AM, PASCUAL Eric
Hi Jarvis,
Can you provide the error messages trace ? It can greatly help
understanding what's happening.
If you haven't already done this, try to restart from a fresh
new virtualenv inside which you'll install Django and the
additional packages you've added (if any). Then restore a copy
of your project in this context (if by chance you work with
git, a simple git clone will do the trick) and test your app
again.
Hoping you haven't already messed your system Python by
installing stuff in sudo mode. The situation could be a little
more complicated then.
Best.
Eric
------------------------------------------------------------------------
*Sent:* Tuesday, February 13, 2018 9:43:45 PM
*Subject:* importError: Count Not import Django inside Virtualenv
Hi,
I want to seek some advice about the error. All of my pet
projects in my desktop are getting the same error even though
virtualenv is activated. I can confirm that when I started
playing around with the projects, I have installed Django
inside virtualenv without using "sudo". Now, I can't run
python manage.py runserver and the packages that I am getting
whenever I run pip freeze are different from before which
doesn't include Django in the list.
Any advice pls?
Thanks,
Jarvis
--
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
To post to this group, send email to
Visit this group at
https://groups.google.com/group/django-users
<https://groups.google.com/group/django-users>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/CAA6wQLKp3oz-6FfDzQ%3Dip4XRsuLPSeOCuwkbUuWbe1JNx2YhFA%40mail.gmail.com
<https://groups.google.com/d/msgid/django-users/CAA6wQLKp3oz-6FfDzQ%3Dip4XRsuLPSeOCuwkbUuWbe1JNx2YhFA%40mail.gmail.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout
<https://groups.google.com/d/optout>.
--
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
To post to this group, send email to
Visit this group at
https://groups.google.com/group/django-users
<https://groups.google.com/group/django-users>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/AM5P193MB0083C66FCD689270720750708CF60%40AM5P193MB0083.EURP193.PROD.OUTLOOK.COM
<https://groups.google.com/d/msgid/django-users/AM5P193MB0083C66FCD689270720750708CF60%40AM5P193MB0083.EURP193.PROD.OUTLOOK.COM?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout
<https://groups.google.com/d/optout>.
--
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
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/CAA6wQLJCkd0B-0ep8jrUFk1QUp%3D_jQ_AuundhzBMwOSYf7h4fg%40mail.gmail.com
<https://groups.google.com/d/msgid/django-users/CAA6wQLJCkd0B-0ep8jrUFk1QUp%3D_jQ_AuundhzBMwOSYf7h4fg%40mail.gmail.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
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
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/AM5P193MB008390FC972C3F8D22B625968CF50%40AM5P193MB0083.EURP193.PROD.OUTLOOK.COM
<https://groups.google.com/d/msgid/django-users/AM5P193MB008390FC972C3F8D22B625968CF50%40AM5P193MB0083.EURP193.PROD.OUTLOOK.COM?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
Etienne Robillard
***@yandex.com
https://www.isotopesoftware.ca/
--
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/ed7db509-0af4-6092-a8f9-c604287b15f6%40yandex.com.
For more options, visit https://groups.google.com/d/optout.
PASCUAL Eric
2018-02-14 11:31:50 UTC
Permalink
Hi Etienne,

I prefer messing with standard distutils/setuptools commands to avoid situations like this... ;-)

Messing and restoring system libs is a matter of personnal taste 😃


Eric

________________________________
From: Etienne Robillard <***@yandex.com>
Sent: Wednesday, February 14, 2018 11:07:07 AM
To: PASCUAL Eric
Cc: django-***@googlegroups.com
Subject: Re: importError: Count Not import Django inside Virtualenv


Hi Eric,

Le 2018-02-14 à 03:44, PASCUAL Eric a écrit :

Hi,


Hard to say without knowing the exact context, but my gut feeling is that you've modified a system wide library at a moment (maybe inadvertently).


My own experience is that it's easy to mess with Python libraries when installing packages with sudo , which may happen form time to time when working with virtualenv (or pyenv) since not very long, and being caught up by old habits (they tend to survive longer that wanted 😊).


I prefer messing with standard distutils/setuptools commands to avoid situations like this... ;-)

Cheers,
Etienne


________________________________
From: django-***@googlegroups.com<mailto:django-***@googlegroups.com> <django-***@googlegroups.com><mailto:django-***@googlegroups.com> on behalf of tango ward <***@gmail.com><mailto:***@gmail.com>
Sent: Wednesday, February 14, 2018 3:40:04 AM
To: django-***@googlegroups.com<mailto:django-***@googlegroups.com>
Subject: Re: importError: Count Not import Django inside Virtualenv

Hi Eric,


I tried what you suggested and it works! I was just wondering why my existing pet projects have the same problem?

On Wed, Feb 14, 2018 at 10:13 AM, tango ward <***@gmail.com<mailto:***@gmail.com>> wrote:
Hi,

The error message that I am getting is:

Traceback (most recent call last):
File "manage.py", line 8, in <module>
from django.core.management import execute_from_command_line
ModuleNotFoundError: No module named 'django'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "manage.py", line 14, in <module>
) from exc
ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?


@Jason,

It's weird because couple of days, I can still run these pet projects without any error. If I go to venv folder virtual/lib/python3.6/site-packages, I can see django there. It seems that even though virtualenv is activated, the packages I installed inside it are not recognized by the system.


On Wed, Feb 14, 2018 at 5:38 AM, PASCUAL Eric <***@cstb.fr<mailto:***@cstb.fr>> wrote:

Hi Jarvis,


Can you provide the error messages trace ? It can greatly help understanding what's happening.


If you haven't already done this, try to restart from a fresh new virtualenv inside which you'll install Django and the additional packages you've added (if any). Then restore a copy of your project in this context (if by chance you work with git, a simple git clone will do the trick) and test your app again.


Hoping you haven't already messed your system Python by installing stuff in sudo mode. The situation could be a little more complicated then.


Best.


Eric
________________________________
From: django-***@googlegroups.com<mailto:django-***@googlegroups.com> <django-***@googlegroups.com<mailto:django-***@googlegroups.com>> on behalf of tango ward <***@gmail.com<mailto:***@gmail.com>>
Sent: Tuesday, February 13, 2018 9:43:45 PM
To: django-***@googlegroups.com<mailto:django-***@googlegroups.com>
Subject: importError: Count Not import Django inside Virtualenv

Hi,

I want to seek some advice about the error. All of my pet projects in my desktop are getting the same error even though virtualenv is activated. I can confirm that when I started playing around with the projects, I have installed Django inside virtualenv without using "sudo". Now, I can't run python manage.py runserver and the packages that I am getting whenever I run pip freeze are different from before which doesn't include Django in the list.


Any advice pls?


Thanks,
Jarvis
--
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<mailto:django-users+***@googlegroups.com>.
To post to this group, send email to django-***@googlegroups.com<mailto: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/CAA6wQLKp3oz-6FfDzQ%3Dip4XRsuLPSeOCuwkbUuWbe1JNx2YhFA%40mail.gmail.com<https://groups.google.com/d/msgid/django-users/CAA6wQLKp3oz-6FfDzQ%3Dip4XRsuLPSeOCuwkbUuWbe1JNx2YhFA%40mail.gmail.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
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<mailto:django-users+***@googlegroups.com>.
To post to this group, send email to django-***@googlegroups.com<mailto: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/AM5P193MB0083C66FCD689270720750708CF60%40AM5P193MB0083.EURP193.PROD.OUTLOOK.COM<https://groups.google.com/d/msgid/django-users/AM5P193MB0083C66FCD689270720750708CF60%40AM5P193MB0083.EURP193.PROD.OUTLOOK.COM?utm_medium=email&utm_source=footer>.

For more options, visit https://groups.google.com/d/optout.


--
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<mailto:django-users+***@googlegroups.com>.
To post to this group, send email to django-***@googlegroups.com<mailto: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/CAA6wQLJCkd0B-0ep8jrUFk1QUp%3D_jQ_AuundhzBMwOSYf7h4fg%40mail.gmail.com<https://groups.google.com/d/msgid/django-users/CAA6wQLJCkd0B-0ep8jrUFk1QUp%3D_jQ_AuundhzBMwOSYf7h4fg%40mail.gmail.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
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<mailto:django-users+***@googlegroups.com>.
To post to this group, send email to django-***@googlegroups.com<mailto: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/AM5P193MB008390FC972C3F8D22B625968CF50%40AM5P193MB0083.EURP193.PROD.OUTLOOK.COM<https://groups.google.com/d/msgid/django-users/AM5P193MB008390FC972C3F8D22B625968CF50%40AM5P193MB0083.EURP193.PROD.OUTLOOK.COM?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.


--
Etienne Robillard
***@yandex.com<mailto:***@yandex.com>
https://www.isotopesoftware.ca/
--
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/AM5P193MB00837142142E76E15341B0718CF50%40AM5P193MB0083.EURP193.PROD.OUTLOOK.COM.
For more options, visit https://groups.google.com/d/optout.
Loading...