Search code examples
pythonanacondacondapyinstaller

How can I fix "The 'pathlib' package is an obsolete backport of a standard library package and is incompatible with PyInstaller"?


I am using Python 3.9.16. When I try to build an application like so:

(base) G:\>pyinstaller --onefile grp.py

I get an error that says:

The 'pathlib' package is an obsolete backport of a standard library package and is incompatible with PyInstaller. Please remove this package (located in C:\Users\alpha\anaconda3\lib\site-packages) using conda remove then try again.

I tried uninstalling and reinstalling pyinstaller, as well as upgrading conda, but none of this helped.

How can I fix the problem?


Solution

  • If conda remove pathlib can't find the package, go to the lib folder and delete a folder called path-list-.....