Installer l'enregistrement du piège argoverse

Scénario du projet :

Le module argoverse doit être utilisé dans le projet. L'environnement local est conda version 23.5.0, Python version 3.10.11 et Pip version 23.1.2. Installez argoverse en utilisant la méthode d'installation du code source. Le code source provient de l'entrepôt git d'argoverse . Les étapes d'installation suivent le fichier readme.


Description du problème

Lors de l'exécution pip install -e .de la commande, vous rencontrez principalement deux erreurs, les suivantes :

  1. Rapport d'erreurs concernant Sklearn
Collecting sklearn (from argoverse==1.0.1)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/7a/93/e0e1b1e98f39dfca7ec9795cb46f6e09e88a2fd5d4a28e4b3d1f618a2aec/sklearn-0.0.post5.tar.gz (3.7 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [18 lines of output]
      The 'sklearn' PyPI package is deprecated, use 'scikit-learn'
      rather than 'sklearn' for pip commands.
      
      Here is how to fix this error in the main use cases:
      - use 'pip install scikit-learn' rather than 'pip install sklearn'
      - replace 'sklearn' by 'scikit-learn' in your pip requirements files
        (requirements.txt, setup.py, setup.cfg, Pipfile, etc ...)
      - if the 'sklearn' package is used by one of your dependencies,
        it would be great if you take some time to track which package uses
        'sklearn' instead of 'scikit-learn' and report it to their issue tracker
      - as a last resort, set the environment variable
        SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True to avoid this error
      
      More information is available at
      https://github.com/scikit-learn/sklearn-pypi-package
      
      If the previous advice does not cover your use case, feel free to report it at
      https://github.com/scikit-learn/sklearn-pypi-package/issues/new
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

  1. Rapport d'erreur concernant numpy
error: Command "gcc -pthread -B /home/muhao/anaconda3/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /home/muhao/anaconda3/include -fPIC -O2 -isystem /home/muhao/anaconda3/include -fPIC -DNPY_INTERNAL_BUILD=1 -DHAVE_NPY_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -DSCIPY_MKL_H -DHAVE_CBLAS -I/usr/local/include -I/usr/include -I/home/muhao/anaconda3/include -Ibuild/src.linux-x86_64-3.10/numpy/core/src/umath -Ibuild/src.linux-x86_64-3.10/numpy/core/src/npymath -Ibuild/src.linux-x86_64-3.10/numpy/core/src/common -Inumpy/core/include -Ibuild/src.linux-x86_64-3.10/numpy/core/include/numpy -Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/home/muhao/anaconda3/include/python3.10 -Ibuild/src.linux-x86_64-3.10/numpy/core/src/common -Ibuild/src.linux-x86_64-3.10/numpy/core/src/npymath -c build/src.linux-x86_64-3.10/numpy/core/src/multiarray/scalartypes.c -o build/temp.linux-x86_64-3.10/build/src.linux-x86_64-3.10/numpy/core/src/multiarray/scalartypes.o -MMD -MF build/temp.linux-x86_64-3.10/build/src.linux-x86_64-3.10/numpy/core/src/multiarray/scalartypes.o.d" failed with exit status 1
            [end of output]
      
        note: This error originates from a subprocess, and is likely not a problem with pip.
        ERROR: Failed building wheel for numpy
      Failed to build numpy
      ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

Analyse des causes :

La raison pour laquelle sklearn signale une erreur est que ce module est obsolète dans la nouvelle version et doit être remplacé par le module scikit-learn. L'erreur signalée par numpy est due au fait que la version de dépendance numpy spécifiée dans le script d'installation d'argoverse est 1.19, mais cette version est incompatible avec la version 3.10 de Python.


solution:

Vous devez modifier le script d'installation dans l'entrepôt argoverse setup.py, rechercher install_requiresune colonne, commenter les dépendances numpy et sklearn correspondantes, et installer manuellement la version numpy adaptée à python3.10 (la mienne est 1.24.3) et le module scikit-learn . Une fois l'installation terminée, effectuez pip install -e .à nouveau l'installation.

Je suppose que tu aimes

Origine blog.csdn.net/zmhzmhzm/article/details/131287031
conseillé
Classement