[Fixed]-Django, python3, on install I get: "Parent module 'setuptools' not loaded"

18👍

Something happened in version 50 of setuptools.

We could "solve" this problem by downgrading setuptools to 49.3.0 (and maybe pip to 20.2.1)

pip install setuptools==49.3.0 and pip install pip==20.2.1

Be aware though that this should only be a temporary solution!

10👍

There is a temporary workaround described in the setuputils changelog:

export SETUPTOOLS_USE_DISTUTILS=stdlib

1👍

Probably you are using setuptools 50.0.0. There are some issues with it. https://github.com/pypa/setuptools/issues/2356
Try to downgrade it.

pip install setuptools==49.6.0

0👍

Try using the approved way in python3, where venv ia part of the stdlib:

/usr/bin/python3 -m venv /home/isaac/.virtualenvs/foobar
/home/isaac/.virtualenvs/foobar/bin/pip install django
👤hd1

0👍

I had a similar issue. I think it is the Django version you installed with pip. For me combination of Python3.5 and Django 1.9 did not give me that error.

$ rm -r /home/isaac/.virtualenvs/foobar #Remove the content
$ /usr/bin/python3 -m venv /home/isaac/.virtualenvs/foobar #Recreate your environment
$ cd /home/isaac/.virtualenvs/foobar
$ source bin/activate #Activate the environment
$ pip -V #(my version is 8.1.1 -> 20.x ==current version)
$ pip install django==1.9 #That version did not give an teh error
$ django-admin startproject yourprojectname #(worked nicely)

Alternative: Upgrade your Python version >= 3.6 on your Ubuntu machine and your’re ready to go with the latest Django version Here!

Leave a comment