uv
uv copied to clipboard
Using uv with internal libraries fails with `No module named 'pip'`
We are trying to implement UV in our pip line bot we are getting this error for one of out libraries:
error: Failed to build editables
Caused by: Failed to build editable: file:///Users/wsantos/projetos/xxxxxx/xxxxxxx
Caused by: Build backend failed to build wheel through `build_editable()`:
--- stdout:
--- stderr:
Traceback (most recent call last):
File "<string>", line 12, in <module>
ModuleNotFoundError: No module named 'pip'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 6, in <module>
File "/private/var/folders/x_/cw97nxxx13q_f1fscwrs7g9r0000gn/T/.tmphBj6Wg/.venv/lib/python3.9/site-packages/setuptools/build_meta.py", line 436, in build_editable
return self._build_with_temp_dir(
File "/private/var/folders/x_/cw97nxxx13q_f1fscwrs7g9r0000gn/T/.tmphBj6Wg/.venv/lib/python3.9/site-packages/setuptools/build_meta.py", line 389, in _build_with_temp_dir
self.run_setup()
File "/private/var/folders/x_/cw97nxxx13q_f1fscwrs7g9r0000gn/T/.tmphBj6Wg/.venv/lib/python3.9/site-packages/setuptools/build_meta.py", line 480, in run_setup
super().run_setup(setup_script=setup_script)
File "/private/var/folders/x_/cw97nxxx13q_f1fscwrs7g9r0000gn/T/.tmphBj6Wg/.venv/lib/python3.9/site-packages/setuptools/build_meta.py", line 311, in run_setup
exec(code, locals())
File "<string>", line 14, in <module>
ModuleNotFoundError: No module named 'pip'
How can I fix it, I see some others issues about it but none told how we can fix it.
Thanks! Is this a library you all control? It looks like it depends on "pip". Does it declare "pip" as a build requirement, in the pyproject.toml?
Thanks! Is this a library you all control? It looks like it depends on
"pip". Does it declare"pip" as a build requirement, in thepyproject.toml?
Yeap we control it, we don't have a pyproject.toml how should I do it, we do have setup.py
This is a surprising workaround:
➜ uv pip install pip
Resolved 1 package in 176ms
Installed 1 package in 16ms
+ pip==24.0
Add a pyproject.toml with something like:
[build-system]
requires = ["setuptools", "wheel", "pip"]
build-backend = "setuptools.build_meta"
(and keep your existing setup.py as-is)
Closing since @hauntsaninja suggestion is what you're looking for!