Python pip安装“错误:命令错误,退出状态为1”

时间:2020-05-01 22:32:44

标签: python pip

我正在尝试pip install telewavesim(遵循说明here),但出现此错误。我正在Windows 10上运行它。

我搜索了一个答案,并尝试以管理员身份运行,但得到了同样的错误。我也尝试过

pip install --upgrade setuptools
pip install ez_setup

仍然出现相同的错误。

有什么想法吗?

 ERROR: Command errored out with exit status 1:
      command: 'C:\Users\ckh_000\anaconda3\envs\tws\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] =
 '"'"'C:\\Users\\CKH_~1\\AppData\\Local\\Temp\\pip-install-ax5p37i5\\telewavesim\\setup.py'"'"';
 __file__='"'"'C:\\Users\\CKH_~1\\AppData\\Local\\Temp\\pip-install-ax5p37i5\\telewavesim\\setup.py'"'"';f=getattr(tokenize,
 '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"',
 '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))'
 egg_info --egg-base
 'C:\Users\CKH_~1\AppData\Local\Temp\pip-pip-egg-info-zfutbqc4'

 cwd: C:\Users\CKH_~1\AppData\Local\Temp\pip-install-ax5p37i5\telewavesim\

 Complete output (11 lines):

 C:\Users\ckh_000\anaconda3\envs\tws\lib\site-packages\numpy\distutils\system_info.py:811:
 UserWarning: Specified path
 D:\bld\numpy_1584937762393\_h_env\Library\lib is invalid.
return self.get_paths(self.section, key)

Traceback (most recent call last):

File "<string>", line 1, in <module>

File "C:\Users\CKH_~1\AppData\Local\Temp\pip-install-ax5p37i5\telewavesim\setup.py",
 line 23, in <module>
version=find_version('telewavesim', '__init__.py'),

File "C:\Users\CKH_~1\AppData\Local\Temp\pip-install-ax5p37i5\telewavesim\setup.py",
 line 9, in find_version

code = fp.read()

File "C:\Users\ckh_000\anaconda3\envs\tws\lib\encodings\cp1252.py", line
 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]

UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 7522: character maps to <undefined>

---------------------------------------- ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for
 full command output.

编辑:

这是我尝试从源代码安装时的结果。 我看到了有关fortran编译器的错误-我确实安装了gfortran。该网站说“我在上面的conda环境调用中添加了fortran-compiler程序包”,但我试图这样做不正确。我只是将fortran-compiler添加到-c标志,但这似乎不起作用。

Processing c:\users\ckh_000\documents\telewavesim
Requirement already satisfied: numpy>=1.15 in c:\users\ckh_000\anaconda3\lib\site-packages (from telewavesim==0.2.0) (1.18.1)
Collecting obspy>=1.0.0
  Downloading obspy-1.2.1-cp37-cp37m-win_amd64.whl (21.7 MB)
     |████████████████████████████████| 21.7 MB 40 kB/s
