簡體   English   中英

Python Pip安裝:在命令提示符窗口中未被識別為批處理文件…

[英]Python Pip installion: not recognised as a batch file… in command prompt windows

我有一個項目,需要安裝numpy。

我今天早上才將Python 2.7.11下載到我的Windows 10計算機上,並且自下載以來沒有在2.7.11安裝中使用pip或其他任何東西。

我沒有在安裝2.7.11中移動任何文件。

我打開命令提示符並鍵入

pip install numpy

並得到錯誤:

 pip is not recognized as an internal or external command, operable program or batch file

接下來,我輸入:

cd C:\Python27\Scripts

進入命令提示符。 它過去了,我再次鍵入:

pip install numpy

而且它工作了一段時間,下載numpy沒有問題。 然后:

C:\Python27\Scripts>pip install numpy
Collecting numpy
  Using cached numpy-1.10.2.tar.gz
Installing collected packages: numpy
  Running setup.py install for numpy
    Complete output from command c:\python27\python.exe -c "import setuptools, tokenize;__file__='c:\\users\\goerge\\appdata\\local\\temp\\pip-build-fj7fw1\\numpy\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\goerge\appdata\local\temp\pip-duza5s-record\install-record.txt --single-version-externally-managed --compile:
    blas_opt_info:
    blas_mkl_info:
      libraries mkl,vml,guide not found in ['c:\\python27\\lib', 'C:\\', 'c:\\python27\\libs']
      NOT AVAILABLE
openblas_info:
  libraries openblas not found in ['c:\\python27\\lib', 'C:\\', 'c:\\python27\\libs']
  NOT AVAILABLE

atlas_3_10_blas_threads_info:
Setting PTATLAS=ATLAS
  libraries tatlas not found in ['c:\\python27\\lib', 'C:\\', 'c:\\python27\\libs']
  NOT AVAILABLE

atlas_3_10_blas_info:
  libraries satlas not found in ['c:\\python27\\lib', 'C:\\', 'c:\\python27\\libs']
  NOT AVAILABLE

atlas_blas_threads_info:
Setting PTATLAS=ATLAS
  libraries ptf77blas,ptcblas,atlas not found in ['c:\\python27\\lib', 'C:\\', 'c:\\python27\\libs']
  NOT AVAILABLE

atlas_blas_info:
  libraries f77blas,cblas,atlas not found in ['c:\\python27\\lib', 'C:\\', 'c:\\python27\\libs']
  NOT AVAILABLE

blas_info:
  libraries blas not found in ['c:\\python27\\lib', 'C:\\', 'c:\\python27\\libs']
  NOT AVAILABLE

blas_src_info:
  NOT AVAILABLE

  NOT AVAILABLE

non-existing path in 'numpy\\distutils': 'site.cfg'
F2PY Version 2
lapack_opt_info:
openblas_lapack_info:
  libraries openblas not found in ['c:\\python27\\lib', 'C:\\', 'c:\\python27\\libs']
  NOT AVAILABLE

lapack_mkl_info:
mkl_info:
  libraries mkl,vml,guide not found in ['c:\\python27\\lib', 'C:\\', 'c:\\python27\\libs']
  NOT AVAILABLE

  NOT AVAILABLE

atlas_3_10_threads_info:
Setting PTATLAS=ATLAS
  libraries tatlas,tatlas not found in c:\python27\lib
  libraries lapack_atlas not found in c:\python27\lib
  libraries tatlas,tatlas not found in C:\
  libraries lapack_atlas not found in C:\
  libraries tatlas,tatlas not found in c:\python27\libs
  libraries lapack_atlas not found in c:\python27\libs
<class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
  NOT AVAILABLE

atlas_3_10_info:
  libraries satlas,satlas not found in c:\python27\lib
  libraries lapack_atlas not found in c:\python27\lib
  libraries satlas,satlas not found in C:\
  libraries lapack_atlas not found in C:\
  libraries satlas,satlas not found in c:\python27\libs
  libraries lapack_atlas not found in c:\python27\libs
<class 'numpy.distutils.system_info.atlas_3_10_info'>
  NOT AVAILABLE

atlas_threads_info:
Setting PTATLAS=ATLAS
  libraries ptf77blas,ptcblas,atlas not found in c:\python27\lib
  libraries lapack_atlas not found in c:\python27\lib
  libraries ptf77blas,ptcblas,atlas not found in C:\
  libraries lapack_atlas not found in C:\
  libraries ptf77blas,ptcblas,atlas not found in c:\python27\libs
  libraries lapack_atlas not found in c:\python27\libs
<class 'numpy.distutils.system_info.atlas_threads_info'>
  NOT AVAILABLE

atlas_info:
  libraries f77blas,cblas,atlas not found in c:\python27\lib
  libraries lapack_atlas not found in c:\python27\lib
  libraries f77blas,cblas,atlas not found in C:\
  libraries lapack_atlas not found in C:\
  libraries f77blas,cblas,atlas not found in c:\python27\libs
  libraries lapack_atlas not found in c:\python27\libs
<class 'numpy.distutils.system_info.atlas_info'>
  NOT AVAILABLE

lapack_info:
  libraries lapack not found in ['c:\\python27\\lib', 'C:\\', 'c:\\python27\\libs']
  NOT AVAILABLE

