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

50.0.0 Broken? #2356

Closed
s0undt3ch opened this issue Aug 31, 2020 · 6 comments
Closed

50.0.0 Broken? #2356

s0undt3ch opened this issue Aug 31, 2020 · 6 comments

Comments

@s0undt3ch
Copy link

This is taken from our CI builds.

21:30:11         nox > Creating virtualenv using python3 in .nox/runtests-parametrized-3-coverage-true-crypto-none-transport-tcp
21:30:16         nox > Command python -cimport sys; from distutils.sysconfig import get_python_lib; sys.stdout.write(get_python_lib()) failed with exit code 1:
21:30:16         Traceback (most recent call last):
21:30:16           File "<string>", line 1, in <module>
21:30:16           File "<frozen importlib._bootstrap>", line 969, in _find_and_load
21:30:16           File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
21:30:16           File "<frozen importlib._bootstrap>", line 666, in _load_unlocked
21:30:16           File "<frozen importlib._bootstrap>", line 577, in module_from_spec
21:30:16           File "/tmp/kitchen/testing/.nox/runtests-parametrized-3-coverage-true-crypto-none-transport-tcp/lib/python3.5/site-packages/_distutils_hack/__init__.py", line 82, in create_module
21:30:16             return importlib.import_module('._distutils', 'setuptools')
21:30:16           File "/tmp/kitchen/testing/.nox/runtests-parametrized-3-coverage-true-crypto-none-transport-tcp/lib/python3.5/importlib/__init__.py", line 126, in import_module
21:30:16             return _bootstrap._gcd_import(name[level:], package, level)
21:30:16           File "<frozen importlib._bootstrap>", line 981, in _gcd_import
21:30:16           File "<frozen importlib._bootstrap>", line 931, in _sanity_check
21:30:16         SystemError: Parent module 'setuptools' not loaded, cannot perform relative import
@exhuma
Copy link

exhuma commented Aug 31, 2020

I can confirm this. We have the same issue.

A simple way to reproduce:

python3 -m venv env
./env/bin/pip install "setuptools == 50.0.0"
./env/bin/python -c "import distutils"

I am in the process of blacklisting 50.0.0 in our dependencies using setuptools != 50.0.0 in our dependencies.

exhuma added a commit to exhuma/config_resolver that referenced this issue Aug 31, 2020
blueyed added a commit to blueyed/pytest that referenced this issue Aug 31, 2020
Remove upgrading of setuptools (used to work around fixed issue with
zipp?!), since it fails with 50.0.0:

    $ python -m tox --notest -v --durations
    ...
    using tox-3.14.1.dev99+g842eeac from /home/travis/virtualenv/python3.5.1/lib/python3.5/site-packages/tox/__init__.py (pid 4320)
    ...
    ================================== log start ===================================
    Traceback (most recent call last):
      File "/opt/python/3.5.1/lib/python3.5/runpy.py", line 170, in _run_module_as_main
        "__main__", mod_spec)
      File "/opt/python/3.5.1/lib/python3.5/runpy.py", line 85, in _run_code
        exec(code, run_globals)
      File "/home/travis/virtualenv/python3.5.1/lib/python3.5/site-packages/virtualenv.py", line 24, in <module>
        import distutils.spawn
      File "<frozen importlib._bootstrap>", line 969, in _find_and_load
      File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 666, in _load_unlocked
      File "<frozen importlib._bootstrap>", line 577, in module_from_spec
      File "/home/travis/virtualenv/python3.5.1/lib/python3.5/site-packages/_distutils_hack/__init__.py", line 82, in create_module
        return importlib.import_module('._distutils', 'setuptools')
      File "/home/travis/virtualenv/python3.5.1/lib/python3.5/importlib/__init__.py", line 126, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
      File "<frozen importlib._bootstrap>", line 981, in _gcd_import
      File "<frozen importlib._bootstrap>", line 931, in _sanity_check
    SystemError: Parent module 'setuptools' not loaded, cannot perform relative import

Ref: pypa/setuptools#2356
blueyed added a commit to blueyed/pytest that referenced this issue Aug 31, 2020
Remove upgrading of setuptools (used to work around fixed issue with
zipp?!), since it fails with 50.0.0.

Ref: pypa/setuptools#2356
vytas7 added a commit to vytas7/falcon that referenced this issue Aug 31, 2020
vytas7 added a commit to falconry/falcon that referenced this issue Aug 31, 2020
@LinqLover
Copy link

Similar issue here, broken requirements.txt:

setuptools
git+https://github.com/taspinar/twitterscraper.git#egg=twitterscraper

Disallowing v50.0.0 fixes the problem for me:

-setuptools
+setuptools!=50.0.0
 git+https://github.com/taspinar/twitterscraper.git#egg=twitterscraper

@jaraco
Copy link
Member

jaraco commented Aug 31, 2020

I'm unable to replicate the issue on Python 3.8 and Python 3.6 on macOS. I don't yet know what factors cause the failure.

@jaraco
Copy link
Member

jaraco commented Aug 31, 2020

(also Python 3.5)

@MartinFalatic
Copy link

MartinFalatic commented Sep 1, 2020

Same issue is seen with django-autocomplete-light in the context of ModuleNotFoundError: No module named 'dal' in an Ubuntu 18.04 context using Python 3.6

Edit: The ENV variable method as mentioned in #2350 shows promise in Docker:

ENV SETUPTOOLS_USE_DISTUTILS stdlib

However, I'm still determining what effect this has (is it using ancient setuptools 39.x that comes with Ubuntu 18.04?)

More discussion here as well: pypa/pip#8761

@jaraco
Copy link
Member

jaraco commented Sep 1, 2020

I suspect this issue is the same as #2352. The error message is the same, so assuming so unless I hear otherwise.

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

No branches or pull requests

5 participants