Requirement already satisfied: matplotlib in c:\users\ckh_000\anaconda3\lib\site-packages (from telewavesim==0.2.0) (3.1.3)
Requirement already satisfied: decorator in c:\users\ckh_000\anaconda3\lib\site-packages (from obspy>=1.0.0->telewavesim==0.2.0) (4.4.1)
Requirement already satisfied: setuptools in c:\users\ckh_000\anaconda3\lib\site-packages (from obspy>=1.0.0->telewavesim==0.2.0) (46.1.3)
Requirement already satisfied: future>=0.12.4 in c:\users\ckh_000\anaconda3\lib\site-packages (from obspy>=1.0.0->telewavesim==0.2.0) (0.18.2)
Requirement already satisfied: scipy>=0.9.0 in c:\users\ckh_000\anaconda3\lib\site-packages (from obspy>=1.0.0->telewavesim==0.2.0) (1.4.1)
Requirement already satisfied: lxml in c:\users\ckh_000\anaconda3\lib\site-packages (from obspy>=1.0.0->telewavesim==0.2.0) (4.5.0)
Requirement already satisfied: sqlalchemy in c:\users\ckh_000\anaconda3\lib\site-packages (from obspy>=1.0.0->telewavesim==0.2.0) (1.3.13)
Requirement already satisfied: requests in c:\users\ckh_000\anaconda3\lib\site-packages (from obspy>=1.0.0->telewavesim==0.2.0) (2.22.0)
Requirement already satisfied: kiwisolver>=1.0.1 in c:\users\ckh_000\anaconda3\lib\site-packages (from matplotlib->telewavesim==0.2.0) (1.1.0)
Requirement already satisfied: cycler>=0.10 in c:\users\ckh_000\anaconda3\lib\site-packages (from matplotlib->telewavesim==0.2.0) (0.10.0)
Requirement already satisfied: python-dateutil>=2.1 in c:\users\ckh_000\anaconda3\lib\site-packages (from matplotlib->telewavesim==0.2.0) (2.8.1)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in c:\users\ckh_000\anaconda3\lib\site-packages (from matplotlib->telewavesim==0.2.0) (2.4.6)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\ckh_000\anaconda3\lib\site-packages (from requests->obspy>=1.0.0->telewavesim==0.2.0) (2019.11.28)
Requirement already satisfied: idna<2.9,>=2.5 in c:\users\ckh_000\anaconda3\lib\site-packages (from requests->obspy>=1.0.0->telewavesim==0.2.0) (2.8)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in c:\users\ckh_000\anaconda3\lib\site-packages (from requests->obspy>=1.0.0->telewavesim==0.2.0) (3.0.4)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in c:\users\ckh_000\anaconda3\lib\site-packages (from requests->obspy>=1.0.0->telewavesim==0.2.0) (1.25.8)
Requirement already satisfied: six in c:\users\ckh_000\anaconda3\lib\site-packages (from cycler>=0.10->matplotlib->telewavesim==0.2.0) (1.14.0)
Building wheels for collected packages: telewavesim
  Building wheel for telewavesim (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\ckh_000\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ckh_~1\\AppData\\Local\\Temp\\pip-req-build-_0kjatmr\\setup.py'"'"'; __file__='"'"'C:\\Users\\ckh_~1\\AppData\\Local\\Temp\\pip-req-build-_0kjatmr\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\ckh_~1\AppData\Local\Temp\pip-wheel-8qv0f5f7'
       cwd: C:\Users\ckh_~1\AppData\Local\Temp\pip-req-build-_0kjatmr\
  Complete output (55 lines):
  Could not locate executable g77
  Could not locate executable f77
  Could not locate executable ifort
  Could not locate executable ifl
  Could not locate executable f90
  Could not locate executable DF
  Could not locate executable efl
  Could not locate executable gfortran
  Could not locate executable f95
  Could not locate executable g95
  Could not locate executable efort
  Could not locate executable efc
  Could not locate executable flang
  don't know how to compile Fortran code on platform 'nt'
  C:\Users\ckh_000\anaconda3\lib\site-packages\numpy\distutils\system_info.py:1730: 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.
    return getattr(self, '_calc_info_{}'.format(name))()
  C:\Users\ckh_000\anaconda3\lib\site-packages\numpy\distutils\system_info.py:1730: 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.
    return getattr(self, '_calc_info_{}'.format(name))()
  C:\Users\ckh_000\anaconda3\lib\site-packages\numpy\distutils\system_info.py:471: 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.
    return cl().get_info(notfound_action)
  running bdist_wheel
  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 extension "telewavesim.rmat_f" sources
  f2py options: []
    adding 'build\src.win-amd64-3.7\build\src.win-amd64-3.7\telewavesim\fortranobject.c' to sources.
    adding 'build\src.win-amd64-3.7\build\src.win-amd64-3.7\telewavesim' to include_dirs.
    adding 'build\src.win-amd64-3.7\telewavesim\rmat_f-f2pywrappers2.f90' to sources.
  build_src: building npy-pkg config files
  running build_py
  running build_ext
  No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
  customize MSVCCompiler
  customize MSVCCompiler using build_ext
  warning: build_ext: f77_compiler=None is not available.

  building 'telewavesim.rmat_f' extension
  error: extension 'telewavesim.rmat_f' has Fortran sources but no Fortran compiler found
  ----------------------------------------
  ERROR: Failed building wheel for telewavesim
  Running setup.py clean for telewavesim
Failed to build telewavesim
Installing collected packages: obspy, telewavesim
    Running setup.py install for telewavesim ... error
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\ckh_000\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ckh_~1\\AppData\\Local\\Temp\\pip-req-build-_0kjatmr\\setup.py'"'"'; __file__='"'"'C:\\Users\\ckh_~1\\AppData\\Local\\Temp\\pip-req-build-_0kjatmr\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\ckh_~1\AppData\Local\Temp\pip-record-_oy46s3d\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\ckh_000\anaconda3\Include\telewavesim'
         cwd: C:\Users\ckh_~1\AppData\Local\Temp\pip-req-build-_0kjatmr\
    Complete output (78 lines):
    Could not locate executable g77
    Could not locate executable f77
    Could not locate executable ifort
    Could not locate executable ifl
    Could not locate executable f90
    Could not locate executable DF
    Could not locate executable efl
    Could not locate executable gfortran
    Could not locate executable f95
    Could not locate executable g95
    Could not locate executable efort
    Could not locate executable efc
    Could not locate executable flang
    don't know how to compile Fortran code on platform 'nt'
    C:\Users\ckh_000\anaconda3\lib\site-packages\numpy\distutils\system_info.py:1730: 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.
      return getattr(self, '_calc_info_{}'.format(name))()
    C:\Users\ckh_000\anaconda3\lib\site-packages\numpy\distutils\system_info.py:1730: 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.
      return getattr(self, '_calc_info_{}'.format(name))()
    C:\Users\ckh_000\anaconda3\lib\site-packages\numpy\distutils\system_info.py:471: 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.
      return cl().get_info(notfound_action)
    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 extension "telewavesim.rmat_f" sources
    f2py options: []
      adding 'build\src.win-amd64-3.7\build\src.win-amd64-3.7\telewavesim\fortranobject.c' to sources.
      adding 'build\src.win-amd64-3.7\build\src.win-amd64-3.7\telewavesim' to include_dirs.
      adding 'build\src.win-amd64-3.7\telewavesim\rmat_f-f2pywrappers2.f90' to sources.
    build_src: building npy-pkg config files
    running build_py
    creating build\lib.win-amd64-3.7
    creating build\lib.win-amd64-3.7\telewavesim
    copying telewavesim\doc.py -> build\lib.win-amd64-3.7\telewavesim
    copying telewavesim\elast.py -> build\lib.win-amd64-3.7\telewavesim
    copying telewavesim\utils.py -> build\lib.win-amd64-3.7\telewavesim
    copying telewavesim\wiggle.py -> build\lib.win-amd64-3.7\telewavesim
    copying telewavesim\__init__.py -> build\lib.win-amd64-3.7\telewavesim
    creating build\lib.win-amd64-3.7\telewavesim\tests
    copying telewavesim\tests\test_0_imports.py -> build\lib.win-amd64-3.7\telewavesim\tests
    copying telewavesim\tests\test_notebooks.py -> build\lib.win-amd64-3.7\telewavesim\tests
    copying telewavesim\tests\test_routines.py -> build\lib.win-amd64-3.7\telewavesim\tests
    copying telewavesim\tests\test_utils.py -> build\lib.win-amd64-3.7\telewavesim\tests
    copying telewavesim\tests\__init__.py -> build\lib.win-amd64-3.7\telewavesim\tests
    creating build\lib.win-amd64-3.7\telewavesim\examples
    copying telewavesim\examples\0-Start-Here.ipynb -> build\lib.win-amd64-3.7\telewavesim\examples
    creating build\lib.win-amd64-3.7\telewavesim\examples\models
    copying telewavesim\examples\models\model_Audet2016.txt -> build\lib.win-amd64-3.7\telewavesim\examples\models
    copying telewavesim\examples\models\model_Porter2011.txt -> build\lib.win-amd64-3.7\telewavesim\examples\models
    copying telewavesim\examples\models\model_SKS.txt -> build\lib.win-amd64-3.7\telewavesim\examples\models
    creating build\lib.win-amd64-3.7\telewavesim\examples\Notebooks
    copying telewavesim\examples\Notebooks\sim_obs_Audet2016.ipynb -> build\lib.win-amd64-3.7\telewavesim\examples\Notebooks
    copying telewavesim\examples\Notebooks\sim_Prfs_Porter2011.ipynb -> build\lib.win-amd64-3.7\telewavesim\examples\Notebooks
    copying telewavesim\examples\Notebooks\sim_SKS.ipynb -> build\lib.win-amd64-3.7\telewavesim\examples\Notebooks
    running build_ext
    No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
    customize MSVCCompiler
    customize MSVCCompiler using build_ext
    warning: build_ext: f77_compiler=None is not available.

    building 'telewavesim.rmat_f' extension
    error: extension 'telewavesim.rmat_f' has Fortran sources but no Fortran compiler found
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\ckh_000\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ckh_~1\\AppData\\Local\\Temp\\pip-req-build-_0kjatmr\\setup.py'"'"'; __file__='"'"'C:\\Users\\ckh_~1\\AppData\\Local\\Temp\\pip-req-build-_0kjatmr\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\ckh_~1\AppData\Local\Temp\pip-record-_oy46s3d\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\ckh_000\anaconda3\Include\telewavesim' Check the logs for full command output.

0 个答案:

没有答案