Click here to Skip to main content
15,886,840 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have written a python script that uses cvlib library, when i run the code as a python scrept it works fine, however; when i converted the code into an exe file, everything seems to work fine, apart from importing cvlib library.


The error shows up like the follwoing:


Python
pkg_resources.DistributionNotFound: The 'cvlib' distribution was not found and is required by the application


What I have tried:

I tried to use --hidden-import=cvlib and --additional-hooks-dir=, I also tried many other techniques to include the path but it did work
Posted
Updated 27-Mar-20 2:29am
Comments
Richard MacCutchan 27-Mar-20 4:38am    
Most likely the process that created the exe did not properly include the library. Or the library must be installed in some specific location. You should check the documentation for the product you are using to create the exe file.
James_64_64 27-Mar-20 7:42am    
Hi, I am actually using Pyinstaller to create the exe file, I will check the decumentation thank you

1 solution

I figured out what the problem was, Pyinstaller is not sometimes able to include some libraries that we import in our .py file. When Pyinstaller creates the .exe file, it agnores some imports, so the solution is to copy the folder of these imports, For example, cvlib forlder and paste it in the same location as your .exe file.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900