lapack_src_info:
  NOT AVAILABLE

  NOT AVAILABLE

running install
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_src
build_src
building py_modules sources
creating build
creating build\src.win32-2.7
creating build\src.win32-2.7\numpy
creating build\src.win32-2.7\numpy\distutils
building library "npymath" sources
Running from numpy source directory.
c:\users\goerge\appdata\local\temp\pip-build-fj7fw1\numpy\numpy\distutils\system_info.py:1651: UserWarning:
    Atlas (http://math-atlas.sourceforge.net/) libraries not found.
    Directories to search for the libraries can be specified in the
    numpy/distutils/site.cfg file (section [atlas]) or by setting
    the ATLAS environment variable.
  warnings.warn(AtlasNotFoundError.__doc__)
c:\users\goerge\appdata\local\temp\pip-build-fj7fw1\numpy\numpy\distutils\system_info.py:1660: UserWarning:
    Blas (http://www.netlib.org/blas/) libraries not found.
    Directories to search for the libraries can be specified in the
    numpy/distutils/site.cfg file (section [blas]) or by setting
    the BLAS environment variable.
  warnings.warn(BlasNotFoundError.__doc__)
c:\users\goerge\appdata\local\temp\pip-build-fj7fw1\numpy\numpy\distutils\system_info.py:1663: UserWarning:
    Blas (http://www.netlib.org/blas/) sources not found.
    Directories to search for the sources can be specified in the
    numpy/distutils/site.cfg file (section [blas_src]) or by setting
    the BLAS_SRC environment variable.
  warnings.warn(BlasSrcNotFoundError.__doc__)
c:\users\goerge\appdata\local\temp\pip-build-fj7fw1\numpy\numpy\distutils\system_info.py:1552: UserWarning:
    Atlas (http://math-atlas.sourceforge.net/) libraries not found.
    Directories to search for the libraries can be specified in the
    numpy/distutils/site.cfg file (section [atlas]) or by setting
    the ATLAS environment variable.
  warnings.warn(AtlasNotFoundError.__doc__)
c:\users\goerge\appdata\local\temp\pip-build-fj7fw1\numpy\numpy\distutils\system_info.py:1563: UserWarning:
    Lapack (http://www.netlib.org/lapack/) libraries not found.
    Directories to search for the libraries can be specified in the
    numpy/distutils/site.cfg file (section [lapack]) or by setting
    the LAPACK environment variable.
  warnings.warn(LapackNotFoundError.__doc__)
c:\users\goerge\appdata\local\temp\pip-build-fj7fw1\numpy\numpy\distutils\system_info.py:1566: UserWarning:
    Lapack (http://www.netlib.org/lapack/) sources not found.
    Directories to search for the sources can be specified in the
    numpy/distutils/site.cfg file (section [lapack_src]) or by setting
    the LAPACK_SRC environment variable.
  warnings.warn(LapackSrcNotFoundError.__doc__)
c:\python27\lib\distutils\dist.py:267: UserWarning: Unknown distribution option: 'define_macros'
  warnings.warn(msg)
error: Microsoft Visual C++ 9.0 is required (Unable to find vcvarsall.bat). Get it from http://aka.ms/vcpython27

----------------------------------------
Command "c:\python27\python.exe -c "import setuptools, tokenize;__file__='c:\\users\\goerge\\appdata\\local\\temp\\pip-build-fj7fw1\\numpy\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\goerge\appdata\local\temp\pip-duza5s-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\goerge\appdata\local\temp\pip-build-fj7fw1\numpy

這實際上是我重試安裝的時間,這就是為什么一開始它說“使用緩存的numpy-1.10.2.tar.gz”的原因

我不知道所有的錯誤是什么意思,但是我在某處(無法找到的地方,所以我無法給出鏈接)看到一篇文章,該文章說通過在命令提示符下鍵入來安裝pip:

python get-pip.py

或類似的內容。(正如我所說,無法重新找到該文章)

並得到此錯誤:

"python" is not recognized as an internal or external command, operable program or batch file

任何幫助將是巨大的! 如果您有一種無需點子即可下載numpy的方法,那就太好了,但是我還需要獲取其他一些模塊,我真的很想讓點子開始工作。 另外,我的互聯網非常糟糕,這有助於避免下載大文件。

謝謝

有3種方法可以解決此問題。

  1. 您忘記了執行C:/Python27/python get-pip.py 您記得為pip這樣做,但是您放棄了python get-pip.py

  2. 另外,您需要C ++,它在錯誤的最后一行說。 error: Microsoft Visual C++ 9.0 is required (Unable to find vcvarsall.bat). Get it from http://aka.ms/vcpython27 error: Microsoft Visual C++ 9.0 is required (Unable to find vcvarsall.bat). Get it from http://aka.ms/vcpython27 如此說來,請獲取Visual C ++。 沒有它,點子就無法工作。

  3. 如果總是輸入C:/Python27/pythonC:/Python27/Scripts/pip您,請編輯PATH環境變量。 你可以谷歌。 進入后,輸入目錄(例如C:/Python27/python )。 所有目錄都用分號分隔。

如果這完全有幫助,請添加+1!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM