[BUG] No module named 'pkg_resources.extern'
envgap__pypa__setuptools-4374
Original GitHub issue ↗Opened 2024-05-21
01 / FAILURE SIGNATURE
As reported upstream
ModuleNotFoundError: No module named 'pkg_resources.extern'
Not a benchmark task.
- No curated issue-specific recipe or verified environment fix is available.
02 / ENVIRONMENT RECIPE
- Base commit
Not freshly verified- Manifest
requirements.txt- Reproduce
Awaiting issue-specific recipe- Run under trace
Awaiting a meaningful runtime command
03 / ORIGINAL ISSUE TEXT
pypa/setuptools #4374 · read the original issue
### setuptools version
setuptools==70.0.0
### Python version
3.8.10
### OS
Windows 11
### Additional environment information
_No response_
### Description
I use PyInstaller and PyArmor to obfuscate my code and create an Executable out of it.
On a pipeline of mine, an error started to throw today:
```
Traceback (most recent call last):
File "Lib\site-packages\PyInstaller\hooks\rthooks\pyi_rth_pkgres.py", line 16, in <module>
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "pkg_resources\__init__.py", line 77, in <module>
ModuleNotFoundError: No module named 'pkg_resources.extern'
```
Inside this Pipeline I run `python -m pip install -U setuptools`. I.e., it uses the latest version of it.
I tested it locally and it happens with version 70.0.0 but not with version 69.5.1
### Expected behavior
Obfuscated Executable from PyArmor and PyInstaller is created.
### How to Reproduce
1. Create a virtual environment
2. Install pyinstaller[encryption]==4.* and pyarmor==7.*
3. `pip install tendo==0.2.*` (just for the matter of having some import on the main.py file) (for some reason, it works with tendo>=0.3.0)
4. Create a test.py
```python
import tendo.singleton
def main():
print("Hello World!")
if __name__ == "__main__":
me = tendo.singleton.SingleInstance()
main()
```
5. Run `pyarmor pack .\test.py -x "--exclude .venv"`
6. Run the test.exe on `dist/test/`
### Output
```console
python -m pip install -U setuptools
pip install -U pyarmor==7.* pyinstaller[encryption]==4.*
pyarmor pack main.py
```
```console
Traceback (most recent call last):
File "Lib\site-packages\PyInstaller\hooks\rthooks\pyi_rth_pkgres.py", line 158, in <module>
File "Lib\site-packages\PyInstaller\hooks\rthooks\pyi_rth_pkgres.py", line 36, in _pyi_rthook
File "PyInstaller\loader\pyimod02_importers.py", line 419, in exec_module
File "pkg_resources\__init__.py", line 77, in <module>
ModuleNotFoundError: No module named 'pkg_resources.extern'
```
04 / LABELS
Labels from the report text only; not yet run
No supported category has been assigned.
Label rules and the text that matched
[]
Issue-specific recipe and runtime smoke command require review against the complete issue and repository.
Legacy already_works is install-only; proposed control still requires runtime verification.