File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 1919 # poetry/requests-3, I was not allowed to install pip! So I did not pursue this
2020 # option further.
2121 #
22- # Instead, testing (on both Windows and Linux) shows that the last entry of
23- # `site.getsitepackages()` has the right path (note: On linux there is only a single
24- # entry), whereas `site.getusersitepackages()` is about the system python (very
25- # confusing).
22+ # Instead, testing `site.getsitepackages()` contains has the right path, whereas
23+ # `site.getusersitepackages()` is about the system python (very confusing).
2624 #
2725 # We can't use the environment variable POETRY_VIRTUALENVS_OPTIONS_NO_PIP because it
2826 # does not work, see https://github.com/python-poetry/poetry/issues/5906
2927 import site
30- print (site .getsitepackages ()[- 1 ])
28+
29+ if sys .platform .startswith ("win32" ):
30+ # On windows, the last entry of `site.getsitepackages()` has the right path
31+ print (site .getsitepackages ()[- 1 ])
32+ else :
33+ # on unix, the first entry of `site.getsitepackages()` has the right path
34+ print (site .getsitepackages ()[0 ])
You can’t perform that action at this time.
0 commit comments