-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Installing a package using uv pip install . works correctly and reports successful installation, but the installed CLI script ([project.scripts] entry point) fails at runtime with ModuleNotFoundError: No module named 'codeanalyzer'.
To Reproduce
Steps to reproduce the behavior:
- Use a
pyproject.tomlwith[project.scripts] codeanalyzer = "codeanalyzer.__main__:app"and a validcodeanalyzer/package in a flat layout (nosrc/). - Install using
uv pip install . - Run
codeanalyzer --help - Observe the failure:
Traceback (most recent call last): File "/home/<user>/.pyenv/versions/3.12.11/bin/codeanalyzer", line 5, in <module> from codeanalyzer.__main__ import app ModuleNotFoundError: No module named 'codeanalyzer'
Expected behavior
codeanalyzer CLI script should be installed into the same environment where the codeanalyzer package is installed, and should be able to resolve its import.
Logs
$ uv pip install .
...
Installed 1 package in 0.7ms
+ codeanalyzer-python==0.1.1
$ which codeanalyzer
/home/<user>/.pyenv/versions/3.12.11/bin/codeanalyzer
$ cat $(which codeanalyzer)
#!/usr/bin/env bash
exec "/home/<user>/.pyenv/libexec/pyenv" exec "$program" "$@"Additional context
uvis being used in a system wherepyenvis managing the global Python version.uvinstalls into an isolated environment, but CLI scripts are being executed via the pyenv-managed global Python — leading to broken dispatch and missing modules.- This results in a mismatch between the environment where the package is installed and the environment from which the CLI script is run.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working