-
-
Notifications
You must be signed in to change notification settings - Fork 403
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
Cannot import "apt" as a site package #1787
Comments
Workaround 1:
Workaround 2: Instead of
This is a very special case, so I think my workaround 2 is acceptable. If there isn't any feedback, I'll submit a documentation update. |
|
@sanmai-NL Thanks for the heads-up. I don't see this explicitly mentioned in the release notes, I assume it's a side-effect of a fix? For me this is one highly specific use-case, I can't speak to how useful the feature is in general.
|
@lofidevops I think I was mistaken. Will continue debugging tomorrow. |
#2071 |
@lofidevops The first work-around doesn't work for me during installation, though. During installation, dependencies that are already installed in my system site-packages like matplotlib and pandas are resolved again when generating a lockfile:
|
@lofidevops I can say that the work-around don't work for me with PDM 2.7.4 on Linux. Somehow it keeps re-resolving packages that are already installed in the system site-packages with
|
See also the same requirement for Poetry: python-poetry/poetry#1393 |
Related issues? #985 #634
Background
For various reasons, installing
apt
into a virtualenv is tricky. With other package managers I've found it easier to just usesite-packages
(sometimes called "system packages"). But I'm struggling to achieve the same result with pdm.A simple test is that a script with "import apt" should run without error.
Steps to reproduce
Create a pdm project with the following files. Then try
pdm install --dev --no-isolation
andpdm run -v --site-packages spsample
pyproject.toml
src/spsample/cli.py
Actual behavior
Expected behavior
Should print "Hello world!" after importing the system package called apt.
Environment Information
pdm list -v --graph
The text was updated successfully, but these errors were encountered: