Skip to content

Fix setup.py to not use pip internal APIs#64

Open
JustAnalyze wants to merge 2 commits intomattloper:masterfrom
JustAnalyze:master
Open

Fix setup.py to not use pip internal APIs#64
JustAnalyze wants to merge 2 commits intomattloper:masterfrom
JustAnalyze:master

Conversation

@JustAnalyze
Copy link

Problem

The current setup.py imports from pip.req and pip._internal.req, which are internal pip APIs that should not be used. This causes ModuleNotFoundError: No module named 'pip' when building in PEP 517 isolated environments (used by modern build tools like uv, pip>=20, build, etc.).

Solution

  • Read requirements.txt directly using standard Python file I/O
  • Switch from distutils to setuptools (distutils is deprecated in Python 3.10+)
  • Remove all pip internal API usage
  • Add python_requires field for better package metadata

Testing

Tested with:

  • pip install .
  • uv pip install .
  • python -m build

All installation methods work correctly after this fix.

Related Issues

This fixes issues when using modern Python packaging tools that use PEP 517 isolated builds.

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

Successfully merging this pull request may close these issues.

1 participant