[Solved] Pyinstaller Error: “RuntimeError: No metadata path found for distribution ‘greenlet‘

When using pyinstaller to package py file as exe, if the following problems occur

File "c:\xxx\anaconda3\lib\site-packages\PyInstaller\hooks\hook-gevent.py", line 25, in <module>
datas += copy_metadata('gevent', recursive=True)
File "c:\xxx\anaconda3\lib\site-packages\PyInstaller\utils\hooks\__init__.py", line 940, in copy_metadata
dest = _copy_metadata_dest(dist.egg_info, dist.project_name)
File "c:\xxx\anaconda3\lib\site-packages\PyInstaller\utils\hooks\__init__.py", line 975, in _copy_metadata_dest
f"No metadata path found for distribution '{project_name}'.")
RuntimeError: No metadata path found for distribution 'greenlet'.

The following methods can be used to solve the problem

pip  install --ignore-installed greenlet 

It is said that the following method (method 2) can also be used to solve the problem. The blogger has not tested this method and does not know whether it is available. It is mainly to have a chance to test it later.

When you encounter this problem, you can uninstall the original one and reinstall it, but this reinstallation will遇到这种问题直接卸载原来的重装但是这个重装会

ERROR: Cannot uninstall ‘greenlet’. It is a distutils installed
project and thus we cannot accurately determine which files belong to
it which would lead to only a partial uninstall.

Then you can just delete this file where you found it according to the address where you reinstalled it.

Read More: