Requirements.txtからファイルをpipインストールするときにエラーが発生しました

ゴジー

調査目的でgithubからリポジトリのクローンを作成し、requirements.txtファイルからいくつかの要件をインストールしようとしています。インストールはWindowsで問題なく実行されましたが、Ubuntu18.04にインストールするとエラーが発生します

condaで作成された仮想環境にインストールしています。そして、私はPython3.8を使用しています。以下はエラーのトレースバックです。

Collecting flask
  Using cached https://files.pythonhosted.org/packages/9b/93/628509b8d5dc749656a9641f4caf13540e2cdec85276964ff8f43bbb1d3b/Flask-1.1.1-py2.py3-none-any.whl
Collecting mysqlclient
  Using cached https://files.pythonhosted.org/packages/f8/9b/5db9a03e2088a87c26e3e4d4c7f7e8f4c2dbae610f9521cdfac15755a795/mysqlclient-1.4.5.tar.gz
Collecting sklearn
  Downloading https://files.pythonhosted.org/packages/1e/7a/dbb3be0ce9bd5c8b7e3d87328e79063f8b263b2b1bfa4774cb1147bfcd3f/sklearn-0.0.tar.gz
Collecting numpy
  Downloading https://files.pythonhosted.org/packages/3a/8f/f9ee25c0ae608f86180c26a1e35fe7ea9d71b473ea7f54db20759ba2745e/numpy-1.17.3-cp38-cp38-manylinux1_x86_64.whl (20.5MB)
     |████████████████████████████████| 20.5MB 153kB/s 
