-
-
Notifications
You must be signed in to change notification settings - Fork 110
Description
Describe the bug
When attempting to run pygubu-designer on Windows, users encounter an error if Python is installed in a directory with spaces, such as C:\Program Files. The terminal does not recognize the full path unless it is enclosed in quotation marks, causing the following error:
'C:\Program' is not recognized as the name of a cmdlet, function, script file, or operable program.
To Reproduce
Steps to reproduce the behavior:
- Install Python in a directory with spaces in the path (e.g.
C:\Program Files\Python312). - Add the pygubu-designer tool by running pip install pygubu-designer.
- Attempt to run pygubu-designer from the terminal or PowerShell:
C:\Program Files\Python312\Scripts\pygubu-designer.exe - See the error message:
'C:\Program' is not recognized as the name of a cmdlet, function, script file, or operable program.
Expected behavior
The pygubu-designer should run without errors, regardless of whether the Python installation directory contains spaces.
Your Environment (please complete the following information):
- OS: Windows 10
- Python version: Python 3.12
- Pygubu version: e.g. pygubu 0.29
- Designer version: e.g. pygubu-designer 0.34
Troubleshooting
Issue: Error When Running pygubu-designer on Windows
If you encounter the error:
'C:\Program' is not recognized as the name of a cmdlet, function, script file, or operable program.
This happens because paths with spaces need to be handled carefully in the terminal. To fix this, you can:
- Use Quotation Marks Wrap the path to Python in double quotation marks:
C:\Program Files\Python312\python.exe" -m pygubu-designer - Add Python to PATH Add the Python installation directory and the Scripts folder to your PATH environment variable. Steps:
- Open System Properties (
Win + R, typesysdm.cpl). - Navigate to Advanced > Environment Variables.
- Under System Variables, find and edit
Path. - Add the following:
C:\Program Files\Python312\C:\Program Files\Python312\Scripts\
- Use Short Path Names You can use the 8.3 pathname format to avoid spaces in the path:
C:\PROGRA~1\Python312\python.exe -m pygubu-designer