Django, python3, on install I get: “Parent module 'setuptools' not loaded”

前端 未结 5 1061
花落未央
花落未央 2021-01-07 20:49

I see lots of errors and suggestions about Parent module \'\' not loaded, ...

I don\'t see any about specifically "out of the box" django 3.5.<

相关标签:
5条回答
  • 2021-01-07 21:17

    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
    
    0 讨论(0)
  • 2021-01-07 21:19

    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!

    0 讨论(0)
  • 2021-01-07 21:25

    There is a temporary workaround described in the setuputils changelog:

    export SETUPTOOLS_USE_DISTUTILS=stdlib
    
    0 讨论(0)
  • 2021-01-07 21:27

    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!

    0 讨论(0)
  • 2021-01-07 21:44

    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 讨论(0)
提交回复
热议问题