通过CMD安装软件包时出错

时间:2020-08-19 08:58:30

标签: python cmd pip package

我正在尝试通过CMD(管理员,W10)安装一组软件包。

我使用了创建的文本文件requirements.txt,如下所示。

psycopg2
requests
jsonlib
os-sys
openpyxl
pandas
numpy

enter image description here

我做了一些研究,从中我发现安装psycopg2是解决方案(因此现在要添加它),但是当Installing backend dependencies时我仍然收到错误消息。我正在Admin CMD中使用pip install -r requirements.txt命令。

完整的CMD报告:

C:\Develop\Scripts>pip install -r requirements.txt
Collecting psycopg2
  Downloading psycopg2-2.8.5-cp36-cp36m-win32.whl (984 kB)
     |████████████████████████████████| 984 kB 819 kB/s
Requirement already satisfied: requests in c:\develop\lib\site-packages (from -r requirements.txt (line 2)) (2.22.0)
Collecting jsonlib
  Using cached jsonlib-1.6.1.tar.gz (43 kB)
Collecting os-sys
  Using cached os_sys-2.1.4-py3-none-any.whl (15.6 MB)
Collecting openpyxl
  Using cached openpyxl-3.0.4-py2.py3-none-any.whl (241 kB)
Collecting pandas
  Using cached pandas-1.1.0-cp36-cp36m-win32.whl (8.1 MB)
Collecting numpy
  Using cached numpy-1.19.1-cp36-cp36m-win32.whl (10.9 MB)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in c:\develop\lib\site-packages (from requests->-r requirements.txt (line 2)) (3.0.4)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in c:\develop\lib\site-packages (from requests->-r requirements.txt (line 2)) (1.25.3)
Requirement already satisfied: certifi>=2017.4.17 in c:\develop\lib\site-packages (from requests->-r requirements.txt (line 2)) (2019.6.16)
Requirement already satisfied: idna<2.9,>=2.5 in c:\develop\lib\site-packages (from requests->-r requirements.txt (line 2)) (2.8)
Collecting matplotlib
  Using cached matplotlib-3.3.1-cp36-cp36m-win32.whl (8.3 MB)
Collecting cefpython3
  Downloading cefpython3-66.0-py2.py3-none-win32.whl (64.3 MB)
     |████████████████████████████████| 64.3 MB 52 kB/s
Collecting tuspy
  Downloading tuspy-0.2.4.tar.gz (9.1 kB)
Collecting sqlparse
  Using cached sqlparse-0.3.1-py2.py3-none-any.whl (40 kB)
Collecting tornado
  Using cached tornado-6.0.4-cp36-cp36m-win32.whl (416 kB)
Collecting pyvalid
  Using cached pyvalid-0.9.2-py3-none-any.whl (8.5 kB)
Collecting psutil
  Downloading psutil-5.7.2-cp36-cp36m-win32.whl (238 kB)
     |████████████████████████████████| 238 kB 1.3 MB/s
Collecting python-dateutil<2.8,>=2.7
  Using cached python_dateutil-2.7.5-py2.py3-none-any.whl (225 kB)
Collecting pytz
  Using cached pytz-2020.1-py2.py3-none-any.whl (510 kB)
