Importerror: No Module Named 'distutils' In Pandas Pyinstaller
Solution 1:
This is an issue with virtualenv from version 16.4.0 onward, as indicated in the following issue on github: https://github.com/pyinstaller/pyinstaller/issues/4064
These workarounds were suggested:
In the .spec file, at the line “hiddenimports=[]”, change to "hiddenimports=['distutils']", then run pyinstaller using the spec file.
Tried this, but it didn't work in my case, now distutils module could be found, but it threw an error while importing the module.
Downgrade virtualenv to an earlier version.
I downgraded virtualenv to version 16.1.0 and and recreated the execution bundle. The new execution file worked alright in my case.
Solution 2:
Found the solution, it's because of the virtual environment.
The error occurred because of the creation of a new virtual environment while creating the project. I have deleted my existing virtual and created new virtual by setting up the python interpreter and opting the pre-existing interpreter
option.
The IDE will create a virtual named venv
and copies all the python files from Python/bin to this folder and then import modules from here, by activating the same solved my issue.
Post a Comment for "Importerror: No Module Named 'distutils' In Pandas Pyinstaller"