0

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:

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

The detailed Error

Has anyone face this problem before ? if so, could you please provide me the proper way of fixing it as i think there are some dependencies issue.

  • Is the relative location of your cvlib same in both cases? i mean if your exe is generated at a different output location, relative to which the cvlib can no longer be resolved ? – Gurpreet Mar 26 '20 at 22:19
  • @Gurpreet, No I actually save cvlib in Anaconda3\envs\gpu2\Lib\site-packages where gpu2 is the name of my env, the weirdest thing is that other libraries in similar location can be imported fine apart from cvlib! – James_64_64 Mar 27 '20 at 11:37

1 Answers1

0

I figured out finally what the problem was, Pyinstaller sometimes is not able to include some libraries that we import in our (.py) file. So, 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 as it is in the same location as your (.exe) file.