Collecting spacy==2.2.0
  Using cached spacy-2.2.0.tar.gz (5.8 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:\develop\python.exe' 'c:\develop\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\deadevil\AppData\Local\Temp\pip-build-env-dau1pejs\normal' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'murmurhash<1.1.0,>=0.28.0' 'cymem<2.1.0,>=2.0.2' 'cython>=0.25' 'preshed<3.1.0,>=3.0.2' wheel 'thinc<7.2.0,>=7.1.1'
       cwd: None
  Complete output (123 lines):
  Collecting murmurhash<1.1.0,>=0.28.0
    Downloading murmurhash-1.0.2.tar.gz (35 kB)
  Collecting cymem<2.1.0,>=2.0.2
    Downloading cymem-2.0.3.tar.gz (51 kB)
  Collecting cython>=0.25
    Using cached Cython-0.29.21-cp36-cp36m-win32.whl (1.5 MB)
  Collecting preshed<3.1.0,>=3.0.2
    Downloading preshed-3.0.2.tar.gz (167 kB)
  Collecting wheel
    Using cached wheel-0.35.1-py2.py3-none-any.whl (33 kB)
  Collecting thinc<7.2.0,>=7.1.1
    Using cached thinc-7.1.1.tar.gz (1.9 MB)
      ERROR: Command errored out with exit status 1:
       command: 'c:\develop\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\deadevil\\AppData\\Local\\Temp\\pip-install-w0prg4as\\thinc\\setup.py'"'"'; __file__='"'"'C:\\Users\\deadevil\\AppData\\Local\\Temp\\pip-install-w0prg4as\\thinc\\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\deadevil\AppData\Local\Temp\pip-pip-egg-info-hx_zwz0x'
           cwd: C:\Users\deadevil\AppData\Local\Temp\pip-install-w0prg4as\thinc\
      Complete output (105 lines):
      Processing numpy/random\_bounded_integers.pxd.in
      Processing numpy/random\bit_generator.pyx
      Traceback (most recent call last):
        File "C:\Users\deadevil\AppData\Local\Temp\easy_install-pjf6m7xq\numpy-1.19.1\tools\cythonize.py", line 59, in process_pyx
          from Cython.Compiler.Version import version as cython_version
      ModuleNotFoundError: No module named 'Cython'

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "C:\Users\deadevil\AppData\Local\Temp\easy_install-pjf6m7xq\numpy-1.19.1\tools\cythonize.py", line 235, in <module>
          main()
        File "C:\Users\deadevil\AppData\Local\Temp\easy_install-pjf6m7xq\numpy-1.19.1\tools\cythonize.py", line 231, in main
          find_process_files(root_dir)
        File "C:\Users\deadevil\AppData\Local\Temp\easy_install-pjf6m7xq\numpy-1.19.1\tools\cythonize.py", line 222, in find_process_files
          process(root_dir, fromfile, tofile, function, hash_db)
        File "C:\Users\deadevil\AppData\Local\Temp\easy_install-pjf6m7xq\numpy-1.19.1\tools\cythonize.py", line 188, in process
          processor_function(fromfile, tofile)
        File "C:\Users\deadevil\AppData\Local\Temp\easy_install-pjf6m7xq\numpy-1.19.1\tools\cythonize.py", line 64, in process_pyx
          raise OSError('Cython needs to be installed in Python as a module')
      OSError: Cython needs to be installed in Python as a module
      Running from numpy source directory.
      C:\Users\deadevil\AppData\Local\Temp\easy_install-pjf6m7xq\numpy-1.19.1\setup.py:470: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
        run_build = parse_setuppy_commands()
      Traceback (most recent call last):
        File "c:\develop\lib\site-packages\setuptools\sandbox.py", line 157, in save_modules
          yield saved
        File "c:\develop\lib\site-packages\setuptools\sandbox.py", line 198, in setup_context
          yield
        File "c:\develop\lib\site-packages\setuptools\sandbox.py", line 248, in run_setup
          DirectorySandbox(setup_dir).run(runner)
        File "c:\develop\lib\site-packages\setuptools\sandbox.py", line 278, in run
          return func()
        File "c:\develop\lib\site-packages\setuptools\sandbox.py", line 246, in runner
          _execfile(setup_script, ns)
        File "c:\develop\lib\site-packages\setuptools\sandbox.py", line 47, in _execfile
          exec(code, globals, locals)
        File "C:\Users\deadevil\AppData\Local\Temp\easy_install-pjf6m7xq\numpy-1.19.1\setup.py", line 499, in <module>
        File "C:\Users\deadevil\AppData\Local\Temp\easy_install-pjf6m7xq\numpy-1.19.1\setup.py", line 479, in setup_package
        File "C:\Users\deadevil\AppData\Local\Temp\easy_install-pjf6m7xq\numpy-1.19.1\setup.py", line 274, in generate_cython
      RuntimeError: Running cythonize failed!

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "<string>", line 1, in <module>
        File "C:\Users\deadevil\AppData\Local\Temp\pip-install-w0prg4as\thinc\setup.py", line 261, in <module>
          setup_package()
        File "C:\Users\deadevil\AppData\Local\Temp\pip-install-w0prg4as\thinc\setup.py", line 257, in setup_package
          cmdclass={"build_ext": build_ext_subclass},
        File "c:\develop\lib\distutils\core.py", line 108, in setup
          _setup_distribution = dist = klass(attrs)
        File "c:\develop\lib\site-packages\setuptools\dist.py", line 315, in __init__
          self.fetch_build_eggs(attrs['setup_requires'])
        File "c:\develop\lib\site-packages\setuptools\dist.py", line 361, in fetch_build_eggs
          replace_conflicting=True,
        File "c:\develop\lib\site-packages\pkg_resources\__init__.py", line 850, in resolve
          dist = best[req.key] = env.best_match(req, ws, installer)
        File "c:\develop\lib\site-packages\pkg_resources\__init__.py", line 1122, in best_match
          return self.obtain(req, installer)
        File "c:\develop\lib\site-packages\pkg_resources\__init__.py", line 1134, in obtain
          return installer(requirement)
        File "c:\develop\lib\site-packages\setuptools\dist.py", line 429, in fetch_build_egg
          return cmd.easy_install(req)
        File "c:\develop\lib\site-packages\setuptools\command\easy_install.py", line 665, in easy_install
          return self.install_item(spec, dist.location, tmpdir, deps)
        File "c:\develop\lib\site-packages\setuptools\command\easy_install.py", line 695, in install_item
          dists = self.install_eggs(spec, download, tmpdir)
        File "c:\develop\lib\site-packages\setuptools\command\easy_install.py", line 876, in install_eggs
          return self.build_and_install(setup_script, setup_base)
        File "c:\develop\lib\site-packages\setuptools\command\easy_install.py", line 1115, in build_and_install
          self.run_setup(setup_script, setup_base, args)
        File "c:\develop\lib\site-packages\setuptools\command\easy_install.py", line 1101, in run_setup
          run_setup(setup_script, args)
        File "c:\develop\lib\site-packages\setuptools\sandbox.py", line 251, in run_setup
          raise
        File "c:\develop\lib\contextlib.py", line 99, in __exit__
          self.gen.throw(type, value, traceback)
        File "c:\develop\lib\site-packages\setuptools\sandbox.py", line 198, in setup_context
          yield
        File "c:\develop\lib\contextlib.py", line 99, in __exit__
          self.gen.throw(type, value, traceback)
        File "c:\develop\lib\site-packages\setuptools\sandbox.py", line 169, in save_modules
          saved_exc.resume()
        File "c:\develop\lib\site-packages\setuptools\sandbox.py", line 144, in resume
          six.reraise(type, exc, self._tb)
        File "c:\develop\lib\site-packages\pkg_resources\_vendor\six.py", line 685, in reraise
          raise value.with_traceback(tb)
        File "c:\develop\lib\site-packages\setuptools\sandbox.py", line 157, in save_modules
          yield saved
        File "c:\develop\lib\site-packages\setuptools\sandbox.py", line 198, in setup_context
          yield
        File "c:\develop\lib\site-packages\setuptools\sandbox.py", line 248, in run_setup
          DirectorySandbox(setup_dir).run(runner)
        File "c:\develop\lib\site-packages\setuptools\sandbox.py", line 278, in run
          return func()
        File "c:\develop\lib\site-packages\setuptools\sandbox.py", line 246, in runner
          _execfile(setup_script, ns)
        File "c:\develop\lib\site-packages\setuptools\sandbox.py", line 47, in _execfile
          exec(code, globals, locals)
        File "C:\Users\deadevil\AppData\Local\Temp\easy_install-pjf6m7xq\numpy-1.19.1\setup.py", line 499, in <module>
        File "C:\Users\deadevil\AppData\Local\Temp\easy_install-pjf6m7xq\numpy-1.19.1\setup.py", line 479, in setup_package
        File "C:\Users\deadevil\AppData\Local\Temp\easy_install-pjf6m7xq\numpy-1.19.1\setup.py", line 274, in generate_cython
      RuntimeError: Running cythonize failed!
      Cythonizing sources
      ----------------------------------------
  ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\develop\python.exe' 'c:\develop\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\deadevil\AppData\Local\Temp\pip-build-env-dau1pejs\normal' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'murmurhash<1.1.0,>=0.28.0' 'cymem<2.1.0,>=2.0.2' 'cython>=0.25' 'preshed<3.1.0,>=3.0.2' wheel 'thinc<7.2.0,>=7.1.1' Check the logs for full command output.

任何人都可以提供帮助,以及如何解决?

1 个答案:

答案 0 :(得分:0)

尝试一下:

BEGIN
     Declare @Value varchar(50)
     SET @Value = NULL
     SELECT * from TestTable where Value = IIF(@Value is NULL,Value,@Value)
    END