How to fix scons do not installed in Windows?

135 Views Asked by At

I was use godot for c++ and it native for c++ need to install scons. I was installed scons normally. But it caused a problem:

C:\Users\Admin\AppData\Roaming\Python\Python312\site-packages\setuptools\__init__.py:80: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
!!

        ********************************************************************************
        Requirements should be satisfied by a PEP 517 installer.
        If you are using pip, you can try `pip install --use-pep517`.
        ********************************************************************************

!!
  dist.fetch_build_eggs(dist.setup_requires)
running install
C:\Users\Admin\AppData\Roaming\Python\Python312\site-packages\setuptools\_distutils\cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` directly.
        Instead, use pypa/build, pypa/installer or other
        standards-based tools.

        See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
        ********************************************************************************

!!
  self.initialize_options()
C:\Users\Admin\AppData\Roaming\Python\Python312\site-packages\setuptools\_distutils\cmd.py:66: EasyInstallDeprecationWarning: easy_install command is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` and ``easy_install``.
        Instead, use pypa/build, pypa/installer or other
        standards-based tools.

        See https://github.com/pypa/setuptools/issues/917 for details.
        ********************************************************************************

!!
  self.initialize_options()
error: can't create or remove files in install directory

The following error occurred while trying to add or remove files in the
installation directory:

    [Errno 13] Permission denied: 'C:\\Program Files\\Python312\\Lib\\site-packages\\test-easy-install-1112.write-test'

The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    C:\Program Files\Python312\Lib\site-packages\

Perhaps your account does not have write access to this directory?  If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account.  If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.

For information on other options, you may wish to consult the
documentation at:

  https://setuptools.pypa.io/en/latest/deprecated/easy_install.html

Please make the appropriate changes for your system and try again.
I think this is error is in the file. So i use pip :"pip install scons". It run normally and i type "scons --version".But it say...
'scons' is not recognized as an internal or external command,
operable program or batch file.
I was search the internet and do like it. But nothing happend.

This is my scons file:

The scons file:

And this is the error problem:

The problem

And this too:

The scons not be installed

So i delete scons by "pip uninstall scons". I download again but the is no progress. Can you help me?

Sery because i was new to stack overflow

1

There are 1 best solutions below

0
bdbaddog On

Try:

python -nSCons 

Also a really good way to install SCons (and/or any python package IMHO) is to install them in a virtualenv.. You can find instructions in our cookbook: https://scons-cookbook.readthedocs.io/en/latest/#setting-up-a-python-virtualenv-for-scons

C:\Users\user>cd Work
C:\Users\user\Work>py -m venv myvenv
C:\Users\user\Work>.\myvenv\Scripts\activate
(myvenv) C:\Users\user\Work>pip list --outdated
Package    Version Latest Type
---------- ------- ------ -----
pip        20.2.3  22.0.4 wheel
setuptools 49.2.1  62.1.0 wheel
WARNING: You are using pip version 20.2.3; however, version 22.0.4 is available.
You should consider upgrading via the 'C:\Users\user\Work\myvenv\Scripts\python.exe -m pip install --upgrade pip' command.
(myvenv) C:\Users\user\Work\myvenv\Scripts\python.exe -m pip install --upgrade pip setuptools scons
Collecting pip
  Downloading pip-22.0.4-py3-none-any.whl (2.1 MB)
Collecting setuptools
  Downloading setuptools-62.1.0-py3-none-any.whl (1.1 MB)
Collecting scons
  Downloading SCons-4.3.0-py3-none-any.whl (4.2 MB)
Installing collected packages: pip, setuptools, scons
  Attempting uninstall: pip
    Found existing installation: pip 20.2.3
    Uninstalling pip-20.2.3:
      Successfully uninstalled pip-20.2.3
  Attempting uninstall: setuptools
    Found existing installation: setuptools 49.2.1
    Uninstalling setuptools-49.2.1:
      Successfully uninstalled setuptools-49.2.1
Successfully installed pip-22.0.4 scons-4.3.0 setuptools-62.1.0
(myvenv) C:\Users\user\Work>scons --version
SCons by Steven Knight et al.:
        SCons: v4.3.0.559790274f66fa55251f5754de34820a29c7327a, Tue, 16 Nov 2021 19:09:21 +0000, by bdeegan on octodog
        SCons path: ['c:\\users\\user\\work\\myvenv\\lib\\site-packages\\SCons']
Copyright (c) 2001 - 2021 The SCons Foundation
(myvenv) C:\Users\user\Work> deactivate
C:\Users\user\Work>