pipenv-setup icon indicating copy to clipboard operation
pipenv-setup copied to clipboard

fix for assert '_distutils' in core.__file__, core.__file__ failing

Open HitLuca opened this issue 3 years ago • 2 comments

looks like something broke in the setuptools project in the last couple of days, and consequently, pipenv-setup errors out when called. This should only happen with the latest pip version but I am not 100% sure.

Anyway, a quick fix for this is to export an env var before calling the command, like below

export SETUPTOOLS_USE_DISTUTILS=stdlib
pipenv-setup check

cheers!

HitLuca avatar Jan 04 '22 16:01 HitLuca

I was able to resolve this issue by folllowing the above. Thanks @HitLuca

In my case, running pipenv-setup check --strict was giving the following warning:

UserWarning: Distutils was imported before Setuptools, but importing Setuptools also replaces the `distutils` module in `sys.modules`. 
This may lead to undesirable behaviors or errors. 
To avoid these issues, avoid using distutils directly, ensure that setuptools is installed in the traditional way (e.g. not an editable install), and/or make sure that setuptools is always imported before distutils.

which was followed by an AssertionError in distutils/core.py

Python: 3.8 Setuptools version: 60.5.0

geokaragiannis avatar Jan 25 '22 12:01 geokaragiannis

created a github-action with the fix https://github.com/marketplace/actions/run-pipenv-setup

wangsha avatar Apr 01 '22 06:04 wangsha