1

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

The full error: Traceback when running .exe

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.

Baron
  • 106
  • 1
  • 10

1 Answers1

6

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.

Baron
  • 106
  • 1
  • 10
  • Had the same issue, switching to 1.15.4 fixed it for me too. – Dan Jan 21 '19 at 15:17
  • switching to 1.15.4 did not solve my issue. can you please give more details about it. i have pandas == 0.24.2 and numpy 1.15.4 and pyinstaller = 3.4 – shubham Jul 15 '19 at 08:42
  • @shubham, My problem was that packaging my project (creating a .exe file) didn't work when i had numpy 1.16.0 installed. For me, downgrading numpy to 1.15.4 worked. I did this inside my projects virtual environment, which i made using pipenv. If you need any more info just ask. Also it could be they fixed the issue in a newer version of numpy, but i am not sure since i am no longer working on this project. – Baron Jul 22 '19 at 11:36