pycharm 生成包元数据时遇到错误

wn9m85ua  于 2023-11-19  发布在  PyCharm
关注(0)|答案(1)|浏览(219)

收集dotenv

Using cached dotenv-0.0.5.tar.gz (2.4 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'error'

 error: subprocess-exited-with-error

  python setup.py egg_info did not run successfully.
  exit code: 1
  
  [77 lines of output]
  C:\Users\naval\OneDrive\Desktop\Learning Hub\Python-BootCamp\section 64\day-64-starting-files-top-movies\venv\Lib\site-packages\setuptools\installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
    warnings.warn(
    error: subprocess-exited-with-error
  
    python setup.py egg_info did not run successfully.
    exit code: 1
  
    [22 lines of output]
    Traceback (most recent call last):
      File "<string>", line 2, in <module>
      File "<pip-setuptools-caller>", line 14, in <module>
      File "C:\Users\naval\AppData\Local\Temp\pip-wheel-n1gnwdbh\distribute_5385a5f0f3b7409680c07cd450777e03\setuptools\__init__.py", line 2, in <module>
        from setuptools.extension import Extension, Library
      File "C:\Users\naval\AppData\Local\Temp\pip-wheel-n1gnwdbh\distribute_5385a5f0f3b7409680c07cd450777e03\setuptools\extension.py", line 5, in <module>
        from setuptools.dist import _get_unpatched
      File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
      File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
      File "C:\Users\naval\OneDrive\Desktop\Learning Hub\Python-BootCamp\section 64\day-64-starting-files-top-movies\venv\Lib\site-packages\_virtualenv.py", line 89, in exec_module
        old(module)
      File "C:\Users\naval\AppData\Local\Temp\pip-wheel-n1gnwdbh\distribute_5385a5f0f3b7409680c07cd450777e03\setuptools\dist.py", line 7, in <module>
        from setuptools.command.install import install
      File "C:\Users\naval\AppData\Local\Temp\pip-wheel-n1gnwdbh\distribute_5385a5f0f3b7409680c07cd450777e03\setuptools\command\__init__.py", line 8, in <module>
        from setuptools.command import install_scripts
      File "C:\Users\naval\AppData\Local\Temp\pip-wheel-n1gnwdbh\distribute_5385a5f0f3b7409680c07cd450777e03\setuptools\command\install_scripts.py", line 3, in <module>
        from pkg_resources import Distribution, PathMetadata, ensure_directory
      File "C:\Users\naval\AppData\Local\Temp\pip-wheel-n1gnwdbh\distribute_5385a5f0f3b7409680c07cd450777e03\pkg_resources.py", line 1518, in <module>
        register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
    [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.
  Traceback (most recent call last):
    File "C:\Users\naval\OneDrive\Desktop\Learning Hub\Python-BootCamp\section 64\day-64-starting-files-top-movies\venv\Lib\site-packages\setuptools\installer.py", line 82, in fetch_build_egg
      subprocess.check_call(cmd)
    File "C:\Users\naval\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 413, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['C:\\Users\\naval\\OneDrive\\Desktop\\Learning Hub\\Python-BootCamp\\section 64\\day-64-starting-files-top-movies\\venv\\Scripts\\python.exe', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', 'C:\\Users\\naval\\AppData\\Local\\Temp\\tmp1fswpi90', '--quiet', 'distribute']' returned non-zero exit status 1.
  
  The above exception was the direct cause of the following exception:
  
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "C:\Users\naval\AppData\Local\Temp\pip-install-2udsov2_\dotenv_a5dadefcebc54b9f95af1edad47b6fce\setup.py", line 13, in <module>
      setup(name='dotenv',
    File "C:\Users\naval\OneDrive\Desktop\Learning Hub\Python-BootCamp\section 64\day-64-starting-files-top-movies\venv\Lib\site-packages\setuptools\__init__.py", line 86, in setup
      _install_setup_requires(attrs)
    File "C:\Users\naval\OneDrive\Desktop\Learning Hub\Python-BootCamp\section 64\day-64-starting-files-top-movies\venv\Lib\site-packages\setuptools\__init__.py", line 80, in _install_setup_requires
      dist.fetch_build_eggs(dist.setup_requires)
    File "C:\Users\naval\OneDrive\Desktop\Learning Hub\Python-BootCamp\section 64\day-64-starting-files-top-movies\venv\Lib\site-packages\setuptools\dist.py", line 875, in fetch_build_eggs
      resolved_dists = pkg_resources.working_set.resolve(
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\naval\OneDrive\Desktop\Learning Hub\Python-BootCamp\section 64\day-64-starting-files-top-movies\venv\Lib\site-packages\pkg_resources\__init__.py", line 789, in resolve
      dist = best[req.key] = env.best_match(
                             ^^^^^^^^^^^^^^^
    File "C:\Users\naval\OneDrive\Desktop\Learning Hub\Python-BootCamp\section 64\day-64-starting-files-top-movies\venv\Lib\site-packages\pkg_resources\__init__.py", line 1075, in best_match
      return self.obtain(req, installer)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\naval\OneDrive\Desktop\Learning Hub\Python-BootCamp\section 64\day-64-starting-files-top-movies\venv\Lib\site-packages\pkg_resources\__init__.py", line 1087, in obtain
      return installer(requirement)
             ^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\naval\OneDrive\Desktop\Learning Hub\Python-BootCamp\section 64\day-64-starting-files-top-movies\venv\Lib\site-packages\setuptools\dist.py", line 945, in fetch_build_egg
      return fetch_build_egg(self, req)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\naval\OneDrive\Desktop\Learning Hub\Python-BootCamp\section 64\day-64-starting-files-top-movies\venv\Lib\site-packages\setuptools\installer.py", line 84, in fetch_build_egg
      raise DistutilsError(str(e)) from e
  distutils.errors.DistutilsError: Command '['C:\\Users\\naval\\OneDrive\\Desktop\\Learning Hub\\Python-BootCamp\\section 64\\day-64-starting-files-top-movies\\venv\\Scripts\\python.exe', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', 'C:\\Users\\naval\\AppData\\Local\\Temp\\tmp1fswpi90', '--quiet', 'distribute']' returned non-zero exit status 1.
  [end of output]

字符串
注意:此错误源于子流程,可能不是pip的问题。错误:元数据生成失败
生成包元数据时遇到错误。
输出见上文。
注意:这是上面提到的软件包的问题,而不是pip。提示:详见上面。

ndh0cuux

ndh0cuux1#

解决方案

通过运行以下命令解决问题:
1.第一个月
如果你遇到特定软件包的问题,你可以尝试使用--no-deps选项单独安装它。这有时可以帮助绕过有问题的依赖关系。

相关问题