未找到 pyyaml==6.0 的匹配分布

No matching distribution found for pyyaml==6.0

提问人:jjk 提问时间:11/16/2023 更新时间:11/18/2023 访问量:78

问:

有什么想法如何解决这个错误吗?看着痕迹,我真的看不出有什么问题。我还没有找到任何使用谷歌的相关解决方案。

$ pip install pyyaml==6.0

  Collecting pyyaml==6.0
    Downloading PyYAML-6.0.tar.gz (124 kB)
      |████████████████████████████████| 124 kB 1.4 MB/s 
    Installing build dependencies ... done
    Getting requirements to build wheel ... error
    ERROR: Command errored out with exit status 1:
    command: /usr/bin/python3 /tmp/tmpimfk8et5_in_process.py get_requires_for_build_wheel /tmp/tmptwgswocr
        cwd: /tmp/pip-install-jtbm2j5w/pyyaml_43d97cbb4d494a94a99612f362c5e1f8
    Complete output (48 lines):
    running egg_info
    writing lib/PyYAML.egg-info/PKG-INFO
    writing dependency_links to lib/PyYAML.egg-info/dependency_links.txt
    writing top-level names to lib/PyYAML.egg-info/top_level.txt
    Traceback (most recent call last):
      File "/tmp/tmpimfk8et5_in_process.py", line 280, in <module>
        main()
      File "/tmp/tmpimfk8et5_in_process.py", line 263, in main
        json_out['return_val'] = hook(**hook_input['kwargs'])
      File "/tmp/tmpimfk8et5_in_process.py", line 114, in get_requires_for_build_wheel
        return hook(config_settings)
      File "/tmp/pip-build-env-f2hncflc/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 355, in get_requires_for_build_wheel
        return self._get_build_requires(config_settings, requirements=['wheel'])
      File "/tmp/pip-build-env-f2hncflc/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 325, in _get_build_requires
        self.run_setup()
      File "/tmp/pip-build-env-f2hncflc/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 341, in run_setup
        exec(code, locals())
      File "<string>", line 288, in <module>
      File "/tmp/pip-build-env-f2hncflc/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 103, in setup
        return distutils.core.setup(**attrs)
      File "/tmp/pip-build-env-f2hncflc/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 185, in setup
        return run_commands(dist)
      File "/tmp/pip-build-env-f2hncflc/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
        dist.run_commands()
      File "/tmp/pip-build-env-f2hncflc/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
        self.run_command(cmd)
      File "/tmp/pip-build-env-f2hncflc/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 989, in run_command
        super().run_command(command)
      File "/tmp/pip-build-env-f2hncflc/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
        cmd_obj.run()
      File "/tmp/pip-build-env-f2hncflc/overlay/lib/python3.9/site-packages/setuptools/command/egg_info.py", line 318, in run
        self.find_sources()
      File "/tmp/pip-build-env-f2hncflc/overlay/lib/python3.9/site-packages/setuptools/command/egg_info.py", line 326, in find_sources
        mm.run()
      File "/tmp/pip-build-env-f2hncflc/overlay/lib/python3.9/site-packages/setuptools/command/egg_info.py", line 548, in run
        self.add_defaults()
      File "/tmp/pip-build-env-f2hncflc/overlay/lib/python3.9/site-packages/setuptools/command/egg_info.py", line 586, in add_defaults
        sdist.add_defaults(self)
      File "/tmp/pip-build-env-f2hncflc/overlay/lib/python3.9/site-packages/setuptools/command/sdist.py", line 113, in add_defaults
        super().add_defaults()
      File "/tmp/pip-build-env-f2hncflc/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/sdist.py", line 251, in add_defaults
        self._add_defaults_ext()
      File "/tmp/pip-build-env-f2hncflc/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/sdist.py", line 336, in _add_defaults_ext
        self.filelist.extend(build_ext.get_source_files())
      File "<string>", line 204, in get_source_files
      File "/tmp/pip-build-env-f2hncflc/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 107, in __getattr__
        raise AttributeError(attr)
    AttributeError: cython_sources
    ----------------------------------------
  WARNING: Discarding https://files.pythonhosted.org/packages/36/2b/61d51a2c4f25ef062ae3f74576b01638bebad5e045f747ff12643df63844/PyYAML-6.0.tar.gz#sha256=68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2 (from https://pypi.org/simple/pyyaml/) (requires-python:>=3.6). Command errored out with exit status 1: /usr/bin/python3 /tmp/tmpimfk8et5_in_process.py get_requires_for_build_wheel /tmp/tmptwgswocr Check the logs for full command output.
  ERROR: Could not find a version that satisfies the requirement pyyaml==6.0
  ERROR: No matching distribution found for pyyaml==6.0

我的环境:

Debian GNU/Linux 11 (靶心)
5.15.92-1
Python 3.92

看起来你的帖子主要是代码;请补充更多细节:我不知道我还能在这里写什么。

python-3.x linux

评论

0赞 anthony sottile 11/17/2023
你怎么没有在谷歌上找到结果?AttributeError 行有数百个完全相同的重复帖子
0赞 anthony sottile 11/17/2023
这回答了你的问题吗?Docker-compose 不再生成映像 (AttributeError: cython_sources)
0赞 jjk 11/17/2023
@anthonysottile 在我的问题中,你在哪里看到了关于Docker的任何信息?
0赞 anthony sottile 11/17/2023
docker 部分并不重要——这个问题的标题过于具体,但他们的问题和解决方案与您的问题相同

答:

0赞 DuckyPolice alt 11/17/2023 #1

你可以只安装 pyyaml 而不安装其余部分。当使用用于较旧 Python 3 版本的预写脚本时,这通常对我有用。