Python3.10.6不能pip安装的东西:错误:子进程已退出,并返回错误[重复]

icnyk63a  于 2022-12-01  发布在  Python
关注(0)|答案(1)|浏览(671)

此问题在此处已有答案

Unable to install dotenv on Windows(1个答案)
21小时前关门了。
在新的Ubuntu VPS上使用Python 3.10.6。不能pip安装dotenv,bs 4等。
使用的pip 22.3.1版本。
为什么会出现这个错误,我该怎么解决这个问题?我看了其他的问题,但是不能解决我的问题。我试着有一个较低的pip版本,没有工作。我甚至重新安装了python3.10。
谢谢。(在错误日志下面-一些已发出,所有相关)

root@localhost:~/bp-scraper# pip3 install dotenv
Collecting dotenv
  Using cached dotenv-0.0.5.tar.gz (2.4 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [64 lines of output]
      /usr/local/lib/python3.10/dist-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
        ╰─> [16 lines of output]
            Traceback (most recent call last):
              File "<string>", line 2, in <module>
              File "<pip-setuptools-caller>", line 14, in <module>
                from setuptools.command.install import install
              File "/tmp/pip-wheel-pm4y5c7z/distribute_07cb0f8f57c049ab919d5b5646e56f
                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 "/usr/local/lib/python3.10/dist-packages/setuptools/installer.py", line 82, in fetch_build_egg
          subprocess.check_call(cmd)
        File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpwdcseb1p', '--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>
          return fetch_build_egg(self, req)
        File "/usr/local/lib/python3.10/dist-packages/setuptools/installer.py", line 84, in fetch_build_egg
          raise DistutilsError(str(e)) from e
      distutils.errors.DistutilsError: Command '['/usr/bin/python3', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpwdcseb1p', '--quiet', 'distribute']' returned non-zero exit status 1.
      [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.
4dc9hkyq

4dc9hkyq1#

根据https://stackoverflow.com/a/58754136/5666087首次更新setuptools

pip install -U setuptools

然后使用dotenv的正确软件包,即python-dotenv

pip install python-dotenv

相关问题