Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusing message on first run with python.use_venv=false #1508

Closed
blueyed opened this issue Nov 10, 2022 · 1 comment · Fixed by j178/pdm#1
Closed

Confusing message on first run with python.use_venv=false #1508

blueyed opened this issue Nov 10, 2022 · 1 comment · Fixed by j178/pdm#1
Labels
🐛 bug Something isn't working

Comments

@blueyed
Copy link
Contributor

blueyed commented Nov 10, 2022

Without python.path set in the config, but python.use_venv = false it will display "pypackages is detected, using the PEP 582 mode" via

pdm/src/pdm/project/core.py

Lines 212 to 216 in 8d51c7b

for py_version in self.find_interpreters():
if match_version(py_version):
note("[success]__pypackages__[/] is detected, using the PEP 582 mode")
self.python = py_version
return py_version
.

This confused me to look for an existing __pypackages__ dir.

This happens within a Docker container, where Python is installed into /venv, but apparently not detected as a virtualenv.

The workaround is to configure it explicitly in the Dockerfile also: RUN printf '[python]\nuse_venv = false\npath = "/venv/bin/python"' > /app/.pdm.toml.

@blueyed blueyed added the 🐛 bug Something isn't working label Nov 10, 2022
@pawamoy
Copy link
Contributor

pawamoy commented Nov 10, 2022

Witnessed this confusing message as well: no __pypackages__ folder but python.use_venv: false and message saying __pypackages__ detected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants