How to fix 'Missing required dependencies ['numpy']' when running packaged app made with PyInstaller?

会有一股神秘感。 提交于 2019-12-11 04:14:06

问题


When I run my packaged app I get the error ImportError: Missing required dependencies ['numpy']. How do I fix this?

The full error:

I used pyinstaller guiMain.py to create the .exe, within a virtual environment created with pipenv shell. This virtual environment has numpy 1.16.0 installed, aswell as pandas, pyinstaller, sklearn, googleads and pytest.

When I run the code (unpackaged and within the virtual environment) everything works fine. The packaging process goes fine aswell, until I try to run the .exe, which gives the error above.

So far I have tried:

  • uninstalling and installing numpy and pandas multiple times without success.
  • removing virtual environment and creating a new one and installing all required packages, without success.

I thought the error might have been caused by the recent update to the googleads package (which caused an error with pyyaml version mismatch when locking the pipfile.lock), but downgrading this package to 15.0.1 didn't resolve the numpy issue (it did resolve the pyyaml issue).

My Pipfile:

[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]

[packages]
numpy = "*"
pandas = "*"
sklearn = "*"
pyinstaller = "*"
pytest = "*"
googleads = "==15.0.1"

[requires]
python_version = "3.6"

Any help is appreciated.


回答1:


Apparrently the newest version of numpy (v1.16.0) breaks something in pyinstaller, because packaging the app with numpy version 1.15.4 works fine.



来源:https://stackoverflow.com/questions/54234586/how-to-fix-missing-required-dependencies-numpy-when-running-packaged-app-m

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!