module not found

32 views
Skip to first unread message

Théodore KOSSI

unread,
Apr 26, 2021, 7:40:30 AM4/26/21
to django...@googlegroups.com
can you help me for this problem?
django.png

Benjamin Schollnick

unread,
Apr 26, 2021, 8:48:17 AM4/26/21
to django...@googlegroups.com
Okay, it appears you are on a Macintosh….

Which is not the problem, but I ran into the same issue, and it’s most likely that you installed a different version of Python than what came with the OS?

try:

python3 -m pip  list | grep -i django
python2 -m pip  list | grep -i django

I would bet even money, that the python2 command comes back with django being installed there…

That’s because the python2 install is earlier in the path than python3

How did I work around it, well.  That’s going to be a bit different for you since your using a different terminal package.
(In Apple’s Terminal -> Preferences -> Profiles -> Shell -> Startup,   check “Run Command”, and type “source ~/<profile filename>” assuming it’s in the user home directory.  
That will run the profile file on every opening of a terminal window, and thus load your presets.  I suspect that Parrot Terminal will have something similar)

(Yes, I know, why not use .profile or .bash_rc, etc, etc.  Because I don’t want the file to be hidden.  It can be updated by any text editor, even dropbox’s editor in the cloud, and it’s synced without having to worry about it.)

    export PATH="/opt/homebrew/opt/python@3.9/libexec/bin:$PATH"
    export PATH="/opt/homebrew/lib/python3.9/site-packages:$PATH"

Which points to the python 3.9.2 install that I have from homebrew.  

I previously used aliases with mixed luck at times.. 
(eg 
alias pip='python3.9 -m pip $*'
alias pip='python3.9 -m pip $*’
)
But that broke when I went to an M1 Mac, because it wasn’t possible to reliably get it to distinguish between an Rosetta2 session and an M1 session.  So
I stopped using the aliases.  I did eventually resolve the M1 / Rosetta2 session smartly, but that’s a chunk of the profile file, and probably better left for another time.

Hope that helps…  

On Apr 26, 2021, at 4:35 AM, Théodore KOSSI <kossit...@gmail.com> wrote:

can you help me for this problem?

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAKiMjQG3F-qktrhRd3mF-ucK2fn8ph55r_sKD8ue5HakuWc%3DRQ%40mail.gmail.com.
<django.png>

Roberth Solis Martínez

unread,
Apr 26, 2021, 4:39:26 PM4/26/21
to Django users
I think is a problem with your virtual envinmont, just you need add the PYTHONPATH variable, like:

export PYTHONPATH="/the/path/of/python3"

I think maybe you have a global lib in yout machine maybe, try verify with "pip freeze --local" (without "base" env activated)

try to clean your global requirements with:

pip freeze | xargs pip uninstall -y

And then create a new env and try again maybe

Théodore KOSSI

unread,
Apr 27, 2021, 9:04:28 AM4/27/21
to django...@googlegroups.com
thanks you very much. I will try this issue and will return later. 

Shailesh Yadav

unread,
Apr 27, 2021, 9:26:41 AM4/27/21
to django...@googlegroups.com
Hi, This issue is because of virtual env please check env and also Django installed in it or not. (You can also check the python interpreter and see the path).

for more info please refer to this document.
https://simpleisbetterthancomplex.com/series/2017/09/04/a-complete-beginners-guide-to-django-part-1.html

Thanks & Regards
Shailesh Yadav

   Linkedin 




Sebastian Jung

unread,
Apr 27, 2021, 6:10:49 PM4/27/21
to django...@googlegroups.com
Hello,

You Install Django package with pip Install but you need with python3 pip3 instead of pip.

Regards

Théodore KOSSI <kossit...@gmail.com> schrieb am Mo., 26. Apr. 2021, 13:40:
can you help me for this problem?

--

Rabil Abdullahi

unread,
Apr 28, 2021, 3:12:41 AM4/28/21
to django...@googlegroups.com
Go to settings from your pc and add python to your variable path.

sebasti...@gmail.com

unread,
Apr 28, 2021, 4:16:35 AM4/28/21
to Django users
Install pip3:

sudo apt install python3-pip

then install django:

pip3 install django

Satyajit Barik

unread,
Apr 28, 2021, 9:12:59 AM4/28/21
to django...@googlegroups.com
Install django in a virtualenv. Then it should probably work. 

Reply all
Reply to author
Forward
0 new messages