简体   繁体   中英

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

I have a project that requires the installation of numpy.

I downloaded Python 2.7.11 just this morning to my windows 10 computer, and have not used pip or anything else in the 2.7.11 installation since downloading.

I have not moved any files in the installation 2.7.11.

I opened command prompt and typed

pip install numpy

and got the error:

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

Next, I put:

cd C:\Python27\Scripts

into command prompt. It went, and again I typed:

pip install numpy

And it worked for a while, downloading numpy without an issue. Then:

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

This is actually when I retried the install, which is why at the beginning it says "using cached numpy-1.10.2.tar.gz"

I have no idea what all that error means, but I saw an article somewhere (in a place I can't re-find, so I can't give the link) that said to install pip by typing into command prompt:

python get-pip.py

or something along those lines.(As I said, can't re-find that article)

and got this error:

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

Any help would be great! If you had a way to download numpy without pip that would be great, but I have a few other modules I'd need to get and I'd really like to get pip working. Also, I have extremely bad internet and it would helpful to avoid large file downloads.

Thanks

There are 3 ways to solve this.

  1. You forgot to do C:/Python27/python get-pip.py . You remembered to do that for pip , but you gave up on python get-pip.py .

  2. Also, you need C++, which it said on the last line of your error. 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 . As it says so, get Visual C++. Pip cannot work without it.

  3. If you get bothered by always typing C:/Python27/python and C:/Python27/Scripts/pip , Edit your PATH environment variable. You can Google that. Once you are in, type in your directories (eg C:/Python27/python ). All directories are separated by a semicolon.

If this helped at all, add a +1!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM