So I installed python-3.10.7 on a fresh windows 10 PC, then used pip install scons
to install scons but I keep getting the following error when I type scons
in terminal.
C:\Users\tempm>scons
'scons' is not recognized as an internal or external command,
operable program or batch file.
Ive added C:\Users\tempm\AppData\Local\Programs\Python\Python310\Scripts
and also C:\Users\tempm\AppData\Local\Programs\Python\Python310
to my PATH environment variable with no luck still. Scons seems to have been installed in C:\Users\tempm\AppData\Local\Programs\Python\Python310\Lib\site-packages\SCons\Script
and I''ve added every directory under SCon to my evironment variable with still no luck.
My python script directory looks like so:
Directory of C:\Users\tempm\AppData\Local\Programs\Python\Python310\Scripts
16/09/2022 02:23 PM <DIR> .
16/09/2022 02:23 PM <DIR> ..
16/09/2022 02:23 PM 107,912 pip.exe
16/09/2022 02:23 PM 107,912 pip3.10.exe
16/09/2022 02:23 PM 107,912 pip3.exe
3 File(s) 323,736 bytes
2 Dir(s) 83,683,979,264 bytes free
And I believe there should be an scons.exe there but I cant find it anywhere.
When I try pip install scons
again i get the following:
Requirement already satisfied: scons in c:\users\tempm\appdata\local\programs\python\python310\lib\site-packages (4.4.0)
Requirement already satisfied: setuptools in c:\users\tempm\appdata\local\programs\python\python310\lib\site-packages (from scons) (63.2.0)
If anyone has any idea of anything else I could try that would be greatly appreciated.
EDIT: SOLUTION
Thanks for sll your comments. I this should be the answer, but installing scons through pip on python3.10 just didn't give me an scons.exe, so I installed python3.8 and pip installed scons through that, and then it showed up in scripts! Maybe there is a bug with python3.10 but at least its solved.
PLEASE WHEN YOU INSTALL PYTHON make sure you check the box that asks you if you want to add it to your environment variables, especially if you are on a fresh machine, just to save you any mistakes or headaches trying to find where to add it and what to add.
CodePudding user response:
On Windows, you're looking for the file scons.exe
.
If your configuration is like mine, it is in the directory C:\Users\tempm\AppData\Roaming\Python\Python310\Scripts
but the exact location depends on how exactly you've installed it.
When you have the correct path added, restart cmd
or whatever other program you need to have the path in. Windows won't update the PATH
variable until a program is restarted.
To check if the PATH
variable is updated in cmd
, you can use the command echo %Path%
which displays it's content.
To see if the shell is able to find SCons, type where scons
(or you may just try to run SCons and see if it works).
CodePudding user response:
Try:
python -mSCons --version
(Assuming your installed python is in your path)
You could also try
py -3.10 -MSCons --version