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

Can't Load from Zip Properly #673

Closed
theonewolf opened this issue Aug 24, 2015 · 1 comment
Closed

Can't Load from Zip Properly #673

theonewolf opened this issue Aug 24, 2015 · 1 comment

Comments

@theonewolf
Copy link

When executing from an executable Python Zip file, psutil doesn't properly import the following:

  File "test.pyz/rzu0uldx_bf70b7d3-ab68-4018-8a67-480b6c772226/lib/python3.4/site-packages/psutil/__init__.py", line 63, in <module>
  File "test.pyz/rzu0uldx_bf70b7d3-ab68-4018-8a67-480b6c772226/lib/python3.4/site-packages/psutil/_pslinux.py", line 24, in <module>
ImportError: cannot import name '_psutil_linux'

I get the same exact error on the Windows platform:

  File "deployhello.pyz\_1pbdhuv_70ad2a47-1799-444c-a1f3-5861210b8eb8\Lib\site-p
ackages\psutil\__init__.py", line 110, in <module>
  File "deployhello.pyz\_1pbdhuv_70ad2a47-1799-444c-a1f3-5861210b8eb8\Lib\site-p
ackages\psutil\_pswindows.py", line 16, in <module>
ImportError: cannot import name '_psutil_windows'
@theonewolf
Copy link
Author

Ah, this is because psutil depends on .so and .dll files which can not be included automagically when inside a Zip by Python.

The solution is to do a two-stage execution where the first script unpacks the Zip, and the second script executes the actual logic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant