Search code examples
pythonpycharmpyinstaller

pyinstaller looks into a non-existing python path


I have a file (main.py) in a project that I want to compile into a single .exe file. So I installed pyinstaller through pip on my console (running in the project directory) and it seems to have been installed successfully. However when I type pyinstaller -w --onefile main.py into the console, I get:

Fatal Error: unable to process using '"C:\RepositoryOwnerLocal\venv\scripts\python.exe" "C:\Contributor\PycharmProjects\Project\venv\Scripts\pyinstaller.exe" -w --onefile main.py': The system cannot find the file specified.

Any help? I am using PyCharm 2022.2.1 with PS console in Windows 10.

Note: I pulled this project from a GitHub repository and I know that the python.exe file that pyinstaller is looking for is a directory from the local of the repository owner. I guess the main question is how can I correct this directory. I have already checked the pyvenv.cfg file and the python directory is the one on my local.

Many thanks.


Solution

  • Try uninstalling and reinstalling pyinstaller through pip.