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

Executable throws exception on numpy dependency #33

Closed
Gingernaut opened this issue Apr 4, 2023 · 1 comment
Closed

Executable throws exception on numpy dependency #33

Gingernaut opened this issue Apr 4, 2023 · 1 comment

Comments

@Gingernaut
Copy link

Describe the bug

I'm packaging up a python application that has numpy as a dependency. I package the application with pdm pack --exe -g -p ./ - when I run ./myexecutable myFunction "arg1" I get the following error

ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

    https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  * The Python version is: Python3.9 from "/Users/tpeterson/Code/ai_software/luna/.venv/bin/python"
  * The NumPy version is: "1.24.2"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: No module named 'numpy.core._multiarray_umath'

I've tried python 3.8-3.11 and have reinstalled numpy several times. numpy is imported inside of "myFunction" - other python functions I call that don't have numpy as an import succeed.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Run command '...'
  3. Scroll down to '...'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

System (please complete the following information):

  • pdm-packer version: latest
  • Python version: 3.8
  • OS: MacOS with M2 Max

Additional context
Add any other context about the problem here.

@frostming
Copy link
Owner

frostming commented Apr 4, 2023

Only pure python libraries are allowed to be packed in a zipapp due to the limitation of Python's zipimporter. Sorry.

@frostming frostming closed this as not planned Won't fix, can't repro, duplicate, stale Apr 4, 2023
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