Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [63 lines of output]
WARNING: The repository located at mirrors.aliyun.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS we recommend you use HTTPS instead, otherwise you may silence this warning and allow it anyway with '--trusted-host mirrors.aliyun.com'.
ERROR: Could not find a version that satisfies the requirement cython (from versions: none)
ERROR: No matching distribution found for cython
/root/anaconda3/envs/sadtalker/lib/python3.8/site-packages/setuptools/dist.py:476: SetuptoolsDeprecationWarning: Invalid dash-separated options
!!
********************************************************************************
Usage of dash-separated 'index-url' will not be supported in future
versions. Please use the underscore name 'index_url' instead.
By 2024-Sep-26, you need to update your project and remove deprecated calls
or your builds will no longer be supported.
See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
********************************************************************************
!!
opt = self.warn_dash_deprecation(opt, section)
/root/anaconda3/envs/sadtalker/lib/python3.8/site-packages/setuptools/__init__.py:81: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
!!
********************************************************************************
Requirements should be satisfied by a PEP 517 installer.
If you are using pip, you can try `pip install --use-pep517`.
********************************************************************************
!!
dist.fetch_build_eggs(dist.setup_requires)
Traceback (most recent call last):
File "/root/anaconda3/envs/sadtalker/lib/python3.8/site-packages/setuptools/installer.py", line 101, in _fetch_build_egg_no_warn
subprocess.check_call(cmd)
File "/root/anaconda3/envs/sadtalker/lib/python3.8/subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/root/anaconda3/envs/sadtalker/bin/python', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpl0fvwspv', '--quiet', '--index-url', 'http://mirrors.aliyun.com/pypi/simple/', 'cython']' 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 "/tmp/pip-install-vpbunl73/basicsr_9ecb79fa8af5452294acdb2be96778d4/setup.py", line 147, in <module>
setup(
File "/root/anaconda3/envs/sadtalker/lib/python3.8/site-packages/setuptools/__init__.py", line 103, in setup
_install_setup_requires(attrs)
File "/root/anaconda3/envs/sadtalker/lib/python3.8/site-packages/setuptools/__init__.py", line 76, in _install_setup_requires
_fetch_build_eggs(dist)
File "/root/anaconda3/envs/sadtalker/lib/python3.8/site-packages/setuptools/__init__.py", line 81, in _fetch_build_eggs
dist.fetch_build_eggs(dist.setup_requires)
File "/root/anaconda3/envs/sadtalker/lib/python3.8/site-packages/setuptools/dist.py", line 640, in fetch_build_eggs
return _fetch_build_eggs(self, requires)
File "/root/anaconda3/envs/sadtalker/lib/python3.8/site-packages/setuptools/installer.py", line 38, in _fetch_build_eggs
resolved_dists = pkg_resources.working_set.resolve(
File "/root/anaconda3/envs/sadtalker/lib/python3.8/site-packages/pkg_resources/__init__.py", line 798, in resolve
dist = self._resolve_dist(
File "/root/anaconda3/envs/sadtalker/lib/python3.8/site-packages/pkg_resources/__init__.py", line 834, in _resolve_dist
dist = best[req.key] = env.best_match(
File "/root/anaconda3/envs/sadtalker/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1104, in best_match
return self.obtain(req, installer)
File "/root/anaconda3/envs/sadtalker/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1115, in obtain
return installer(requirement) if installer else None
File "/root/anaconda3/envs/sadtalker/lib/python3.8/site-packages/setuptools/installer.py", line 103, in _fetch_build_egg_no_warn
raise DistutilsError(str(e)) from e
distutils.errors.DistutilsError: Command '['/root/anaconda3/envs/sadtalker/bin/python', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpl0fvwspv', '--quiet', '--index-url', 'http://mirrors.aliyun.com/pypi/simple/', 'cython']' 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.
您遇到的错误信息涉及多个方面,其中主要的问题是在尝试安装 Python 包时无法找到符合要求的版本,具体来说是安装 Cython
过程中出现问题。下面是错误的主要原因和解决方案:
-
不信任的镜像源: 错误信息中提到,“WARNING: The repository located at mirrors.aliyun.com is not a trusted or secure host and is being ignored.” 这意味着您配置的
mirrors.aliyun.com
源没有使用 HTTPS,或者没有正确设置为受信任的源。要解决这个问题,您可以:- 使用 HTTPS 协议的 URL 替代当前的 HTTP。
- 如果您确认该源可信,可以在 pip 命令中添加
--trusted-host mirrors.aliyun.com
。
-
找不到匹配的包版本: “ERROR: Could not find a version that satisfies the requirement cython (from versions: none)” 这表明在指定的源中没有找到可用的 Cython 版本。解决办法可能包括:
- 确认
mirrors.aliyun.com
是否包含 Cython 的有效版本。 - 尝试使用其他的源,如 PyPI 官方源。
- 确认
-
配置项使用了过时的语法: 错误提示中提到了过时的“dash-separated”选项(如
index-url
)应改为“underscore”形式(如index_url
)。这需要您检查和更新配置文件,确保使用正确的配置语法。 -
使用旧的 setuptools 功能: 提示中提到 setuptools 的某些功能已过时,并建议使用 PEP 517 安装器。可以通过在 pip 安装命令中添加
--use-pep517
选项来尝试解决这个问题。
综上,您可以尝试以下步骤解决问题:
- 确认使用 HTTPS 协议的 URL 或将当前源设置为可信。
- 更新
pip
和setuptools
到最新版本,以确保兼容性和安全性。 - 在 pip 命令中使用
--use-pep517
选项。 - 检查并更新配置文件中的过时语法。
例如,您可以尝试使用以下命令来安装 Cython:
pip install cython --trusted-host mirrors.aliyun.com --use-pep517 --index-url https://mirrors.aliyun.com/pypi/simple/
确保所有工具和配置都是最新的,并适当调整命令中的参数以适应您的具体环境。