Ошибка при установке пакетов через CMD

#python #cmd #pip #package

#python #cmd #pip #пакет

Вопрос:

Я пытаюсь установить набор пакетов через CMD (Admin, W10).

Я использовал созданный текстовый файл requirements.txt , показанный ниже.

 psycopg2
requests
jsonlib
os-sys
openpyxl
pandas
numpy
  

введите описание изображения здесь

Я провел небольшое исследование, и из него я понял, что установка psycopg2 была решением (следовательно, почему оно добавлено сейчас), но я все еще получаю сообщение об ошибке, когда Installing backend dependencies . Я использую pip install -r requirements.txt команду в Admin CMD.

Полный отчет CMD:

 C:DevelopScripts>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:developlibsite-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:developlibsite-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:developlibsite-packages (from requests->-r requirements.txt (line 2)) (1.25.3)
Requirement already satisfied: certifi>=2017.4.17 in c:developlibsite-packages (from requests->-r requirements.txt (line 2)) (2019.6.16)
Requirement already satisfied: idna<2.9,>=2.5 in c:developlibsite-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:developpython.exe' 'c:developlibsite-packagespip' install --ignore-installed --no-user --prefix 'C:UsersdeadevilAppDataLocalTemppip-build-env-dau1pejsnormal' --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:developpython.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('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:UsersdeadevilAppDataLocalTemppip-pip-egg-info-hx_zwz0x'
           cwd: C:UsersdeadevilAppDataLocalTemppip-install-w0prg4asthinc
      Complete output (105 lines):
      Processing numpy/random_bounded_integers.pxd.in
      Processing numpy/randombit_generator.pyx
      Traceback (most recent call last):
        File "C:UsersdeadevilAppDataLocalTempeasy_install-pjf6m7xqnumpy-1.19.1toolscythonize.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:UsersdeadevilAppDataLocalTempeasy_install-pjf6m7xqnumpy-1.19.1toolscythonize.py", line 235, in <module>
          main()
        File "C:UsersdeadevilAppDataLocalTempeasy_install-pjf6m7xqnumpy-1.19.1toolscythonize.py", line 231, in main
          find_process_files(root_dir)
        File "C:UsersdeadevilAppDataLocalTempeasy_install-pjf6m7xqnumpy-1.19.1toolscythonize.py", line 222, in find_process_files
          process(root_dir, fromfile, tofile, function, hash_db)
        File "C:UsersdeadevilAppDataLocalTempeasy_install-pjf6m7xqnumpy-1.19.1toolscythonize.py", line 188, in process
          processor_function(fromfile, tofile)
        File "C:UsersdeadevilAppDataLocalTempeasy_install-pjf6m7xqnumpy-1.19.1toolscythonize.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:UsersdeadevilAppDataLocalTempeasy_install-pjf6m7xqnumpy-1.19.1setup.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:developlibsite-packagessetuptoolssandbox.py", line 157, in save_modules
          yield saved
        File "c:developlibsite-packagessetuptoolssandbox.py", line 198, in setup_context
          yield
        File "c:developlibsite-packagessetuptoolssandbox.py", line 248, in run_setup
          DirectorySandbox(setup_dir).run(runner)
        File "c:developlibsite-packagessetuptoolssandbox.py", line 278, in run
          return func()
        File "c:developlibsite-packagessetuptoolssandbox.py", line 246, in runner
          _execfile(setup_script, ns)
        File "c:developlibsite-packagessetuptoolssandbox.py", line 47, in _execfile
          exec(code, globals, locals)
        File "C:UsersdeadevilAppDataLocalTempeasy_install-pjf6m7xqnumpy-1.19.1setup.py", line 499, in <module>
        File "C:UsersdeadevilAppDataLocalTempeasy_install-pjf6m7xqnumpy-1.19.1setup.py", line 479, in setup_package
        File "C:UsersdeadevilAppDataLocalTempeasy_install-pjf6m7xqnumpy-1.19.1setup.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:UsersdeadevilAppDataLocalTemppip-install-w0prg4asthincsetup.py", line 261, in <module>
          setup_package()
        File "C:UsersdeadevilAppDataLocalTemppip-install-w0prg4asthincsetup.py", line 257, in setup_package
          cmdclass={"build_ext": build_ext_subclass},
        File "c:developlibdistutilscore.py", line 108, in setup
          _setup_distribution = dist = klass(attrs)
        File "c:developlibsite-packagessetuptoolsdist.py", line 315, in __init__
          self.fetch_build_eggs(attrs['setup_requires'])
        File "c:developlibsite-packagessetuptoolsdist.py", line 361, in fetch_build_eggs
          replace_conflicting=True,
        File "c:developlibsite-packagespkg_resources__init__.py", line 850, in resolve
          dist = best[req.key] = env.best_match(req, ws, installer)
        File "c:developlibsite-packagespkg_resources__init__.py", line 1122, in best_match
          return self.obtain(req, installer)
        File "c:developlibsite-packagespkg_resources__init__.py", line 1134, in obtain
          return installer(requirement)
        File "c:developlibsite-packagessetuptoolsdist.py", line 429, in fetch_build_egg
          return cmd.easy_install(req)
        File "c:developlibsite-packagessetuptoolscommandeasy_install.py", line 665, in easy_install
          return self.install_item(spec, dist.location, tmpdir, deps)
        File "c:developlibsite-packagessetuptoolscommandeasy_install.py", line 695, in install_item
          dists = self.install_eggs(spec, download, tmpdir)
        File "c:developlibsite-packagessetuptoolscommandeasy_install.py", line 876, in install_eggs
          return self.build_and_install(setup_script, setup_base)
        File "c:developlibsite-packagessetuptoolscommandeasy_install.py", line 1115, in build_and_install
          self.run_setup(setup_script, setup_base, args)
        File "c:developlibsite-packagessetuptoolscommandeasy_install.py", line 1101, in run_setup
          run_setup(setup_script, args)
        File "c:developlibsite-packagessetuptoolssandbox.py", line 251, in run_setup
          raise
        File "c:developlibcontextlib.py", line 99, in __exit__
          self.gen.throw(type, value, traceback)
        File "c:developlibsite-packagessetuptoolssandbox.py", line 198, in setup_context
          yield
        File "c:developlibcontextlib.py", line 99, in __exit__
          self.gen.throw(type, value, traceback)
        File "c:developlibsite-packagessetuptoolssandbox.py", line 169, in save_modules
          saved_exc.resume()
        File "c:developlibsite-packagessetuptoolssandbox.py", line 144, in resume
          six.reraise(type, exc, self._tb)
        File "c:developlibsite-packagespkg_resources_vendorsix.py", line 685, in reraise
          raise value.with_traceback(tb)
        File "c:developlibsite-packagessetuptoolssandbox.py", line 157, in save_modules
          yield saved
        File "c:developlibsite-packagessetuptoolssandbox.py", line 198, in setup_context
          yield
        File "c:developlibsite-packagessetuptoolssandbox.py", line 248, in run_setup
          DirectorySandbox(setup_dir).run(runner)
        File "c:developlibsite-packagessetuptoolssandbox.py", line 278, in run
          return func()
        File "c:developlibsite-packagessetuptoolssandbox.py", line 246, in runner
          _execfile(setup_script, ns)
        File "c:developlibsite-packagessetuptoolssandbox.py", line 47, in _execfile
          exec(code, globals, locals)
        File "C:UsersdeadevilAppDataLocalTempeasy_install-pjf6m7xqnumpy-1.19.1setup.py", line 499, in <module>
        File "C:UsersdeadevilAppDataLocalTempeasy_install-pjf6m7xqnumpy-1.19.1setup.py", line 479, in setup_package
        File "C:UsersdeadevilAppDataLocalTempeasy_install-pjf6m7xqnumpy-1.19.1setup.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:developpython.exe' 'c:developlibsite-packagespip' install --ignore-installed --no-user --prefix 'C:UsersdeadevilAppDataLocalTemppip-build-env-dau1pejsnormal' --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. Вы пробовали устанавливать cython напрямую с помощью pip install cython ?

2. @DineshKumar нет? Это то, что мне тоже нужно установить?

3. @DineshKumar я только что проверил и Cython уже установлен?

Ответ №1:

Попробуйте это:

 pip install psycopg2-binary