You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the issues of this repo and believe that this is not a duplicate.
I have searched the documentation and believe that my question is not covered.
Feature Request
Adding support for --system-site-packages, as described in venv documentation, makes possible to have a set of base common packages available for a number of virtual environments, thus saving disk space and reducing environment creation time. I believe that this option gives some useful extra flexibility on package and environment management.
Reacted by Aliaksei Urbanski, Yuji Kanagawa, Thomas Coenen, Thomas Lam, Bill Flood, Nick Cross, 龍共每文, deraffe, codito, Alexander and 29 more
Reacted by q-maro, RobotFramework(er), Oromion and doomroep5
This would be very useful as its a significant space saving - e.g. on a single small repository the difference was 150MB of dependencies - multiply that out and its soon worthwhile.
someone please revive #1404 :'(
Or I'm willing to help if there're more to do to complete the feature.
I need that feature since I have needs some packages to be globally available in order to run setup.py of my private package installed from git.
What's the behaviour of this? Will it default to using the system site package versions when doing poetry update or poetry install without a lock file?
I wanted to use this in a docker container so I could avoid virtualenvs.create false which breaks some system deps. But poetry install wants to "update" everything (eg Updating certifi (2022.6.15 /opt/conda/lib/python3.7/site-packages -> 2022.6.15)). So it's useless for me 😣.
EDIT:
I'm using poetry 1.2.0b3
Also I guess this answers you question @couling
This behavior is problematic when the goal is to share dependencies for eg a container
@awoimbee Can't you just install whatever dependencies at build time? I would think that dockerizing the environment would obviate a --system-site-packages option, but maybe I don't understand your use case?
@rpdelaney
As is often the case here, my issue is mostly with pytorch. It's >1GB, which is an issue when building/pushing/pulling the same container again and again (my poetry install layer is way too big).
To reuse image layers (faster image build/push/pull), I want a base image with cuda, torch, ... (think https://hub.docker.com/r/pytorch/pytorch but custom) and then I want to build my application container on top of this base image.
The resulting application container shall be used in prod and as a dev container (with minor differences between the two).
Possible solutions for the application image to inherit packages from the base image:
virtualenvs.create false: breaks some system dependencies, is not suitable for a dev env
conda environments: not the best (I won't go into details)
settings.virtualenvs.include-system-packages: seems like the perfect solution
But no ! poetry with settings.virtualenvs.include-system-packages will re-install torch (and other packages), leading to an even slower build time and an even larger container.
Reacted by Sean Devonport, rickko, Mike Purvis, Jared Van Bortel, Sander Maijers, Nishant Aswani and Mikhail Golubev
I have searched the issues of this repo and believe that this is not a duplicate.
I have searched the documentation and believe that my question is not covered.
Feature Request
Adding support for --system-site-packages, as described in venv documentation, makes possible to have a set of base common packages available for a number of virtual environments, thus saving disk space and reducing environment creation time. I believe that this option gives some useful extra flexibility on package and environment management.
Activity
kam1sh commentedon Sep 23, 2019
As I see, virtual environments creates via
venv.EnvBuilderandvirtualenv.create_environment:https://github.com/sdispater/poetry/blob/df98fd289b9b629d2171900c1b1bddcee3696cff/poetry/utils/env.py#L301-L319
...so it shouldn'be hard.
I see this as a setting in
poetry configwith something likesettings.virtualenvs.include-system-packages. Will (try to) implement tomorrow.rnc commentedon Dec 5, 2019
This would be very useful as its a significant space saving - e.g. on a single small repository the difference was 150MB of dependencies - multiply that out and its soon worthwhile.
danielsig727 commentedon Jan 3, 2020
someone please revive #1404 :'(
Or I'm willing to help if there're more to do to complete the feature.
I need that feature since I have needs some packages to be globally available in order to run
setup.pyof my private package installed from git.Add system-site-packages setting
frankier commentedon May 19, 2020
I agree this functionality would be useful in Poetry, but for the meantime here are some workarounds (cross-posting across related issues):
Use case 1) I just want to save space use by my virtualenvs:
Use case 2) I need to use a globally installed package from my poetry venv.
include-system-site-packages = trueAdd system-site-packages setting
Add system-site-packages setting
Add system-site-packages setting
Add system-site-packages setting
Add virtualenvs.options.system-site-packages setting
Add virtualenvs.options.system-site-packages setting
Add virtualenvs.options.system-site-packages setting
stackErr-NameNotResolved commentedon Feb 14, 2022
This issue seems to be merged and closed but actually never released? Using Poetry 1.1.13:
poetry config virtualenvs.options.system-site-packages true
ValueError
Setting virtualenvs.options.system-site-packages does not exist
couling commentedon May 12, 2022
What's the behaviour of this? Will it default to using the system site package versions when doing
poetry updateorpoetry installwithout a lock file?awoimbee commentedon Jul 18, 2022
I wanted to use this in a docker container so I could avoid
virtualenvs.create falsewhich breaks some system deps. But poetry install wants to "update" everything (egUpdating certifi (2022.6.15 /opt/conda/lib/python3.7/site-packages -> 2022.6.15)). So it's useless for me 😣.EDIT:
I'm using poetry 1.2.0b3
Also I guess this answers you question @couling
This behavior is problematic when the goal is to share dependencies for eg a container
rpdelaney commentedon Jul 19, 2022
@awoimbee Can't you just install whatever dependencies at build time? I would think that dockerizing the environment would obviate a
--system-site-packagesoption, but maybe I don't understand your use case?awoimbee commentedon Jul 19, 2022
@rpdelaney
As is often the case here, my issue is mostly with pytorch. It's >1GB, which is an issue when building/pushing/pulling the same container again and again (my
poetry installlayer is way too big).To reuse image layers (faster image build/push/pull), I want a base image with cuda, torch, ... (think https://hub.docker.com/r/pytorch/pytorch but custom) and then I want to build my application container on top of this base image.
The resulting application container shall be used in prod and as a dev container (with minor differences between the two).
Possible solutions for the application image to inherit packages from the base image:
virtualenvs.create false: breaks some system dependencies, is not suitable for a dev envsettings.virtualenvs.include-system-packages: seems like the perfect solutionBut no !
poetrywithsettings.virtualenvs.include-system-packageswill re-install torch (and other packages), leading to an even slower build time and an even larger container.rpdelaney commentedon Oct 23, 2022
OK, thanks for the explanation. My docker-fu is not strong enough to suggest solutions in that direction...
doomroep5 commentedon Apr 21, 2023
github-actions commentedon Feb 29, 2024
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.