Python Forum
Missing required dependencies when using pyinstaller
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Missing required dependencies when using pyinstaller
#1
I built a small script using python 3.7.2 on windows 10 64bit.
The script was using pandas library just to create a new xlsx file with some data.
Then when using pyinstaller to packaging the script I got the below warnings.
When opening the "final.exe" file I got the below error.

I tried several method to solve this issue but nothing works with me.

Script code:
import pandas as pd

print('Please enter the working path:')

path = input()

Result = Action = pd.DataFrame()
final = pd.ExcelWriter(path + r'\final.xlsx')

Result = Result.append({'Data in': [10, 20, 30, 40]}, ignore_index=True)
Action = Action.append({'Data in': [100, 200, 300, 400]}, ignore_index=True)

Result.to_excel(final, sheet_name='Result', index=False)
Action.to_excel(final, sheet_name='Action', index=False)


final.save()

print('Done Successfully')
print('Please press Enter to close this window')
input()
Libraries versions:
D:\python_code>pip list
Package             Version
------------------- ----------
altgraph            0.16.1
certifi             2018.11.29
chardet             3.0.4
cx-Freeze           5.1.1
Cython              0.29.3
docutils            0.14
et-xmlfile          1.0.1
future              0.17.1
idna                2.8
jdcal               1.4
Kivy                1.10.1
Kivy-Garden         0.1.4
kivy.deps.angle     0.1.7
kivy.deps.glew      0.1.10
kivy.deps.gstreamer 0.1.13
kivy.deps.sdl2      0.1.18
macholib            1.11
numpy               1.16.0
openpyxl            2.5.14
pandas              0.24.0
pefile              2018.8.8
Pillow              5.4.1
pip                 18.1
py2exe              0.9.2.2
PyAutoGUI           0.9.41
pygame              1.9.4
PyGetWindow         0.0.3
Pygments            2.3.1
PyInstaller         3.4
PyMsgBox            1.0.6
pypiwin32           223
PyRect              0.1.4
PyScreeze           0.1.19
python-dateutil     2.7.5
PyTweening          1.0.3
pytz                2018.9
pywin32             224
pywin32-ctypes      0.2.0
requests            2.21.0
setuptools          40.7.1
six                 1.12.0
urllib3             1.24.1
virtualenv          16.3.0
wheel               0.32.3
xlib                0.21
xlrd                1.2.0
Pyinstaller log:
final.exe error:
Error:
Traceback (most recent call last): File "Data_in.py", line 1, in <module> File "c:\users\ghonim\appdata\local\programs\python\python37-32\lib\site-packages\Pyinstaller\loader\pyimod03_importers.py", line 627, in exec_module exec(bytecode, module._dict_) File "site-packages\pandas\_init_.py", line 19, in <module> ImportError: Missing required dependencies ['numpy'] [12816] Failed to execute script Data_in
Sorry for the long thread, but really I need help.
Thanks for your help. Smile
Reply
#2
you can try when building
pyinstaller --hidden-import numpy
Recommended Tutorials:
Reply
#3
(Jan-29-2019, 08:51 PM)metulburr Wrote: you can try when building
pyinstaller --hidden-import numpy

same error exist

new pyinstaller log:
Reply
#4
Still having the same problem. And I couldn't overcome this issue till now.

Is there any other suggestion?
Reply
#5
I'm having the same issue. Did you find a solution?
Reply
#6
(Mar-07-2019, 12:12 PM)dmag Wrote: I'm having the same issue. Did you find a solution?

Yes, I just found the solution yesterday. Smile

The case with me that I must upgrade the numpy to the latest version (any version latter than 1.16.0), the latest version now is 1.16.2 which I installed, as I found a thread talking about an issue between pyinstaller and numpy v1.16.0.

Try it and let me know if it works with you.

pip install --upgrade numpy
Reply
#7
I have numpy 1.16.2 and pandas 0.24.1, but still getting this issue.
Reply
#8
(Mar-07-2019, 02:05 PM)dmag Wrote: I have numpy 1.16.2 and pandas 0.24.1, but still getting this issue.

Did you try:
pyinstaller -F --hidden-import numpy filename.py
If not worked, try downgrade setuptools to 19.2
pip install setuptools==19.2
Reply
#9
pyinstaller -F --hidden-import numpy filename.py didn't help, and setuptools is already v19.2. Any more thoughts? There are a number of numpy .pyd files collected in the dist folder:

numpy.core._multiarray_tests.pyd
numpy.core._multiarray_umath.pyd
numpy.fft.fftpack_lite.pyd
numpy.linalg._umath_linalg.pyd
numpy.linalg.lapack_lite.pyd
numpy.random.mtrand.pyd

So it's not ignoring numpy completely, but is suspect other modules are missing. How do you find out which ones pandas needs? The program was fine before installing pandas and adding pandas code.
Reply
#10
(Mar-07-2019, 02:46 PM)dmag Wrote: pyinstaller -F --hidden-import numpy filename.py didn't help, and setuptools is already v19.2. Any more thoughts? There are a number of numpy .pyd files collected in the dist folder:

numpy.core._multiarray_tests.pyd
numpy.core._multiarray_umath.pyd
numpy.fft.fftpack_lite.pyd
numpy.linalg._umath_linalg.pyd
numpy.linalg.lapack_lite.pyd
numpy.random.mtrand.pyd

So it's not ignoring numpy completely, but is suspect other modules are missing. How do you find out which ones pandas needs? The program was fine before installing pandas and adding pandas code.

I just try these 3 actions at the same time and it works for me, after that I rolled back everything to know which one exactly solve my issue, and found that upgrading numpy it the solution.

If possible, can you pass the code to be able to make more investigation?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Is it possible to see dependencies before installing a package? quazirfan 4 1,076 Dec-06-2022, 02:50 PM
Last Post: snippsat
  TypeError: missing a required argument: 'y' gible 0 2,915 Dec-15-2021, 02:21 AM
Last Post: gible
  TypeError: missing 3 required positional arguments: wardancer84 9 10,880 Aug-19-2021, 04:27 PM
Last Post: deanhystad
  TypeError: run_oracle_job() missing 1 required positional argument: 'connection_strin python_student 1 1,969 Aug-06-2021, 08:05 PM
Last Post: SheeppOSU
  TypeError: max_value() missing 2 required positional arguments: 'alpha' and 'beta' Anldra12 2 4,212 May-15-2021, 04:15 PM
Last Post: Anldra12
  TypeError: sum() missing 1 required positional argument: 'num2' Insen 3 5,466 Jan-06-2021, 04:25 PM
Last Post: Insen
  Managing dependencies with pipenv t4keheart 6 2,939 Aug-05-2020, 12:39 AM
Last Post: t4keheart
  Missing 1 required position argument: 'failure' while starting thread. BradLivingstone 3 4,112 Jun-19-2020, 02:31 PM
Last Post: stullis
  TypeError: forward() missing 1 required positional argument: 'x' sveto4ka 4 12,288 Jun-17-2020, 07:25 PM
Last Post: sveto4ka
  missing 1 required positional argument: 'self' yasser 7 11,460 Jun-07-2020, 06:48 AM
Last Post: ndc85430

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020