Skip to content

Commit

Permalink
Depend: Add 'lib' to end of library path for MacOS (#6021)
Browse files Browse the repository at this point in the history
The library search path in get_python_library_path() was using
compat.base_prefix, this does not account for libraries being in a 'lib' dir
under the base_prefix and so when running on MacOS under pyenv+virtualenv the
python library was not found
  • Loading branch information
andydhobbs authored and rokm committed Jul 20, 2021
1 parent 4843026 commit edceb66
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion PyInstaller/depend/bindepend.py
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,9 @@ def _find_lib_in_libdirs(*libdirs):
# and exec_prefix. That's why we can use just sys.prefix.
# In virtualenv PyInstaller is not able to find Python library.
# We need special care for this case.
python_libname = _find_lib_in_libdirs(compat.base_prefix)
python_libname = _find_lib_in_libdirs(
compat.base_prefix,
os.path.join(compat.base_prefix, 'lib'))
if python_libname:
return python_libname

Expand Down
1 change: 1 addition & 0 deletions news/6021.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(macOS) Fix python shared library detection for non-framework python builds when the library path cannot be inferred from imports of the ``python`` executable.

0 comments on commit edceb66

Please sign in to comment.