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

Libraries packaged in unexpected location when using python installed via scoop #8023

Closed
bersbersbers opened this issue Oct 20, 2023 · 2 comments · Fixed by #8025
Closed
Labels

Comments

@bersbersbers
Copy link
Contributor

bersbersbers commented Oct 20, 2023

Description of the issue

The following example code fails on my system:

bug.py

# pyinstaller --onefile bug.py && dist\bug.exe
import matplotlib

The output is:

C:\Build\project>dist\bug.exe
Traceback (most recent call last):
  File "C:\Scoop\persist\python\Lib\site-packages\PyInstaller\hooks\rthooks\pyi_rth_mplconfig.py", line 45, in <module>
    _pyi_rthook()
  File "C:\Scoop\persist\python\Lib\site-packages\PyInstaller\hooks\rthooks\pyi_rth_mplconfig.py", line 31, in _pyi_rthook
    import _pyi_rth_utils  # PyInstaller's run-time hook utilities module
    ^^^^^^^^^^^^^^^^^^^^^
  File "PyInstaller\loader\pyimod02_importers.py", line 391, in exec_module
  File "PyInstaller\fake-modules\_pyi_rth_utils\__init__.py", line 23, in <module>
  File "PyInstaller\loader\pyimod02_importers.py", line 391, in exec_module
  File "PyInstaller\fake-modules\_pyi_rth_utils\_win32.py", line 12, in <module>
  File "PyInstaller\loader\pyimod02_importers.py", line 391, in exec_module
  File "ctypes\__init__.py", line 8, in <module>
ImportError: DLL load failed while importing _ctypes: The specified module could not be found.
[4880] Failed to execute script 'pyi_rth_mplconfig' due to unhandled exception!

Context information (for bug reports)

  • Output of pyinstaller --version: 6.1.0
  • Version of Python: 3.12.0
  • Platform: Windows
  • How you installed Python: scoop install python
  • Did you also try this on another platform? No, scoop is Windows-only.
  • try the latest development version, using the following command: same result.

libffi-8.dll seems to be packaged in the wrong location inside the MEI, see https://github.com/orgs/pyinstaller/discussions/7431#discussioncomment-7335377.

@bersbersbers bersbersbers added the triage Please triage and relabel this issue label Oct 20, 2023
@rokm
Copy link
Member

rokm commented Oct 20, 2023

libffi-8.dll seems to be packaged in the wrong location inside the MEI, see https://github.com/orgs/pyinstaller/discussions/7431#discussioncomment-7335377.

Thanks for the initial analysis! This sounds like a DLL parent path preservation bug (which seems to affect either scoop-installed python, or perhaps python without virtual environment in general). I'll look into it.

@rokm rokm added bug and removed triage Please triage and relabel this issue labels Oct 20, 2023
@bersbersbers
Copy link
Contributor Author

Beautiful, thank you! It's not the only place where scoops symlinks/junctions create problems, but I'm happy you choose to support it.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants