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

[vcpkg|python] python commands being broken by system installed python #34746

Closed
Neumann-A opened this issue Oct 26, 2023 · 1 comment · Fixed by #35990
Closed

[vcpkg|python] python commands being broken by system installed python #34746

Neumann-A opened this issue Oct 26, 2023 · 1 comment · Fixed by #35990
Assignees
Labels
category:port-bug The issue is with a library, which is something the port should already support

Comments

@Neumann-A
Copy link
Contributor

Observed Error:; pkgconf fails to build or any python command fails.

with something like:

G:\vcpkg_common\downloads\tools\python>G:\vcpkg_common\downloads\tools\python\python-3.11.5-x64\python.exe
Python 3.11.5 (tags/v3.11.5:cce6ba9, Aug 24 2023, 14:38:34) [MSC v.1936 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
> import _ctypes
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> ImportError: DLL load failed while importing _ctypes: Das angegebene Modul wurde nicht gefunden.
> >>>

(error only happens in CWD is different from where python lives)

Reason for failure is a globaly installed Python adding:
HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\3.11\PythonPath
modifying sys.path (dll lookup path) for the python used by vcpkg.

vcpkg probably should add -I (or at least -E) to all python calls to avoid modifications of any kind. (Unfortunatly this also deactivates using PYTHONPATH as an environment variable)

@Osyotr
Copy link
Contributor

Osyotr commented Oct 26, 2023

Normally, embeddable python package comes with python3xy._pth that makes it isolated from user environment. However, that file was removed in #7051.

@Adela0814 Adela0814 added the category:port-bug The issue is with a library, which is something the port should already support label Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants