Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install: No module named weakref #865

Open
robline opened this issue Nov 19, 2021 · 0 comments
Open

Cannot install: No module named weakref #865

robline opened this issue Nov 19, 2021 · 0 comments

Comments

@robline
Copy link

robline commented Nov 19, 2021

I'm looking forward to trying django-SHOP. in following the tutorial here: https://django-shop.readthedocs.io/en/latest/tutorial/intro.html

I cannot get the following step to run when installing django-SHOP on Ubuntu 18.04:
pipenv install --sequential
or another version suggested in another ticket:
pipenv install --sequential --skip-lock

The traceback I get is:

Traceback (most recent call last):
  File "/home/rob/.local/bin/pipenv", line 7, in <module>
    from pipenv import cli
  File "/home/rob/.local/lib/python2.7/site-packages/pipenv/__init__.py", line 22, in <module>
    from pipenv.vendor.vistir.compat import ResourceWarning, fs_str
  File "/home/rob/.local/lib/python2.7/site-packages/pipenv/vendor/vistir/__init__.py", line 4, in <module>
    from .compat import (
  File "/home/rob/.local/lib/python2.7/site-packages/pipenv/vendor/vistir/compat.py", line 13, in <module>
    from .backports.tempfile import NamedTemporaryFile as _NamedTemporaryFile
  File "/home/rob/.local/lib/python2.7/site-packages/pipenv/vendor/vistir/backports/__init__.py", line 6, in <module>
    from .tempfile import NamedTemporaryFile
  File "/home/rob/.local/lib/python2.7/site-packages/pipenv/vendor/vistir/backports/tempfile.py", line 15, in <module>
    from backports.weakref import finalize
ImportError: No module named weakref

note that is trying to use python 2.7. So I did the following:
pipenv install --python 3.9 --sequential

and

pipenv install --python=/usr/local/bin/Python3.9.9 --sequential

and

pipenv install --python '/usr/local/bin/Python3.9.9' --sequential

It is still trying to use python 2.7 and gives the same error.

I have setup virtual environments with Python 3.6, which failed because some dependencies needed >3.7. I tried python 3.8, 3.10.0, and 3.9.9. I tried pip install and pip3 install. Tried installing Python to /usr/bin and usr/local/bin. I have updated pip to the latest version, and manually installed backports.weakref using pip and pip3.

I have tried with and without optimizations:
sudo ./configure --enable-optimizations

when I open a python 3.9.9 prompt and import weakrefs, it is there. When I pip install, it say requirement is already satisfied. When I run pipenv install --sequential I get ImportError: No module named weakref and referencing 2.7 instead of 3.9.9. I am out of ideas to try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant