2013-02-16 9 views
5

Windows 7でPython 2.7にSCons 2.2.0をインストールしました。cmdから実行したときに "sconsが認識されず、内部コマンドまたは外部コマンド"どうすればこの問題を解決できますか?Windows 7でScons 2.2.0を実行するcmd


問題はscons-2.2.0です。setup.exeはシステムにパスを設定しません。 scons.batとscons-2.2.0.batはどちらも "C:/ Python27/Scripts"フォルダにあります。これをパスに設定すると問題は解決します。コンパイルしようとすると、メッセージ "cl"を含む単純なC++ファイルが内部コマンドまたは外部コマンドとして認識されないという新たな問題が発生しました。 (Windows 7 64ビット)。あなたのアイデアが参考になるかもしれません。

答えて

6

SCons windows installerを使用してインストールしましたか?それはあなたのためにすべてを設定する必要があります。

  • C:\ Python25 \スクリプト
  • C:SCons installation instructionsによると、SConsは、ここでインストールする必要があります

    あなたの場合は、\ Python25 \ sconsの

、とc:\Python25を置き換えますあなたのpythong 2.7インストールの場所。

また、SCons pythonスクリプトがパスに含まれていることを確認してください。パスの変更を有効にするには、cmdを再起動する必要があります。

+0

私はsconsのsconsの-2.2.0-setup.exeをWindows用を持って、それは私と私のためのパスを設定することはありませんそのパスに実行可能な特定のsconsを見つけることができません! – Amani

+0

リンクは機能しません(これ以上)。一般的なダウンロードページ:http://www.scons.org/download.php – Geier

1

clを使用するには、Visual Studioコマンドラインを使用してそこからscons、その.batファイル、およびPythonインストールのscriptsフォルダを実行する必要があります。私が最近自分で行ったように、あなたのパスにスクリプトを置くことで解決するはずです。

0

私は2つの最新バージョン(3.0.0と3.0.1)をインストールしました。

同じ問題、多分

  1. ため、WindowsインストーラはC内を設置するためのPythonを探していました:/プログラムファイル...、それが唯一ののPython 3.xのを発見した可能性が(互換性がありません)

  2. setup.pyには小さな問題があります。

とにかく、以下の解決策がありました。Pythonインストールディレクトリにpython setup.py install

  • 行くと

    1. インストール
    2. サブフォルダに次のファイル(またはその両方)のいずれかに置くスクリプト

      • scons.batあなたがからsconsのを実行した場合cmd
      • sconsあなたはMSYSまたはのCygwinからsconsの

    を実行する場合、私はこれらの2つのスクリプト(.batは、ソースの一部であったと.shはそこからインスピレーションを得てきた)のコードの下に入れています。

    ファイル<Python_dir>/Scripts/scons.bat

    @REM Copyright (c) 2001 - 2017 The SCons Foundation 
    @REM src/script/scons.bat rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog 
    @echo off 
    set SCONS_ERRORLEVEL= 
    if "%OS%" == "Windows_NT" goto WinNT 
    
    @REM for 9x/Me you better not have more than 9 args 
    python -c "from os.path import join; import sys; sys.path = [ join(sys.prefix, 'Lib', 'site-packages', 'scons-3.0.0'), join(sys.prefix, 'Lib', 'site-packages', 'scons'), join(sys.prefix, 'scons-3.0.0'), join(sys.prefix, 'scons')] + sys.path; import SCons.Script; SCons.Script.main()" %1 %2 %3 %4 %5 %6 %7 %8 %9 
    @REM no way to set exit status of this script for 9x/Me 
    goto endscons 
    
    @REM Credit where credit is due: we return the exit code despite our 
    @REM use of setlocal+endlocal using a technique from Bear's Journal: 
    @REM http://code-bear.com/bearlog/2007/06/01/getting-the-exit-code-from-a-batch-file-that-is-run-from-a-python-program/ 
    
    :WinNT 
    setlocal 
    @REM ensure the script will be executed with the Python it was installed for 
    set path=%~dp0;%~dp0..;%path% 
    @REM try the script named as the .bat file in current dir, then in Scripts subdir 
    set scriptname=%~dp0%~n0.py 
    if not exist "%scriptname%" set scriptname=%~dp0Scripts\%~n0.py 
    python "%scriptname%" %* 
    endlocal & set SCONS_ERRORLEVEL=%ERRORLEVEL% 
    
    if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto returncode 
    if errorlevel 9009 echo you do not have python in your PATH 
    goto endscons 
    
    :returncode 
    exit /B %SCONS_ERRORLEVEL% 
    
    :endscons 
    call :returncode %SCONS_ERRORLEVEL% 
    

    そのページからファイル<Python_dir>/Scripts/scons

    #!/bin/bash 
    
    # Script to launch scons from MSys or Cygwin 
    # Inspired by scons.bat delivered with SCons 
    
    # Ensure the script will be executed with the Python it was installed for 
    BASEDIR=$(dirname "$0") 
    PATH="$BASEDIR:$BASEDIR/..:$PATH" 
    
    # Try the script named as the .bat file in current dir, then in Scripts subdir 
    BASENAME=$(basename "$0") 
    SCRIPT=${BASENAME%.*} 
    SCRIPTNAME="$BASEDIR/$SCRIPT.py" 
    if ! [ -f "$SCRIPTNAME" ]; then 
        SCRIPTNAME="$BASEDIR/Scripts/$SCRIPT.py" 
    fi 
    
    # Run 
    python "$SCRIPTNAME" [email protected] 
    SCONS_ERRORLEVEL=$? 
    
    # Check error code 
    if [ SCONS_ERRORLEVEL == 9009 ]; then 
        echo "You do not have python in your PATH" 
    fi 
    
    # End 
    exit $SCONS_ERRORLEVEL 
    
  • 関連する問題