Collecting scipy
  Downloading https://files.pythonhosted.org/packages/ee/5b/5afcd1c46f97b3c2ac3489dbc95d6ca28eacf8e3634e51f495da68d97f0f/scipy-1.3.1.tar.gz (23.6MB)
     |████████████████████████████████| 23.6MB 82kB/s 
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... error
    ERROR: Command errored out with exit status 1:
     command: /home/agozie/miniconda3/envs/facial/bin/python /home/agozie/miniconda3/envs/facial/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpolyoz9vt
         cwd: /tmp/pip-install-sw1gf9a3/scipy
    Complete output (153 lines):
    lapack_opt_info:
    lapack_mkl_info:
    customize UnixCCompiler
      libraries mkl_rt not found in ['/home/agozie/miniconda3/envs/facial/lib', '/usr/local/lib', '/usr/lib', '/usr/lib/x86_64-linux-gnu']
      NOT AVAILABLE

    openblas_lapack_info:
    customize UnixCCompiler
    customize UnixCCompiler
      libraries openblas not found in ['/home/agozie/miniconda3/envs/facial/lib', '/usr/local/lib', '/usr/lib', '/usr/lib/x86_64-linux-gnu']
      NOT AVAILABLE

    openblas_clapack_info:
    customize UnixCCompiler
    customize UnixCCompiler
      libraries openblas,lapack not found in ['/home/agozie/miniconda3/envs/facial/lib', '/usr/local/lib', '/usr/lib', '/usr/lib/x86_64-linux-gnu']
      NOT AVAILABLE

    atlas_3_10_threads_info:
    Setting PTATLAS=ATLAS
    customize UnixCCompiler
      libraries tatlas,tatlas not found in /home/agozie/miniconda3/envs/facial/lib
    customize UnixCCompiler
      libraries lapack_atlas not found in /home/agozie/miniconda3/envs/facial/lib
    customize UnixCCompiler
      libraries tatlas,tatlas not found in /usr/local/lib
    customize UnixCCompiler
      libraries lapack_atlas not found in /usr/local/lib
    customize UnixCCompiler
      libraries tatlas,tatlas not found in /usr/lib
    customize UnixCCompiler
      libraries lapack_atlas not found in /usr/lib
    customize UnixCCompiler
      libraries tatlas,tatlas not found in /usr/lib/x86_64-linux-gnu
    customize UnixCCompiler
      libraries lapack_atlas not found in /usr/lib/x86_64-linux-gnu
    <class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
      NOT AVAILABLE

    atlas_3_10_info:
    customize UnixCCompiler
      libraries satlas,satlas not found in /home/agozie/miniconda3/envs/facial/lib
    customize UnixCCompiler
      libraries lapack_atlas not found in /home/agozie/miniconda3/envs/facial/lib
    customize UnixCCompiler
      libraries satlas,satlas not found in /usr/local/lib
    customize UnixCCompiler
      libraries lapack_atlas not found in /usr/local/lib
    customize UnixCCompiler
      libraries satlas,satlas not found in /usr/lib
    customize UnixCCompiler
      libraries lapack_atlas not found in /usr/lib
    customize UnixCCompiler
      libraries satlas,satlas not found in /usr/lib/x86_64-linux-gnu
    customize UnixCCompiler
      libraries lapack_atlas not found in /usr/lib/x86_64-linux-gnu
    <class 'numpy.distutils.system_info.atlas_3_10_info'>
      NOT AVAILABLE

    atlas_threads_info:
    Setting PTATLAS=ATLAS
    customize UnixCCompiler
      libraries ptf77blas,ptcblas,atlas not found in /home/agozie/miniconda3/envs/facial/lib
    customize UnixCCompiler
      libraries lapack_atlas not found in /home/agozie/miniconda3/envs/facial/lib
    customize UnixCCompiler
      libraries ptf77blas,ptcblas,atlas not found in /usr/local/lib
    customize UnixCCompiler
      libraries lapack_atlas not found in /usr/local/lib
    customize UnixCCompiler
      libraries ptf77blas,ptcblas,atlas not found in /usr/lib
    customize UnixCCompiler
      libraries lapack_atlas not found in /usr/lib
    customize UnixCCompiler
      libraries ptf77blas,ptcblas,atlas not found in /usr/lib/x86_64-linux-gnu
    customize UnixCCompiler
      libraries lapack_atlas not found in /usr/lib/x86_64-linux-gnu
    <class 'numpy.distutils.system_info.atlas_threads_info'>
      NOT AVAILABLE

    atlas_info:
    customize UnixCCompiler
      libraries f77blas,cblas,atlas not found in /home/agozie/miniconda3/envs/facial/lib
    customize UnixCCompiler
      libraries lapack_atlas not found in /home/agozie/miniconda3/envs/facial/lib
    customize UnixCCompiler
      libraries f77blas,cblas,atlas not found in /usr/local/lib
    customize UnixCCompiler
      libraries lapack_atlas not found in /usr/local/lib
    customize UnixCCompiler
      libraries f77blas,cblas,atlas not found in /usr/lib
    customize UnixCCompiler
      libraries lapack_atlas not found in /usr/lib
    customize UnixCCompiler
      libraries f77blas,cblas,atlas not found in /usr/lib/x86_64-linux-gnu
    customize UnixCCompiler
      libraries lapack_atlas not found in /usr/lib/x86_64-linux-gnu
    <class 'numpy.distutils.system_info.atlas_info'>
      NOT AVAILABLE

    lapack_info:
    customize UnixCCompiler
      libraries lapack not found in ['/home/agozie/miniconda3/envs/facial/lib', '/usr/local/lib', '/usr/lib', '/usr/lib/x86_64-linux-gnu']
      NOT AVAILABLE

    lapack_src_info:
      NOT AVAILABLE

      NOT AVAILABLE

    setup.py:386: UserWarning: Unrecognized setuptools command ('dist_info --egg-base /tmp/pip-modern-metadata-l1gkp34t'), proceeding with generating Cython sources and expanding templates
      warnings.warn("Unrecognized setuptools command ('{}'), proceeding with "
    Running from scipy source directory.
    /tmp/pip-build-env-ikhv85cu/overlay/lib/python3.8/site-packages/numpy/distutils/system_info.py:624: 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.
      self.calc_info()
    /tmp/pip-build-env-ikhv85cu/overlay/lib/python3.8/site-packages/numpy/distutils/system_info.py:624: 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.
      self.calc_info()
    /tmp/pip-build-env-ikhv85cu/overlay/lib/python3.8/site-packages/numpy/distutils/system_info.py:624: 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.
      self.calc_info()
    Traceback (most recent call last):
      File "/home/agozie/miniconda3/envs/facial/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py", line 257, in <module>
        main()
      File "/home/agozie/miniconda3/envs/facial/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py", line 240, in main
        json_out['return_val'] = hook(**hook_input['kwargs'])
      File "/home/agozie/miniconda3/envs/facial/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py", line 110, in prepare_metadata_for_build_wheel
        return hook(metadata_directory, config_settings)
      File "/tmp/pip-build-env-ikhv85cu/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 156, in prepare_metadata_for_build_wheel
        self.run_setup()
      File "/tmp/pip-build-env-ikhv85cu/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 236, in run_setup
        super(_BuildMetaLegacyBackend,
      File "/tmp/pip-build-env-ikhv85cu/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 142, in run_setup
        exec(compile(code, __file__, 'exec'), locals())
      File "setup.py", line 505, in <module>
        setup_package()
      File "setup.py", line 501, in setup_package
        setup(**metadata)
      File "/tmp/pip-build-env-ikhv85cu/overlay/lib/python3.8/site-packages/numpy/distutils/core.py", line 135, in setup
        config = configuration()
      File "setup.py", line 403, in configuration
        raise NotFoundError(msg)
    numpy.distutils.system_info.NotFoundError: No lapack/blas resources found.
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/agozie/miniconda3/envs/facial/bin/python /home/agozie/miniconda3/envs/facial/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpolyoz9vt Check the logs for full command output.

そして以下はrequirements.txtファイルです

mysqlclient
sklearn
numpy
scipy
pillow
dlib
face_recognition
flask_bootstrap
pytz
xlsxwriter
pandas
flask_mail
tensorflow
xlrd

OSと関係があると思いますが、よくわかりません。誰かが助けてくれるなら、私は最も感謝するでしょう。

編集:最初にconda install scipyを使用してscipyをインストールしようとしましたが、次の出力が得られました

Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: - 
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abor\ 
Examining certifi:  16%|███▍                  | 5/32 [08:11<1:13:42, 163.79s/it]
Comparing s/ cs that have this dependency:   0%|          | 0/2 [00:00<?, ?it/s]
Finding shortest conflict path for certifi[version='>=2016.09']:   0%| | 0/4 [00Finding- hortest conflict path for ca-certificates:  25%|▎| 1/4 [08:43<26:09, 52Finding shortest conflict path for ca-certificates:  50%|▌| 2/4 [08:43<08:43, 26/ nding shortest conflict path for certifi:  50%|▌| 2/4 [09:05<08:43, 261.61s/itFinding shortest conflict path for certifi:  75%|▊| 3/4 [09:05<03:09, 189.68s/itFinding shortest confl| t path for certifi[version='>=2016.9.26']:  75%|▊| 3/4 [Finding shortest conflict path for certifi[version='>=2016.9.26']: 100%|█| 4/4 [Comparing specs that have this dependency:  50%|▌| 1/2 [25:37<25:37, 1537.78s/it]                       
Finding shortest conflict path for certifi[version='>=2016.09']:   0%| | 0/3 [00Finding shortest conf/ ct path for ca-certificates:  33%|▎| 1/3 [00:00<00:00, 32Finding shortest conflict path for certifi[version='>=2016.9.26']:  67%|▋| 2/3 [Examining python:  47%|███████████▎            | 15/32 [41:46<51:46, 182.75s// ]Comparing specs- hat have this dependency:   0%|          | 0/2 [00:00<?, ?it/s]
Finding shortes- conflict path for python[version='>=3.7,<3.8.0a0']:   0%| | 0/5Finding shortest conflict path for python=3.8:  20%|▏| 1/5 [00:00<00:00, 10.88itFinding shortest conflict path for python[version='>=3.6,<3.7.0a0']:  40%|▍| 2/5Finding shortest conflic| path for python[version='>=3.6,<3.7.0a0']:  60%|▌| 3/5Finding shortest conflict path for python[version='>=3.5,<3.6.0a0']:  60%|▌| 3/5Finding shortest conflic- path for python[version='>=2.7,<2.8.0a0']:  80%|▊| 4/5Finding shortest conflict path for python[version='>=2.7,<2.8.0a0']: 100%|█| 5/5Comparing specs that have this dependency:  50%|▌| 1/2 [05:30<05:30, 330.15s/it]Finding shortest conflict path for python[version='>=3.8,<3.9.0a0']:   0%| | 0/2failed                                                                                                                                                          UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:

Specifications:

  - scipy -> python[version='>=2.7,<2.8.0a0|>=3.5,<3.6.0a0|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0']

Your python: python=3.8

If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.

The following specifications were found to be incompatible with each other:



Package certifi conflicts for:
scipy -> python[version='>=3.7,<3.8.0a0'] -> pip -> setuptools -> certifi[version='>=2016.09|>=2016.9.26']
python=3.8 -> pip -> setuptools -> certifi[version='>=2016.09|>=2016.9.26']
Package setuptools conflicts for:
python=3.8 -> pip -> setuptools
scipy -> python[version='>=3.7,<3.8.0a0'] -> pip -> setuptools
Package pip conflicts for:
python=3.8 -> pip
scipy -> python[version='>=3.7,<3.8.0a0'] -> pip
Package ca-certificates conflicts for:
scipy -> python[version='>=3.7,<3.8.0a0'] -> ca-certificates
python=3.8 -> openssl[version='>=1.1.1d,<1.1.2a'] -> ca-certificates
Package wheel conflicts for:
scipy -> python[version='>=3.7,<3.8.0a0'] -> pip -> wheel
python=3.8 -> pip -> wheel
イグアナナウト

プラットフォームのPyPIにバイナリホイールがないように見えるSciPyのインストールをエラーにしたようです(SciPy 1.3.1には多くのホイールがあるため、これは驚くべきことです。

ただし、すでにcondaを使用しているため、conda installを使用して、適切なcondaパッケージを介してできるだけ多くの依存関係をインストールすることから始める必要があります特に、NumPyやSciPyのような複雑なパッケージは、tensorflowやpandasのようなパッケージと同様に、すでにconda用に専門的にパッケージ化されています。

ドキュメントconda-install 明らかにされいませんが、基本的なrequirements.txtファイルを読み取ることができます。上記のrequirements.txtように渡してみました

conda install --file requirements.txt

しかし、いくつかのパッケージは、私のデフォルトのcondaチャネルのいずれにも含まれていないか、名前が異なる可能性があります(たとえば、「sklearn」の場合、condaパッケージは「scikit-learn」です)。具体的には:

PackagesNotFoundError: The following packages are not available from current channels:

  - face_recognition
  - flask_bootstrap
  - flask_mail
  - sklearn

一部の依存関係には、condaパッケージがまったく含まれていない場合があります。

最善の方法は、conda介してできるだけ多くの依存関係をインストールしてconda env exportから、を使用してenvironment.ymlファイルを作成することだと思います。

次に、開発環境をセットアップするときに、最初にからパッケージをインストールしてからenvironment.yml実行しpip install -r requirements.txtます。後者は、condaによってすでに満たされている要件を無視し、「flask-bootstrap」など、condaによってまだ管理されていない可能性のある追加のパッケージをインストールするだけです。

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

自作:pipのrequirements.txtに似た設定ファイルからインストールしますか?

分類Dev

Requirements.txtファイル#Djangoを使用してライブラリをインストールしようとすると、このエラーが発生しました

分類Dev

UbuntuにDevstackをインストール中にエラーが発生しました:「/ opt / stack / requirements / .venv / bin / pip」が存在しません

分類Dev

Requirements.txtをインストールすると、無効な構文エラーPython3.7が発生します

分類Dev

Requirements.txtからPyTorchをインストールします

分類Dev

GO111MODULEでバッファローをインストールすると、go get:error loading module requirementsが発生します

分類Dev

pipとrequirements.txtを使用して連鎖依存関係をインストールしますか?

分類Dev

パッケージをインストールしてpipでrequirements.txtに書き込みます

分類Dev

パッケージをインストールしてpipでrequirements.txtに書き込みます

分類Dev

アンインストールされたホイールからrequirements.txtを生成します

分類Dev

Pythonファイルのrequirements.txtを取得してvirtualenvにインストールします

分類Dev

Requirements.txtをインストールすると、Djangoでエラーがスローされます

分類Dev

Pythonファイルから参照して、requirements.txtに存在するパッケージをインストールする

分類Dev

Docker-pipはすべてのrequirements.txtファイルをdocker.composeupの共有ボリュームにインストールします

分類Dev

Pip Requirements.txt --global-optionにより、他のパッケージでインストールエラーが発生します。「オプションが認識されない」

分類Dev

`pip install -U pip -r Requirements.txt`は、要件をインストールする前にpipをアップグレードしますか?

分類Dev

ローカルディレクトリからrequirements.txtファイルに従ってpipを使用してパッケージをインストールするにはどうすればよいですか?

分類Dev

Travis-ciはrequirements.txtファイルからパッケージを自動的にインストールします

分類Dev

Dockerfileを使用してrequirements.txtをダウンロードしようとしたときにハッシュ値にエラーが発生しました

分類Dev

pip install requirements.txtを使用してインストールできない

分類Dev

pythonanywhereにデプロイするときにrequirements.txtをインストールしようとしているときにappdirsをアンインストールしようとしているPip

分類Dev

選択したパッケージをrequirements.txtからインストールする

分類Dev

Herokuがrequirements.txtからpsycopg2をインストールしない

分類Dev

仮想環境でPyCharm-requirements.txtを使用するとエラーが発生します-「pip」には属性「main」がありません

分類Dev

requirements.pip に django-extensions をインストールします。

分類Dev

Requirements.txtからpytestをインストールできません

分類Dev

Requirements.txtでpipを使用してtar.gzをインストールします

分類Dev

Requirements.txtのインストール中のpipコマンドエラー

分類Dev

Requirements.txtのインストール中のpipコマンドエラー

Related 関連記事

  1. 1

    自作:pipのrequirements.txtに似た設定ファイルからインストールしますか?

  2. 2

    Requirements.txtファイル#Djangoを使用してライブラリをインストールしようとすると、このエラーが発生しました

  3. 3

    UbuntuにDevstackをインストール中にエラーが発生しました:「/ opt / stack / requirements / .venv / bin / pip」が存在しません

  4. 4

    Requirements.txtをインストールすると、無効な構文エラーPython3.7が発生します

  5. 5

    Requirements.txtからPyTorchをインストールします

  6. 6

    GO111MODULEでバッファローをインストールすると、go get:error loading module requirementsが発生します

  7. 7

    pipとrequirements.txtを使用して連鎖依存関係をインストールしますか?

  8. 8

    パッケージをインストールしてpipでrequirements.txtに書き込みます

  9. 9

    パッケージをインストールしてpipでrequirements.txtに書き込みます

  10. 10

    アンインストールされたホイールからrequirements.txtを生成します

  11. 11

    Pythonファイルのrequirements.txtを取得してvirtualenvにインストールします

  12. 12

    Requirements.txtをインストールすると、Djangoでエラーがスローされます

  13. 13

    Pythonファイルから参照して、requirements.txtに存在するパッケージをインストールする

  14. 14

    Docker-pipはすべてのrequirements.txtファイルをdocker.composeupの共有ボリュームにインストールします

  15. 15

    Pip Requirements.txt --global-optionにより、他のパッケージでインストールエラーが発生します。「オプションが認識されない」

  16. 16

    `pip install -U pip -r Requirements.txt`は、要件をインストールする前にpipをアップグレードしますか?

  17. 17

    ローカルディレクトリからrequirements.txtファイルに従ってpipを使用してパッケージをインストールするにはどうすればよいですか?

  18. 18

    Travis-ciはrequirements.txtファイルからパッケージを自動的にインストールします

  19. 19

    Dockerfileを使用してrequirements.txtをダウンロードしようとしたときにハッシュ値にエラーが発生しました

  20. 20

    pip install requirements.txtを使用してインストールできない

  21. 21

    pythonanywhereにデプロイするときにrequirements.txtをインストールしようとしているときにappdirsをアンインストールしようとしているPip

  22. 22

    選択したパッケージをrequirements.txtからインストールする

  23. 23

    Herokuがrequirements.txtからpsycopg2をインストールしない

  24. 24

    仮想環境でPyCharm-requirements.txtを使用するとエラーが発生します-「pip」には属性「main」がありません

  25. 25

    requirements.pip に django-extensions をインストールします。

  26. 26

    Requirements.txtからpytestをインストールできません

  27. 27

    Requirements.txtでpipを使用してtar.gzをインストールします

  28. 28

    Requirements.txtのインストール中のpipコマンドエラー

  29. 29

    Requirements.txtのインストール中のpipコマンドエラー

ホットタグ

アーカイブ