-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
The virtual environment does not have the system packages as expected #10500
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
Comments
@jnikula is there a way to install I don't think |
@humitos Well, there's an unofficial I actually started to experiment with this because the current unofficial
Just curious, what's the incompatibility there? Obviously it depends on what's available in the os, which may be surprising in some cases. |
I'd say this is a good approach to try here, actually 👍🏼
The build system does not uses the Python version from the system itself, but it uses one compiled with |
Apparently python.system_packages=true is problematic in the RTD environment [1]. Install libclang-14-dev from apt and clang from pip, using specific versions for both. Attempt to install clang using build.jobs.post_install instead of a requirements.txt to avoid defining the version in two different files. Fingers crossed. [1] readthedocs/readthedocs.org#10500
Thanks, this worked.
Okay, thanks for the explanation! I noticed that https://blog.readthedocs.com/migrate-configuration-v2/ actually says "Use system packages is deprecated in favor of declaring all your dependencies via a requirements file using python.requirements.", however the actual configuration file specification does not mention it's deprecated: https://docs.readthedocs.io/en/stable/config-file/v2.html#python-system-packages Maybe consider this report to be about amending the config file spec, then? |
I noticed this today. We should update the documentation to mention this is deprecated as well 👍🏼 . Thanks. |
This option doesn't work on builds using `build.os` because the Python binary used it's not the one from the system, but another one compiled via `asdf`. This means that creating a virtualenv with access to the "system packages" has no effect at all. As a first step, I'm removing this option from the documentation to avoid confusions. Next, we should probably our deprecation policy to contact users ands remove it from the code as well. Closes #10500
I wanted to comment here that we are deprecating |
Please add the information to https://docs.readthedocs.io/en/stable/config-file/v2.html#python-system-packages too! |
…onfig key and UI checkbox) (#10562) * Docs: do not mention `python.system_packages` This option doesn't work on builds using `build.os` because the Python binary used it's not the one from the system, but another one compiled via `asdf`. This means that creating a virtualenv with access to the "system packages" has no effect at all. As a first step, I'm removing this option from the documentation to avoid confusions. Next, we should probably our deprecation policy to contact users ands remove it from the code as well. Closes #10500 * Build: remove "use system package" option - Removed from the UI - Removed from the v1 and v2 config file * Do not remove the DB field for now We should remove this field after the deploy. * Remove `use_system_site_packages` leftovers * Display custom error messages based on the config key * Apply suggestions from code review Co-authored-by: Eric Holscher <[email protected]> * Minor code style changes * Update readthedocs/config/config.py Co-authored-by: Anthony <[email protected]> --------- Co-authored-by: Eric Holscher <[email protected]> Co-authored-by: Anthony <[email protected]>
Details
Expected Result
I'm installing
python3-clang
usingapt
, enablingpython.system_packages
, and expect my Sphinx extension to be able to import the package.The build log shows the system package was installed, and
--system-site-packages
was passed to the virtual environment.Actual Result
Import fails with
ModuleNotFoundError: No module named 'clang'
.The text was updated successfully, but these errors were encountered: