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

Cannot find psycopg2-binary #11

Closed
frafra opened this issue Sep 2, 2021 · 1 comment
Closed

Cannot find psycopg2-binary #11

frafra opened this issue Sep 2, 2021 · 1 comment

Comments

@frafra
Copy link

frafra commented Sep 2, 2021

Traceback (most recent call last):
  File "/usr/lib64/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib64/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "./nina_database_manager.pyz/__main__.py", line 2, in <module>
  File "/usr/local/lib/python3.8/site-packages/manager.py", line 9, in <module>
    import psycopg2
  File "<frozen zipimport>", line 259, in load_module
  File "./nina_database_manager.pyz/psycopg2/__init__.py", line 51, in <module>
ModuleNotFoundError: No module named 'psycopg2._psycopg'

Describe the bug
psycopg2-binary is a dependency of the project, but it is not found when I try to execute the .pyz zip file.

To Reproduce
Steps to reproduce the behavior:

  1. Add psycopg2-binary
  2. Import psycopg2 in your app
  3. Pack your app
  4. Run it
  5. See error

Expected behavior
psycopg2 should be imported as usual.

System (please complete the following information):

  • pdm-packer version: 0.2.1
  • Python version: 3.8
  • OS: Linux

Additional context
Other dependencies, such as ldap, seems to work as usual.

@frostming
Copy link
Owner

This is an OS limitation: https://docs.python.org/3/library/zipapp.html#caveats

pdm-packer can't help with this case.

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

2 participants