pythonYour PYTHONPATH points to a site-packages dir for Python 2.x but you are running Python 3.x

本文介绍了一种在Mac上解决Python环境配置错误的方法。当Anaconda创建的Python 2.7和3.6环境出现问题,导致pip命令无法正常工作时,可以通过调整PYTHONPATH环境变量来解决。具体操作包括删除错误指向的Python 2.7目录。

在Mac中 出现:  Your PYTHONPATH points to a site-packages dir for Python 2.x but you are running Python 3.x 明明在anaconda中创建的py2.7 和 py3.6环境,都连pip list  都报错这样的。比较神奇,倒腾了很久,重新安装再卸载anaconda。

依然没有办法解决,最后,找到之前设置的,export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH。进入usr/local/lib/python2.7,把python2.7这个文件给删除,完美的解决问题。

进入/usr/local/lib/ 的办法,在finder中前往-前往文件夹,填入/usr/local/lib于是就打开了mac系统被隐藏保护文件。

PS C:\Users\Administrator\Desktop> # ===== 重构插件安装函数 ===== PS C:\Users\Administrator\Desktop> function Install-PthFixPlugin { >> param( >> [string]$PythonPath = "E:\Python310" >> ) >> >> $sitePackages = "$PythonPath\Lib\site-packages" >> $pluginRoot = "$sitePackages\pth_fix_plugin" >> >> # 创建插件目录结构 >> $packageDir = "$pluginRoot\pth_fix_plugin" >> New-Item -ItemType Directory -Path $packageDir -Force | Out-Null >> >> # 创建插件内容 >> $pluginFile = "$packageDir\__init__.py" >> @" >> # pth_fix_plugin/__init__.py >> import os >> import sys >> import logging >> from setuptools import setup >> from setuptools.command.install import install >> >> logger = logging.getLogger(__name__) >> >> class CustomInstallCommand(install): >> """自定义安装命令,阻止生成distutils-precedence.pth文件""" >> >> def run(self): >> # 调用原始安装方法 >> install.run(self) >> >> # 修复.pth文件 >> self.fix_pth_file() >> >> def fix_pth_file(self): >> """修复.pth文件问题""" >> pth_path = os.path.join(self.install_lib, &#39;distutils-precedence.pth&#39;) >> >> if os.path.exists(pth_path): >> logger.info(f"🔧 删除有问题的.pth文件: {pth_path}") >> try: >> os.remove(pth_path) >> logger.info("✅ 成功删除.pth文件") >> except Exception as e: >> logger.error(f"❌ 删除.pth文件失败: {str(e)}") >> else: >> logger.info("✅ 未发现.pth文件,无需修复") >> >> # 注册自定义命令 >> try: >> setup.commands[&#39;install&#39;] = CustomInstallCommand >> logger.info("✅ 成功注册pth_fix插件") >> except Exception as e: >> logger.error(f"❌ 注册插件失败: {str(e)}") >> "@ | Set-Content -Path $pluginFile -Force >> >> # 创建入口点配置 >> $setupFile = "$pluginRoot\setup.py" >> @" >> from setuptools import setup >> >> setup( >> name=&#39;pth_fix_plugin&#39;, >> version=&#39;1.0.0&#39;, >> packages=[&#39;pth_fix_plugin&#39;], >> entry_points={ >> &#39;distutils.commands&#39;: [ >> &#39;install = pth_fix_plugin:CustomInstallCommand&#39;, >> ], >> }, >> ) >> "@ | Set-Content -Path $setupFile -Force >> >> # 安装插件 >> Push-Location -Path $pluginRoot >> python -m pip install --no-deps -e . --no-warn-script-location >> Pop-Location >> >> Write-Host "✅ pth_fix插件安装完成" -ForegroundColor Green >> } PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> # ===== 更新验证函数 ===== PS C:\Users\Administrator\Desktop> function Test-FullEnvironment { >> param( >> [string]$PythonPath = "E:\Python310" >> ) >> >> # 验证核心组件 >> python -c "import torch, torchvision, torchaudio, numpy as np, modelscope; print(f&#39;PyTorch: {torch.__version__}\nTorchVision: {torchvision.__version__}\nTorchAudio: {torchaudio.__version__}\nNumPy: {np.__version__}\nAudio Backend: {torchaudio.get_audio_backend()}\nModelScope: {modelscope.__version__}&#39;)" >> >> # 验证警告 >> python -c "import warnings; warnings.filterwarnings(&#39;error&#39;); import modelscope" 2>&1 | Out-Null >> if ($LASTEXITCODE -eq 0) { >> Write-Host "✅ 环境无警告" -ForegroundColor Green >> } else { >> Write-Host "❌ 环境存在警告" -ForegroundColor Red >> } >> >> # 验证.pth文件 >> $sitePackages = "$PythonPath\Lib\site-packages" >> if (Test-Path $sitePackages) { >> $pthFiles = Get-ChildItem $sitePackages -Filter "distutils-precedence.pth" -ErrorAction SilentlyContinue >> >> if ($pthFiles) { >> Write-Host "⚠️ 发现.pth文件: $($pthFiles.FullName)" -ForegroundColor Yellow >> } else { >> Write-Host "✅ 未发现distutils-precedence.pth文件" -ForegroundColor Green >> } >> >> # 验证插件状态 >> python -c "import sys; from pkg_resources import iter_entry_points; >> entry_points = list(iter_entry_points(&#39;distutils.commands&#39;, &#39;install&#39;)); >> if entry_points: >> print(&#39;✅ 安装命令挂钩:&#39;, entry_points[0].module_name) >> else: >> print(&#39;❌ 安装命令未挂钩&#39;)" >> } else { >> Write-Host "❌ 路径不存在: $sitePackages" -ForegroundColor Red >> } >> } PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> # ===== 执行最终修复 ===== PS C:\Users\Administrator\Desktop> # 1. 确保插件目录完全删除 PS C:\Users\Administrator\Desktop> $pluginPath = "E:\Python310\Lib\site-packages\pth_fix_plugin" PS C:\Users\Administrator\Desktop> if (Test-Path $pluginPath) { >> Remove-Item -Path $pluginPath -Recurse -Force >> Write-Host "🔧 删除旧插件目录: $pluginPath" -ForegroundColor Cyan >> } 🔧 删除旧插件目录: E:\Python310\Lib\site-packages\pth_fix_plugin PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> # 2. 重新安装插件 PS C:\Users\Administrator\Desktop> Install-PthFixPlugin -PythonPath "E:\Python310" Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Obtaining file:///E:/Python310/Lib/site-packages/pth_fix_plugin Preparing metadata (setup.py) ... done Installing collected packages: pth_fix_plugin DEPRECATION: Legacy editable install of pth_fix_plugin==1.0.0 from file:///E:/Python310/Lib/site-packages/pth_fix_plugin (setup.py develop) is deprecated. pip 25.3 will enforce this behaviour change. A possible replacement is to add a pyproject.toml or enable --use-pep517, and use setuptools >= 64. If the resulting installation is not behaving as expected, try using --config-settings editable_mode=compat. Please consult the setuptools documentation for more information. Discussion can be found at https://github.com/pypa/pip/issues/11457 Running setup.py develop for pth_fix_plugin error: subprocess-exited-with-error × python setup.py develop did not run successfully. │ exit code: 1 ╰─> [136 lines of output] running develop E:\Python310\lib\site-packages\setuptools\_distutils\cmd.py:90: DevelopDeprecationWarning: develop command is deprecated. !! ******************************************************************************** Please avoid running ``setup.py`` and ``develop``. Instead, use standards-based tools like pip or uv. By 2025-Oct-31, you need to update your project and remove deprecated calls or your builds will no longer be supported. See https://github.com/pypa/setuptools/issues/917 for details. ******************************************************************************** !! self.initialize_options() Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Obtaining file:///E:/Python310/Lib/site-packages/pth_fix_plugin Installing build dependencies: started Installing build dependencies: finished with status &#39;done&#39; Checking if build backend supports build_editable: started Checking if build backend supports build_editable: finished with status &#39;done&#39; Getting requirements to build editable: started Getting requirements to build editable: finished with status &#39;done&#39; Preparing editable metadata (pyproject.toml): started Preparing editable metadata (pyproject.toml): finished with status &#39;done&#39; Building wheels for collected packages: pth_fix_plugin Building editable for pth_fix_plugin (pyproject.toml): started Building editable for pth_fix_plugin (pyproject.toml): finished with status &#39;error&#39; error: subprocess-exited-with-error Building editable for pth_fix_plugin (pyproject.toml) did not run successfully. exit code: 1 [69 lines of output] running editable_wheel creating C:\Users\Administrator\AppData\Local\Temp\pip-wheel-t28f3jf3\.tmp-zcv0fbtc\pth_fix_plugin.egg-info writing C:\Users\Administrator\AppData\Local\Temp\pip-wheel-t28f3jf3\.tmp-zcv0fbtc\pth_fix_plugin.egg-info\PKG-INFO writing dependency_links to C:\Users\Administrator\AppData\Local\Temp\pip-wheel-t28f3jf3\.tmp-zcv0fbtc\pth_fix_plugin.egg-info\dependency_links.txt writing entry points to C:\Users\Administrator\AppData\Local\Temp\pip-wheel-t28f3jf3\.tmp-zcv0fbtc\pth_fix_plugin.egg-info\entry_points.txt writing top-level names to C:\Users\Administrator\AppData\Local\Temp\pip-wheel-t28f3jf3\.tmp-zcv0fbtc\pth_fix_plugin.egg-info\top_level.txt writing manifest file &#39;C:\Users\Administrator\AppData\Local\Temp\pip-wheel-t28f3jf3\.tmp-zcv0fbtc\pth_fix_plugin.egg-info\SOURCES.txt&#39; reading manifest file &#39;C:\Users\Administrator\AppData\Local\Temp\pip-wheel-t28f3jf3\.tmp-zcv0fbtc\pth_fix_plugin.egg-info\SOURCES.txt&#39; writing manifest file &#39;C:\Users\Administrator\AppData\Local\Temp\pip-wheel-t28f3jf3\.tmp-zcv0fbtc\pth_fix_plugin.egg-info\SOURCES.txt&#39; creating &#39;C:\Users\Administrator\AppData\Local\Temp\pip-wheel-t28f3jf3\.tmp-zcv0fbtc\pth_fix_plugin-1.0.0.dist-info&#39; creating C:\Users\Administrator\AppData\Local\Temp\pip-wheel-t28f3jf3\.tmp-zcv0fbtc\pth_fix_plugin-1.0.0.dist-info\WHEEL Traceback (most recent call last): File "E:\Python310\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 389, in <module> main() File "E:\Python310\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 373, in main json_out["return_val"] = hook(**hook_input["kwargs"]) File "E:\Python310\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 303, in build_editable return hook(wheel_directory, config_settings, metadata_directory) File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-it_isus5\overlay\Lib\site-packages\setuptools\build_meta.py", line 468, in build_editable return self._build_with_temp_dir( File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-it_isus5\overlay\Lib\site-packages\setuptools\build_meta.py", line 404, in _build_with_temp_dir self.run_setup() File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-it_isus5\overlay\Lib\site-packages\setuptools\build_meta.py", line 512, in run_setup super().run_setup(setup_script=setup_script) File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-it_isus5\overlay\Lib\site-packages\setuptools\build_meta.py", line 317, in run_setup exec(code, locals()) File "<string>", line 3, in <module> File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-it_isus5\overlay\Lib\site-packages\setuptools\__init__.py", line 115, in setup return distutils.core.setup(**attrs) File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-it_isus5\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 186, in setup return run_commands(dist) File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-it_isus5\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 202, in run_commands dist.run_commands() File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-it_isus5\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 1002, in run_commands self.run_command(cmd) File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-it_isus5\overlay\Lib\site-packages\setuptools\dist.py", line 1102, in run_command super().run_command(command) File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-it_isus5\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 1021, in run_command cmd_obj.run() File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-it_isus5\overlay\Lib\site-packages\setuptools\command\editable_wheel.py", line 139, in run self._create_wheel_file(bdist_wheel) File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-it_isus5\overlay\Lib\site-packages\setuptools\command\editable_wheel.py", line 349, in _create_wheel_file files, mapping = self._run_build_commands(dist_name, unpacked, lib, tmp) File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-it_isus5\overlay\Lib\site-packages\setuptools\command\editable_wheel.py", line 271, in _run_build_commands self._configure_build(dist_name, unpacked_wheel, build_lib, tmp_dir) File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-it_isus5\overlay\Lib\site-packages\setuptools\command\editable_wheel.py", line 209, in _configure_build install_cls, dist.reinitialize_command("install", reinit_subcommands=True) File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-it_isus5\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 974, in reinitialize_command command = self.get_command_obj(command_name) File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-it_isus5\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 884, in get_command_obj klass = self.get_command_class(command) File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-it_isus5\overlay\Lib\site-packages\setuptools\dist.py", line 846, in get_command_class self.cmdclass[command] = cmdclass = ep.load() File "E:\Python310\lib\importlib\metadata\__init__.py", line 171, in load module = import_module(match.group(&#39;module&#39;)) File "E:\Python310\lib\importlib\__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1050, in _gcd_import File "<frozen importlib._bootstrap>", line 1027, in _find_and_load File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 688, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 879, in exec_module File "<frozen importlib._bootstrap_external>", line 1017, in get_code File "<frozen importlib._bootstrap_external>", line 947, in source_to_code File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "E:\Python310\Lib\site-packages\pth_fix_plugin\pth_fix_plugin\__init__.py", line 11 """\ufffd\u0536\ufffd\ufffd尲\u05f0\ufffd\ufffd\ufffd\ue8ec\ufffd\ufffd\u05b9\ufffd\ufffd\ufffd\ufffddistutils-precedence.pth\ufffd\u013c\ufffd""" ^ SyntaxError: (unicode error) &#39;utf-8&#39; codec can&#39;t decode byte 0xd7 in position 0: invalid continuation byte [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building editable for pth_fix_plugin Failed to build pth_fix_plugin error: failed-wheel-build-for-install Failed to build installable wheels for some pyproject.toml based projects pth_fix_plugin Traceback (most recent call last): File "<string>", line 2, in <module> File "<pip-setuptools-caller>", line 35, in <module> File "E:\Python310\Lib\site-packages\pth_fix_plugin\setup.py", line 3, in <module> setup( File "E:\Python310\lib\site-packages\setuptools\__init__.py", line 115, in setup return distutils.core.setup(**attrs) File "E:\Python310\lib\site-packages\setuptools\_distutils\core.py", line 186, in setup return run_commands(dist) File "E:\Python310\lib\site-packages\setuptools\_distutils\core.py", line 202, in run_commands dist.run_commands() File "E:\Python310\lib\site-packages\setuptools\_distutils\dist.py", line 1002, in run_commands self.run_command(cmd) File "E:\Python310\lib\site-packages\setuptools\dist.py", line 1102, in run_command super().run_command(command) File "E:\Python310\lib\site-packages\setuptools\_distutils\dist.py", line 1021, in run_command cmd_obj.run() File "E:\Python310\lib\site-packages\setuptools\command\develop.py", line 39, in run subprocess.check_call(cmd) File "E:\Python310\lib\subprocess.py", line 369, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command &#39;[&#39;E:\\Python310\\python.exe&#39;, &#39;-m&#39;, &#39;pip&#39;, &#39;install&#39;, &#39;-e&#39;, &#39;.&#39;, &#39;--use-pep517&#39;, &#39;--no-deps&#39;]&#39; 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: subprocess-exited-with-error × python setup.py develop did not run successfully. │ exit code: 1 ╰─> [136 lines of output] running develop E:\Python310\lib\site-packages\setuptools\_distutils\cmd.py:90: DevelopDeprecationWarning: develop command is deprecated. !! ******************************************************************************** Please avoid running ``setup.py`` and ``develop``. Instead, use standards-based tools like pip or uv. By 2025-Oct-31, you need to update your project and remove deprecated calls or your builds will no longer be supported. See https://github.com/pypa/setuptools/issues/917 for details. ******************************************************************************** !! self.initialize_options() Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Obtaining file:///E:/Python310/Lib/site-packages/pth_fix_plugin Installing build dependencies: started Installing build dependencies: finished with status &#39;done&#39; Checking if build backend supports build_editable: started Checking if build backend supports build_editable: finished with status &#39;done&#39; Getting requirements to build editable: started Getting requirements to build editable: finished with status &#39;done&#39; Preparing editable metadata (pyproject.toml): started Preparing editable metadata (pyproject.toml): finished with status &#39;done&#39; Building wheels for collected packages: pth_fix_plugin Building editable for pth_fix_plugin (pyproject.toml): started Building editable for pth_fix_plugin (pyproject.toml): finished with status &#39;error&#39; error: subprocess-exited-with-error Building editable for pth_fix_plugin (pyproject.toml) did not run successfully. exit code: 1 [69 lines of output] running editable_wheel creating C:\Users\Administrator\AppData\Local\Temp\pip-wheel-t28f3jf3\.tmp-zcv0fbtc\pth_fix_plugin.egg-info writing C:\Users\Administrator\AppData\Local\Temp\pip-wheel-t28f3jf3\.tmp-zcv0fbtc\pth_fix_plugin.egg-info\PKG-INFO writing dependency_links to C:\Users\Administrator\AppData\Local\Temp\pip-wheel-t28f3jf3\.tmp-zcv0fbtc\pth_fix_plugin.egg-info\dependency_links.txt writing entry points to C:\Users\Administrator\AppData\Local\Temp\pip-wheel-t28f3jf3\.tmp-zcv0fbtc\pth_fix_plugin.egg-info\entry_points.txt writing top-level names to C:\Users\Administrator\AppData\Local\Temp\pip-wheel-t28f3jf3\.tmp-zcv0fbtc\pth_fix_plugin.egg-info\top_level.txt writing manifest file &#39;C:\Users\Administrator\AppData\Local\Temp\pip-wheel-t28f3jf3\.tmp-zcv0fbtc\pth_fix_plugin.egg-info\SOURCES.txt&#39; reading manifest file &#39;C:\Users\Administrator\AppData\Local\Temp\pip-wheel-t28f3jf3\.tmp-zcv0fbtc\pth_fix_plugin.egg-info\SOURCES.txt&#39; writing manifest file &#39;C:\Users\Administrator\AppData\Local\Temp\pip-wheel-t28f3jf3\.tmp-zcv0fbtc\pth_fix_plugin.egg-info\SOURCES.txt&#39; creating &#39;C:\Users\Administrator\AppData\Local\Temp\pip-wheel-t28f3jf3\.tmp-zcv0fbtc\pth_fix_plugin-1.0.0.dist-info&#39; creating C:\Users\Administrator\AppData\Local\Temp\pip-wheel-t28f3jf3\.tmp-zcv0fbtc\pth_fix_plugin-1.0.0.dist-info\WHEEL Traceback (most recent call last): File "E:\Python310\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 389, in <module> main() File "E:\Python310\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 373, in main json_out["return_val"] = hook(**hook_input["kwargs"]) File "E:\Python310\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 303, in build_editable return hook(wheel_directory, config_settings, metadata_directory) File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-it_isus5\overlay\Lib\site-packages\setuptools\build_meta.py", line 468, in build_editable return self._build_with_temp_dir( File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-it_isus5\overlay\Lib\site-packages\setuptools\build_meta.py", line 404, in _build_with_temp_dir self.run_setup() File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-it_isus5\overlay\Lib\site-packages\setuptools\build_meta.py", line 512, in run_setup super().run_setup(setup_script=setup_script) File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-it_isus5\overlay\Lib\site-packages\setuptools\build_meta.py", line 317, in run_setup exec(code, locals()) File "<string>", line 3, in <module> File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-it_isus5\overlay\Lib\site-packages\setuptools\__init__.py", line 115, in setup return distutils.core.setup(**attrs) File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-it_isus5\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 186, in setup return run_commands(dist) File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-it_isus5\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 202, in run_commands dist.run_commands() File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-it_isus5\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 1002, in run_commands self.run_command(cmd) File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-it_isus5\overlay\Lib\site-packages\setuptools\dist.py", line 1102, in run_command super().run_command(command) File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-it_isus5\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 1021, in run_command cmd_obj.run() File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-it_isus5\overlay\Lib\site-packages\setuptools\command\editable_wheel.py", line 139, in run self._create_wheel_file(bdist_wheel) File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-it_isus5\overlay\Lib\site-packages\setuptools\command\editable_wheel.py", line 349, in _create_wheel_file files, mapping = self._run_build_commands(dist_name, unpacked, lib, tmp) File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-it_isus5\overlay\Lib\site-packages\setuptools\command\editable_wheel.py", line 271, in _run_build_commands self._configure_build(dist_name, unpacked_wheel, build_lib, tmp_dir) File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-it_isus5\overlay\Lib\site-packages\setuptools\command\editable_wheel.py", line 209, in _configure_build install_cls, dist.reinitialize_command("install", reinit_subcommands=True) File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-it_isus5\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 974, in reinitialize_command command = self.get_command_obj(command_name) File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-it_isus5\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 884, in get_command_obj klass = self.get_command_class(command) File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-it_isus5\overlay\Lib\site-packages\setuptools\dist.py", line 846, in get_command_class self.cmdclass[command] = cmdclass = ep.load() File "E:\Python310\lib\importlib\metadata\__init__.py", line 171, in load module = import_module(match.group(&#39;module&#39;)) File "E:\Python310\lib\importlib\__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1050, in _gcd_import File "<frozen importlib._bootstrap>", line 1027, in _find_and_load File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 688, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 879, in exec_module File "<frozen importlib._bootstrap_external>", line 1017, in get_code File "<frozen importlib._bootstrap_external>", line 947, in source_to_code File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "E:\Python310\Lib\site-packages\pth_fix_plugin\pth_fix_plugin\__init__.py", line 11 """\ufffd\u0536\ufffd\ufffd尲\u05f0\ufffd\ufffd\ufffd\ue8ec\ufffd\ufffd\u05b9\ufffd\ufffd\ufffd\ufffddistutils-precedence.pth\ufffd\u013c\ufffd""" ^ SyntaxError: (unicode error) &#39;utf-8&#39; codec can&#39;t decode byte 0xd7 in position 0: invalid continuation byte [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building editable for pth_fix_plugin Failed to build pth_fix_plugin error: failed-wheel-build-for-install Failed to build installable wheels for some pyproject.toml based projects pth_fix_plugin Traceback (most recent call last): File "<string>", line 2, in <module> File "<pip-setuptools-caller>", line 35, in <module> File "E:\Python310\Lib\site-packages\pth_fix_plugin\setup.py", line 3, in <module> setup( File "E:\Python310\lib\site-packages\setuptools\__init__.py", line 115, in setup return distutils.core.setup(**attrs) File "E:\Python310\lib\site-packages\setuptools\_distutils\core.py", line 186, in setup return run_commands(dist) File "E:\Python310\lib\site-packages\setuptools\_distutils\core.py", line 202, in run_commands dist.run_commands() File "E:\Python310\lib\site-packages\setuptools\_distutils\dist.py", line 1002, in run_commands self.run_command(cmd) File "E:\Python310\lib\site-packages\setuptools\dist.py", line 1102, in run_command super().run_command(command) File "E:\Python310\lib\site-packages\setuptools\_distutils\dist.py", line 1021, in run_command cmd_obj.run() File "E:\Python310\lib\site-packages\setuptools\command\develop.py", line 39, in run subprocess.check_call(cmd) File "E:\Python310\lib\subprocess.py", line 369, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command &#39;[&#39;E:\\Python310\\python.exe&#39;, &#39;-m&#39;, &#39;pip&#39;, &#39;install&#39;, &#39;-e&#39;, &#39;.&#39;, &#39;--use-pep517&#39;, &#39;--no-deps&#39;]&#39; returned non-zero exit status 1. [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ✅ pth_fix插件安装完成 PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> # 3. 验证环境 PS C:\Users\Administrator\Desktop> Test-FullEnvironment -PythonPath "E:\Python310" PyTorch: 2.0.0+cpu TorchVision: 0.15.1+cpu TorchAudio: 2.0.1+cpu NumPy: 1.26.4 Audio Backend: soundfile ModelScope: 1.29.0 ✅ 环境无警告 ⚠️ 发现.pth文件: E:\Python310\Lib\site-packages\distutils-precedence.pth <string>:1: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81. ✅ 安装命令挂钩: setuptools.command.install PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> # 4. 测试修复持久性 PS C:\Users\Administrator\Desktop> python -m pip install --upgrade setuptools --force-reinstall Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting setuptools Using cached https://pypi.tuna.tsinghua.edu.cn/packages/a3/dc/17031897dae0efacfea57dfd3a82fdd2a2aeb58e0ff71b77b87e44edc772/setuptools-80.9.0-py3-none-any.whl (1.2 MB) Installing collected packages: setuptools Attempting uninstall: setuptools Found existing installation: setuptools 80.9.0 Uninstalling setuptools-80.9.0: Successfully uninstalled setuptools-80.9.0 Successfully installed setuptools-80.9.0 PS C:\Users\Administrator\Desktop> Test-FullEnvironment -PythonPath "E:\Python310" PyTorch: 2.0.0+cpu TorchVision: 0.15.1+cpu TorchAudio: 2.0.1+cpu NumPy: 1.26.4 Audio Backend: soundfile ModelScope: 1.29.0 ✅ 环境无警告 ⚠️ 发现.pth文件: E:\Python310\Lib\site-packages\distutils-precedence.pth <string>:1: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81. ✅ 安装命令挂钩: setuptools.command.install PS C:\Users\Administrator\Desktop> # 清理旧插件 PS C:\Users\Administrator\Desktop> 🔧 删除旧插件目录: E:\Python310\Lib\site-packages\pth_fix_plugin 🔧 : 无法将“🔧”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然 后再试一次。 所在位置 行:1 字符: 1 + 🔧 删除旧插件目录: E:\Python310\Lib\site-packages\pth_fix_plugin + ~~ + CategoryInfo : ObjectNotFound: (🔧:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> # 安装新插件 PS C:\Users\Administrator\Desktop> ✅ pth_fix插件安装完成 ✅ : 无法将“✅”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后 再试一次。 所在位置 行:1 字符: 1 + ✅ pth_fix插件安装完成 + ~ + CategoryInfo : ObjectNotFound: (✅:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> # 验证环境 PS C:\Users\Administrator\Desktop> PyTorch: 2.0.0+cpu PyTorch: : 无法将“PyTorch:”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保 路径正确,然后再试一次。 所在位置 行:1 字符: 1 + PyTorch: 2.0.0+cpu + ~~~~~~~~ + CategoryInfo : ObjectNotFound: (PyTorch::String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException PS C:\Users\Administrator\Desktop> TorchVision: 0.15.1+cpu TorchVision: : 无法将“TorchVision:”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径 ,请确保路径正确,然后再试一次。 所在位置 行:1 字符: 1 + TorchVision: 0.15.1+cpu + ~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (TorchVision::String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException PS C:\Users\Administrator\Desktop> TorchAudio: 2.0.1+cpu TorchAudio: : 无法将“TorchAudio:”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径, 请确保路径正确,然后再试一次。 所在位置 行:1 字符: 1 + TorchAudio: 2.0.1+cpu + ~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (TorchAudio::String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException PS C:\Users\Administrator\Desktop> NumPy: 1.26.4 NumPy: : 无法将“NumPy:”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径 正确,然后再试一次。 所在位置 行:1 字符: 1 + NumPy: 1.26.4 + ~~~~~~ + CategoryInfo : ObjectNotFound: (NumPy::String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException PS C:\Users\Administrator\Desktop> Audio Backend: soundfile Audio : 无法将“Audio”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正 确,然后再试一次。 所在位置 行:1 字符: 1 + Audio Backend: soundfile + ~~~~~ + CategoryInfo : ObjectNotFound: (Audio:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException PS C:\Users\Administrator\Desktop> ModelScope: 1.29.0 ModelScope: : 无法将“ModelScope:”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径, 请确保路径正确,然后再试一次。 所在位置 行:1 字符: 1 + ModelScope: 1.29.0 + ~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (ModelScope::String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException PS C:\Users\Administrator\Desktop> ✅ 环境无警告 ✅ : 无法将“✅”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后 再试一次。 所在位置 行:1 字符: 1 + ✅ 环境无警告 + ~ + CategoryInfo : ObjectNotFound: (✅:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException PS C:\Users\Administrator\Desktop> ✅ 未发现distutils-precedence.pth文件 ✅ : 无法将“✅”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后 再试一次。 所在位置 行:1 字符: 1 + ✅ 未发现distutils-precedence.pth文件 + ~ + CategoryInfo : ObjectNotFound: (✅:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException PS C:\Users\Administrator\Desktop> ✅ 安装命令挂钩: pth_fix_plugin ✅ : 无法将“✅”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后 再试一次。 所在位置 行:1 字符: 1 + ✅ 安装命令挂钩: pth_fix_plugin + ~ + CategoryInfo : ObjectNotFound: (✅:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> # 测试持久性 PS C:\Users\Administrator\Desktop> Successfully installed setuptools-80.9.0 Successfully : 无法将“Successfully”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径 ,请确保路径正确,然后再试一次。 所在位置 行:1 字符: 1 + Successfully installed setuptools-80.9.0 + ~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Successfully:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException PS C:\Users\Administrator\Desktop> PyTorch: 2.0.0+cpu PyTorch: : 无法将“PyTorch:”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保 路径正确,然后再试一次。 所在位置 行:1 字符: 1 + PyTorch: 2.0.0+cpu + ~~~~~~~~ + CategoryInfo : ObjectNotFound: (PyTorch::String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException PS C:\Users\Administrator\Desktop> TorchVision: 0.15.1+cpu TorchVision: : 无法将“TorchVision:”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径 ,请确保路径正确,然后再试一次。 所在位置 行:1 字符: 1 + TorchVision: 0.15.1+cpu + ~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (TorchVision::String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException PS C:\Users\Administrator\Desktop> TorchAudio: 2.0.1+cpu TorchAudio: : 无法将“TorchAudio:”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径, 请确保路径正确,然后再试一次。 所在位置 行:1 字符: 1 + TorchAudio: 2.0.1+cpu + ~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (TorchAudio::String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException PS C:\Users\Administrator\Desktop> NumPy: 1.26.4 NumPy: : 无法将“NumPy:”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径 正确,然后再试一次。 所在位置 行:1 字符: 1 + NumPy: 1.26.4 + ~~~~~~ + CategoryInfo : ObjectNotFound: (NumPy::String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException PS C:\Users\Administrator\Desktop> Audio Backend: soundfile Audio : 无法将“Audio”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正 确,然后再试一次。 所在位置 行:1 字符: 1 + Audio Backend: soundfile + ~~~~~ + CategoryInfo : ObjectNotFound: (Audio:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException PS C:\Users\Administrator\Desktop> ModelScope: 1.29.0 ModelScope: : 无法将“ModelScope:”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径, 请确保路径正确,然后再试一次。 所在位置 行:1 字符: 1 + ModelScope: 1.29.0 + ~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (ModelScope::String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException PS C:\Users\Administrator\Desktop> ✅ 环境无警告 ✅ : 无法将“✅”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后 再试一次。 所在位置 行:1 字符: 1 + ✅ 环境无警告 + ~ + CategoryInfo : ObjectNotFound: (✅:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException PS C:\Users\Administrator\Desktop> ✅ 未发现distutils-precedence.pth文件 ✅ : 无法将“✅”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后 再试一次。 所在位置 行:1 字符: 1 + ✅ 未发现distutils-precedence.pth文件 + ~ + CategoryInfo : ObjectNotFound: (✅:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException PS C:\Users\Administrator\Desktop> ✅ 安装命令挂钩: pth_fix_plugin ✅ : 无法将“✅”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后 再试一次。 所在位置 行:1 字符: 1 + ✅ 安装命令挂钩: pth_fix_plugin + ~ + CategoryInfo : ObjectNotFound: (✅:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException PS C:\Users\Administrator\Desktop>
08-23
PS C:\Users\Administrator\Desktop> # ===== 创建永久修复插件 ===== PS C:\Users\Administrator\Desktop> function Install-PthFixPlugin { >> param( >> [string]$PythonPath = "E:\Python310" >> ) >> >> $sitePackages = "$PythonPath\Lib\site-packages" >> $pluginDir = "$sitePackages\pth_fix_plugin" >> $pluginFile = "$pluginDir\__init__.py" >> >> # 创建插件目录 >> if (-not (Test-Path $pluginDir)) { >> New-Item -ItemType Directory -Path $pluginDir -Force | Out-Null >> } >> >> # 创建插件内容 >> @" >> # pth_fix_plugin/__init__.py >> import os >> import sys >> import logging >> from setuptools import setup >> from setuptools.command.install import install >> >> logger = logging.getLogger(__name__) >> >> class CustomInstallCommand(install): >> """自定义安装命令,阻止生成distutils-precedence.pth文件""" >> >> def run(self): >> # 调用原始安装方法 >> install.run(self) >> >> # 修复.pth文件 >> self.fix_pth_file() >> >> def fix_pth_file(self): >> """修复.pth文件问题""" >> pth_path = os.path.join(self.install_lib, &#39;distutils-precedence.pth&#39;) >> >> if os.path.exists(pth_path): >> logger.info(f"🔧 删除有问题的.pth文件: {pth_path}") >> try: >> os.remove(pth_path) >> logger.info("✅ 成功删除.pth文件") >> except Exception as e: >> logger.error(f"❌ 删除.pth文件失败: {str(e)}") >> else: >> logger.info("✅ 未发现.pth文件,无需修复") >> >> # 注册自定义命令 >> try: >> setup.commands[&#39;install&#39;] = CustomInstallCommand >> logger.info("✅ 成功注册pth_fix插件") >> except Exception as e: >> logger.error(f"❌ 注册插件失败: {str(e)}") >> "@ | Set-Content -Path $pluginFile -Force >> >> # 创建入口点配置 >> $setupFile = "$pluginDir\setup.py" >> @" >> from setuptools import setup >> >> setup( >> name=&#39;pth_fix_plugin&#39;, >> version=&#39;1.0.0&#39;, >> packages=[&#39;pth_fix_plugin&#39;], >> entry_points={ >> &#39;distutils.commands&#39;: [ >> &#39;install = pth_fix_plugin:CustomInstallCommand&#39;, >> ], >> }, >> ) >> "@ | Set-Content -Path $setupFile -Force >> >> # 安装插件 >> Push-Location -Path $pluginDir >> python -m pip install --no-deps -e . --no-warn-script-location >> Pop-Location >> >> Write-Host "✅ pth_fix插件安装完成" -ForegroundColor Green >> } PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> # ===== 更新修复函数 ===== PS C:\Users\Administrator\Desktop> function Repair-PthFiles { >> param( >> [string]$PythonPath = "E:\Python310" >> ) >> >> $sitePackages = "$PythonPath\Lib\site-packages" >> >> # 1. 删除现有的.pth文件 >> $pthFile = "$sitePackages\distutils-precedence.pth" >> if (Test-Path $pthFile) { >> Write-Host "🔧 删除现有.pth文件: $pthFile" -ForegroundColor Cyan >> Remove-Item $pthFile -Force >> } >> >> # 2. 安装插件 >> Install-PthFixPlugin -PythonPath $PythonPath >> >> # 3. 确保setuptools是最新版本 >> python -m pip install --upgrade "setuptools>=65.0.0" --no-warn-script-location >> >> Write-Host "✅ .pth文件问题已永久解决" -ForegroundColor Green >> } PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> # ===== 更新环境验证函数 ===== PS C:\Users\Administrator\Desktop> function Test-FullEnvironment { >> param( >> [string]$PythonPath = "E:\Python310" >> ) >> >> # 验证核心组件 >> python -c "import torch, torchvision, torchaudio, numpy as np, modelscope; print(f&#39;PyTorch: {torch.__version__}\nTorchVision: {torchvision.__version__}\nTorchAudio: {torchaudio.__version__}\nNumPy: {np.__version__}\nAudio Backend: {torchaudio.get_audio_backend()}\nModelScope: {modelscope.__version__}&#39;)" >> >> # 验证警告 >> python -c "import warnings; warnings.filterwarnings(&#39;error&#39;); import modelscope" 2>&1 | Out-Null >> if ($LASTEXITCODE -eq 0) { >> Write-Host "✅ 环境无警告" -ForegroundColor Green >> } else { >> Write-Host "❌ 环境存在警告" -ForegroundColor Red >> } >> >> # 验证.pth文件 >> $sitePackages = "$PythonPath\Lib\site-packages" >> if (Test-Path $sitePackages) { >> $pthFiles = Get-ChildItem $sitePackages -Filter "distutils-precedence.pth" -ErrorAction SilentlyContinue >> >> if ($pthFiles) { >> Write-Host "⚠️ 发现.pth文件: $($pthFiles.FullName)" -ForegroundColor Yellow >> } else { >> Write-Host "✅ 未发现distutils-precedence.pth文件" -ForegroundColor Green >> } >> >> # 验证插件状态 >> $pluginPath = "$sitePackages\pth_fix_plugin.egg-link" >> if (Test-Path $pluginPath) { >> Write-Host "✅ pth_fix插件已安装" -ForegroundColor Green >> >> # 验证插件激活 >> python -c "import sys; from pkg_resources import iter_entry_points; entry_points = list(iter_entry_points(&#39;distutils.commands&#39;, &#39;install&#39;)); print(&#39;✅ 安装命令挂钩:&#39;, entry_points[0].module_name) if entry_points else print(&#39;❌ 安装命令未挂钩&#39;)" >> } else { >> Write-Host "⚠️ pth_fix插件未安装" -ForegroundColor Yellow >> } >> } else { >> Write-Host "❌ 路径不存在: $sitePackages" -ForegroundColor Red >> } >> } PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> # ===== 执行最终修复 ===== PS C:\Users\Administrator\Desktop> Repair-PthFiles -PythonPath "E:\Python310" 🔧 删除现有.pth文件: E:\Python310\Lib\site-packages\distutils-precedence.pth Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Obtaining file:///E:/Python310/Lib/site-packages/pth_fix_plugin Preparing metadata (setup.py) ... error error: subprocess-exited-with-error × python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [8 lines of output] running egg_info creating C:\Users\Administrator\AppData\Local\Temp\pip-pip-egg-info-ejtt8jui\pth_fix_plugin.egg-info writing C:\Users\Administrator\AppData\Local\Temp\pip-pip-egg-info-ejtt8jui\pth_fix_plugin.egg-info\PKG-INFO writing dependency_links to C:\Users\Administrator\AppData\Local\Temp\pip-pip-egg-info-ejtt8jui\pth_fix_plugin.egg-info\dependency_links.txt writing entry points to C:\Users\Administrator\AppData\Local\Temp\pip-pip-egg-info-ejtt8jui\pth_fix_plugin.egg-info\entry_points.txt writing top-level names to C:\Users\Administrator\AppData\Local\Temp\pip-pip-egg-info-ejtt8jui\pth_fix_plugin.egg-info\top_level.txt writing manifest file &#39;C:\Users\Administrator\AppData\Local\Temp\pip-pip-egg-info-ejtt8jui\pth_fix_plugin.egg-info\SOURCES.txt&#39; error: package directory &#39;pth_fix_plugin&#39; does not exist [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. ✅ pth_fix插件安装完成 Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Requirement already satisfied: setuptools>=65.0.0 in e:\python310\lib\site-packages (80.9.0) ✅ .pth文件问题已永久解决 PS C:\Users\Administrator\Desktop> Test-FullEnvironment -PythonPath "E:\Python310" PyTorch: 2.0.0+cpu TorchVision: 0.15.1+cpu TorchAudio: 2.0.1+cpu NumPy: 1.26.4 Audio Backend: soundfile ModelScope: 1.29.0 ✅ 环境无警告 ✅ 未发现distutils-precedence.pth文件 ⚠️ pth_fix插件未安装 PS C:\Users\Administrator\Desktop> # 1. 执行修复 PS C:\Users\Administrator\Desktop> Repair-PthFiles -PythonPath "E:\Python310" Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Obtaining file:///E:/Python310/Lib/site-packages/pth_fix_plugin Preparing metadata (setup.py) ... error error: subprocess-exited-with-error × python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [8 lines of output] running egg_info creating C:\Users\Administrator\AppData\Local\Temp\pip-pip-egg-info-xknfiq1l\pth_fix_plugin.egg-info writing C:\Users\Administrator\AppData\Local\Temp\pip-pip-egg-info-xknfiq1l\pth_fix_plugin.egg-info\PKG-INFO writing dependency_links to C:\Users\Administrator\AppData\Local\Temp\pip-pip-egg-info-xknfiq1l\pth_fix_plugin.egg-info\dependency_links.txt writing entry points to C:\Users\Administrator\AppData\Local\Temp\pip-pip-egg-info-xknfiq1l\pth_fix_plugin.egg-info\entry_points.txt writing top-level names to C:\Users\Administrator\AppData\Local\Temp\pip-pip-egg-info-xknfiq1l\pth_fix_plugin.egg-info\top_level.txt writing manifest file &#39;C:\Users\Administrator\AppData\Local\Temp\pip-pip-egg-info-xknfiq1l\pth_fix_plugin.egg-info\SOURCES.txt&#39; error: package directory &#39;pth_fix_plugin&#39; does not exist [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. ✅ pth_fix插件安装完成 Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Requirement already satisfied: setuptools>=65.0.0 in e:\python310\lib\site-packages (80.9.0) ✅ .pth文件问题已永久解决 PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> # 2. 验证环境 PS C:\Users\Administrator\Desktop> Test-FullEnvironment -PythonPath "E:\Python310" PyTorch: 2.0.0+cpu TorchVision: 0.15.1+cpu TorchAudio: 2.0.1+cpu NumPy: 1.26.4 Audio Backend: soundfile ModelScope: 1.29.0 ✅ 环境无警告 ✅ 未发现distutils-precedence.pth文件 ⚠️ pth_fix插件未安装 PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> # 3. 测试修复持久性 PS C:\Users\Administrator\Desktop> python -m pip install --upgrade setuptools --force-reinstall Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting setuptools Using cached https://pypi.tuna.tsinghua.edu.cn/packages/a3/dc/17031897dae0efacfea57dfd3a82fdd2a2aeb58e0ff71b77b87e44edc772/setuptools-80.9.0-py3-none-any.whl (1.2 MB) Installing collected packages: setuptools Attempting uninstall: setuptools Found existing installation: setuptools 80.9.0 Uninstalling setuptools-80.9.0: Successfully uninstalled setuptools-80.9.0 Successfully installed setuptools-80.9.0 PS C:\Users\Administrator\Desktop> Test-FullEnvironment -PythonPath "E:\Python310" PyTorch: 2.0.0+cpu TorchVision: 0.15.1+cpu TorchAudio: 2.0.1+cpu NumPy: 1.26.4 Audio Backend: soundfile ModelScope: 1.29.0 ✅ 环境无警告 ⚠️ 发现.pth文件: E:\Python310\Lib\site-packages\distutils-precedence.pth ⚠️ pth_fix插件未安装 PS C:\Users\Administrator\Desktop>
08-23
Set-PythonEnv: C:\Users\Administrator\Documents\PowerShell\Microsoft.PowerShell_profile.ps1:5 Line | 5 | Set-PythonEnv -EnvName global | ~~~~~~~~~~~~~ | The term &#39;Set-PythonEnv&#39; is not recognized as a name of a cmdlet, function, script file, or executable program. | Check the spelling of the name, or if a path was included, verify that the path is correct and try again. Set-PythonEnv: C:\Users\Administrator\Documents\PowerShell\Microsoft.PowerShell_profile.ps1:5 Line | 5 | Set-PythonEnv -EnvName global | ~~~~~~~~~~~~~ | The term &#39;Set-PythonEnv&#39; is not recognized as a name of a cmdlet, function, script file, or executable program. | Check the spelling of the name, or if a path was included, verify that the path is correct and try again. PS C:\Users\Administrator\Desktop> cd E:\PyTorch_Build\pytorch PS E:\PyTorch_Build\pytorch> python -m venv rtx5070_env Error: [Errno 13] Permission denied: &#39;E:\\PyTorch_Build\\pytorch\\rtx5070_env\\Scripts\\python.exe&#39; PS E:\PyTorch_Build\pytorch> .\rtx5070_env\Scripts\activate (rtx5070_env) PS E:\PyTorch_Build\pytorch> # 1. 修复依赖问题 (rtx5070_env) PS E:\PyTorch_Build\pytorch> .\fix_pytorch_deps.ps1 Set-PythonEnv: E:\PyTorch_Build\pytorch\fix_pytorch_deps.ps1:2 Line | 2 | Set-PythonEnv -EnvName pytorch | ~~~~~~~~~~~~~ | The term &#39;Set-PythonEnv&#39; is not recognized as a name of a cmdlet, function, script file, or executable program. | Check the spelling of the name, or if a path was included, verify that the path is correct and try again. Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting typing-extensions Downloading https://pypi.tuna.tsinghua.edu.cn/packages/18/67/36e9267722cc04a6b9f15c7f3441c2363321a3ea07da7ae0c0707beb2a9c/typing_extensions-4.15.0-py3-none-any.whl (44 kB) Collecting ninja Downloading https://pypi.tuna.tsinghua.edu.cn/packages/29/45/c0adfbfb0b5895aa18cec400c535b4f7ff3e52536e0403602fc1a23f7de9/ninja-1.13.0-py3-none-win_amd64.whl (309 kB) Installing collected packages: typing-extensions, ninja Attempting uninstall: typing-extensions Found existing installation: typing_extensions 4.15.0 Uninstalling typing_extensions-4.15.0: Successfully uninstalled typing_extensions-4.15.0 Attempting uninstall: ninja Found existing installation: ninja 1.13.0 Uninstalling ninja-1.13.0: Successfully uninstalled ninja-1.13.0 Successfully installed ninja-1.13.0 typing-extensions-4.15.0 Using pip 25.2 from E:\PyTorch_Build\pytorch\rtx5070_env\lib\site-packages\pip (python 3.10) Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Obtaining file:///E:/PyTorch_Build/pytorch Running command Checking if build backend supports build_editable Checking if build backend supports build_editable ... done Running command Preparing editable metadata (pyproject.toml) Building wheel torch-2.9.0a0+git2d31c3d E:\PyTorch_Build\pytorch\rtx5070_env\lib\site-packages\setuptools\config\_apply_pyprojecttoml.py:82: SetuptoolsDeprecationWarning: `project.license` as a TOML table is deprecated !! ******************************************************************************** Please use a simple string containing a SPDX expression for `project.license`. You can also use `project.license-files`. (Both options available on setuptools>=77.0.0). By 2026-Feb-18, you need to update your project and remove deprecated calls or your builds will no longer be supported. See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details. ******************************************************************************** !! corresp(dist, value, root_dir) running dist_info creating C:\Users\Administrator\AppData\Local\Temp\pip-modern-metadata-lws7t0u7\torch.egg-info writing C:\Users\Administrator\AppData\Local\Temp\pip-modern-metadata-lws7t0u7\torch.egg-info\PKG-INFO writing dependency_links to C:\Users\Administrator\AppData\Local\Temp\pip-modern-metadata-lws7t0u7\torch.egg-info\dependency_links.txt writing entry points to C:\Users\Administrator\AppData\Local\Temp\pip-modern-metadata-lws7t0u7\torch.egg-info\entry_points.txt writing requirements to C:\Users\Administrator\AppData\Local\Temp\pip-modern-metadata-lws7t0u7\torch.egg-info\requires.txt writing top-level names to C:\Users\Administrator\AppData\Local\Temp\pip-modern-metadata-lws7t0u7\torch.egg-info\top_level.txt writing manifest file &#39;C:\Users\Administrator\AppData\Local\Temp\pip-modern-metadata-lws7t0u7\torch.egg-info\SOURCES.txt&#39; reading manifest file &#39;C:\Users\Administrator\AppData\Local\Temp\pip-modern-metadata-lws7t0u7\torch.egg-info\SOURCES.txt&#39; reading manifest template &#39;MANIFEST.in&#39; warning: no files found matching &#39;BUILD&#39; warning: no files found matching &#39;*.BUILD&#39; warning: no files found matching &#39;BUCK&#39; warning: no files found matching &#39;[Mm]akefile.*&#39; warning: no files found matching &#39;*.[Dd]ockerfile&#39; warning: no files found matching &#39;[Dd]ockerfile.*&#39; warning: no previously-included files matching &#39;*.o&#39; found anywhere in distribution warning: no previously-included files matching &#39;*.obj&#39; found anywhere in distribution warning: no previously-included files matching &#39;*.so&#39; found anywhere in distribution warning: no previously-included files matching &#39;*.a&#39; found anywhere in distribution warning: no previously-included files matching &#39;*.dylib&#39; found anywhere in distribution no previously-included directories found matching &#39;*\.git&#39; warning: no previously-included files matching &#39;*~&#39; found anywhere in distribution warning: no previously-included files matching &#39;*.swp&#39; found anywhere in distribution adding license file &#39;LICENSE&#39; adding license file &#39;NOTICE&#39; writing manifest file &#39;C:\Users\Administrator\AppData\Local\Temp\pip-modern-metadata-lws7t0u7\torch.egg-info\SOURCES.txt&#39; creating &#39;C:\Users\Administrator\AppData\Local\Temp\pip-modern-metadata-lws7t0u7\torch-2.9.0a0+git2d31c3d.dist-info&#39; Preparing editable metadata (pyproject.toml) ... done Collecting filelock (from torch==2.9.0a0+git2d31c3d) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/42/14/42b2651a2f46b022ccd948bca9f2d5af0fd8929c4eec235b8d6d844fbe67/filelock-3.19.1-py3-none-any.whl (15 kB) Requirement already satisfied: typing-extensions>=4.10.0 in e:\pytorch_build\pytorch\rtx5070_env\lib\site-packages (from torch==2.9.0a0+git2d31c3d) (4.15.0) Collecting sympy>=1.13.3 (from torch==2.9.0a0+git2d31c3d) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/a2/09/77d55d46fd61b4a135c444fc97158ef34a095e5681d0a6c10b75bf356191/sympy-1.14.0-py3-none-any.whl (6.3 MB) Link requires a different Python (3.10.10 not in: &#39;>=3.11&#39;): https://pypi.tuna.tsinghua.edu.cn/packages/eb/8d/776adee7bbf76365fdd7f2552710282c79a4ead5d2a46408c9043a2b70ba/networkx-3.5-py3-none-any.whl (from https://pypi.tuna.tsinghua.edu.cn/simple/networkx/) (requires-python:>=3.11) Link requires a different Python (3.10.10 not in: &#39;>=3.11&#39;): https://pypi.tuna.tsinghua.edu.cn/packages/6c/4f/ccdb8ad3a38e583f214547fd2f7ff1fc160c43a75af88e6aec213404b96a/networkx-3.5.tar.gz (from https://pypi.tuna.tsinghua.edu.cn/simple/networkx/) (requires-python:>=3.11) Link requires a different Python (3.10.10 not in: &#39;>=3.11&#39;): https://pypi.tuna.tsinghua.edu.cn/packages/3f/a1/46c1b6e202e3109d2a035b21a7e5534c5bb233ee30752d7f16a0bd4c3989/networkx-3.5rc0-py3-none-any.whl (from https://pypi.tuna.tsinghua.edu.cn/simple/networkx/) (requires-python:>=3.11) Link requires a different Python (3.10.10 not in: &#39;>=3.11&#39;): https://pypi.tuna.tsinghua.edu.cn/packages/90/7e/0319606a20ced20730806b9f7fe91d8a92f7da63d76a5c388f87d3f7d294/networkx-3.5rc0.tar.gz (from https://pypi.tuna.tsinghua.edu.cn/simple/networkx/) (requires-python:>=3.11) Collecting networkx>=2.5.1 (from torch==2.9.0a0+git2d31c3d) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/b9/54/dd730b32ea14ea797530a4479b2ed46a6fb250f682a9cfb997e968bf0261/networkx-3.4.2-py3-none-any.whl (1.7 MB) Collecting jinja2 (from torch==2.9.0a0+git2d31c3d) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl (134 kB) Collecting fsspec>=0.8.5 (from torch==2.9.0a0+git2d31c3d) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/47/71/70db47e4f6ce3e5c37a607355f80da8860a33226be640226ac52cb05ef2e/fsspec-2025.9.0-py3-none-any.whl (199 kB) Collecting mpmath<1.4,>=1.1.0 (from sympy>=1.13.3->torch==2.9.0a0+git2d31c3d) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/43/e3/7d92a15f894aa0c9c4b49b8ee9ac9850d6e63b03c9c32c0367a13ae62209/mpmath-1.3.0-py3-none-any.whl (536 kB) Collecting MarkupSafe>=2.0 (from jinja2->torch==2.9.0a0+git2d31c3d) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/44/06/e7175d06dd6e9172d4a69a72592cb3f7a996a9c396eee29082826449bbc3/MarkupSafe-3.0.2-cp310-cp310-win_amd64.whl (15 kB) Building wheels for collected packages: torch Running command Building editable for torch (pyproject.toml) Building wheel torch-2.9.0a0+git2d31c3d -- Building version 2.9.0a0+git2d31c3d Traceback (most recent call last): File "<string>", line 1024, in check_pydep File "E:\Python310\lib\importlib\__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1050, in _gcd_import File "<frozen importlib._bootstrap>", line 1027, in _find_and_load File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked ModuleNotFoundError: No module named &#39;yaml&#39; The above exception was the direct cause of the following exception: Traceback (most recent call last): File "E:\PyTorch_Build\pytorch\rtx5070_env\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 389, in <module> main() File "E:\PyTorch_Build\pytorch\rtx5070_env\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 373, in main json_out["return_val"] = hook(**hook_input["kwargs"]) File "E:\PyTorch_Build\pytorch\rtx5070_env\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 303, in build_editable return hook(wheel_directory, config_settings, metadata_directory) File "E:\PyTorch_Build\pytorch\rtx5070_env\lib\site-packages\setuptools\build_meta.py", line 468, in build_editable return self._build_with_temp_dir( File "E:\PyTorch_Build\pytorch\rtx5070_env\lib\site-packages\setuptools\build_meta.py", line 404, in _build_with_temp_dir self.run_setup() File "E:\PyTorch_Build\pytorch\rtx5070_env\lib\site-packages\setuptools\build_meta.py", line 317, in run_setup exec(code, locals()) File "<string>", line 1750, in <module> File "<string>", line 1628, in main File "<string>", line 971, in build_deps File "<string>", line 1026, in check_pydep RuntimeError: Missing build dependency: Unable to `import yaml`. Please install it via `conda install pyyaml` or `pip install pyyaml` error: subprocess-exited-with-error × Building editable for torch (pyproject.toml) 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. full command: &#39;E:\PyTorch_Build\pytorch\rtx5070_env\Scripts\python.exe&#39; &#39;E:\PyTorch_Build\pytorch\rtx5070_env\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py&#39; build_editable &#39;C:\Users\ADMINI~1\AppData\Local\Temp\tmp54c6camf&#39; cwd: E:\PyTorch_Build\pytorch Building editable for torch (pyproject.toml) ... error ERROR: Failed building editable for torch Failed to build torch error: failed-wheel-build-for-install × Failed to build installable wheels for some pyproject.toml based projects ╰─> torch (rtx5070_env) PS E:\PyTorch_Build\pytorch> (rtx5070_env) PS E:\PyTorch_Build\pytorch> # 2. 验证环境状态 (rtx5070_env) PS E:\PyTorch_Build\pytorch> .\venv_validator.ps1 ❌ 错误的环境路径: E:\PyTorch_Build\pytorch\rtx5070_env False (rtx5070_env) PS E:\PyTorch_Build\pytorch> (rtx5070_env) PS E:\PyTorch_Build\pytorch> # 如果第2步失败,执行系统级修复 (rtx5070_env) PS E:\PyTorch_Build\pytorch> .\system_env_fixer.ps1 Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Requirement already satisfied: pip in e:\pytorchbuild_secure\rtx5070_env\lib\site-packages (22.3.1) Collecting pip Using cached https://pypi.tuna.tsinghua.edu.cn/packages/b7/3f/945ef7ab14dc4f9d7f40288d2df998d1837ee0888ec3659c813487572faa/pip-25.2-py3-none-any.whl (1.8 MB) Requirement already satisfied: setuptools in e:\pytorchbuild_secure\rtx5070_env\lib\site-packages (65.5.0) Collecting setuptools Using cached https://pypi.tuna.tsinghua.edu.cn/packages/a3/dc/17031897dae0efacfea57dfd3a82fdd2a2aeb58e0ff71b77b87e44edc772/setuptools-80.9.0-py3-none-any.whl (1.2 MB) Collecting wheel Using cached https://pypi.tuna.tsinghua.edu.cn/packages/0b/2c/87f3254fd8ffd29e4c02732eee68a83a1d3c346ae39bc6822dcbcb697f2b/wheel-0.45.1-py3-none-any.whl (72 kB) Installing collected packages: wheel, setuptools, pip Attempting uninstall: setuptools Found existing installation: setuptools 65.5.0 Uninstalling setuptools-65.5.0: Successfully uninstalled setuptools-65.5.0 Attempting uninstall: pip Found existing installation: pip 22.3.1 Uninstalling pip-22.3.1: Successfully uninstalled pip-22.3.1 Successfully installed pip-25.2 setuptools-80.9.0 wheel-0.45.1 Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting typing-extensions Using cached https://pypi.tuna.tsinghua.edu.cn/packages/18/67/36e9267722cc04a6b9f15c7f3441c2363321a3ea07da7ae0c0707beb2a9c/typing_extensions-4.15.0-py3-none-any.whl (44 kB) Collecting ninja Using cached https://pypi.tuna.tsinghua.edu.cn/packages/29/45/c0adfbfb0b5895aa18cec400c535b4f7ff3e52536e0403602fc1a23f7de9/ninja-1.13.0-py3-none-win_amd64.whl (309 kB) Installing collected packages: typing-extensions, ninja Successfully installed ninja-1.13.0 typing-extensions-4.15.0 Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Obtaining file:///E:/PyTorch_Build/pytorch Checking if build backend supports build_editable ... done Preparing editable metadata (pyproject.toml) ... done Collecting filelock (from torch==2.9.0a0+git2d31c3d) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/42/14/42b2651a2f46b022ccd948bca9f2d5af0fd8929c4eec235b8d6d844fbe67/filelock-3.19.1-py3-none-any.whl (15 kB) Requirement already satisfied: typing-extensions>=4.10.0 in e:\pytorchbuild_secure\rtx5070_env\lib\site-packages (from torch==2.9.0a0+git2d31c3d) (4.15.0) Collecting sympy>=1.13.3 (from torch==2.9.0a0+git2d31c3d) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/a2/09/77d55d46fd61b4a135c444fc97158ef34a095e5681d0a6c10b75bf356191/sympy-1.14.0-py3-none-any.whl (6.3 MB) Collecting networkx>=2.5.1 (from torch==2.9.0a0+git2d31c3d) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/b9/54/dd730b32ea14ea797530a4479b2ed46a6fb250f682a9cfb997e968bf0261/networkx-3.4.2-py3-none-any.whl (1.7 MB) Collecting jinja2 (from torch==2.9.0a0+git2d31c3d) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl (134 kB) Collecting fsspec>=0.8.5 (from torch==2.9.0a0+git2d31c3d) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/47/71/70db47e4f6ce3e5c37a607355f80da8860a33226be640226ac52cb05ef2e/fsspec-2025.9.0-py3-none-any.whl (199 kB) Collecting mpmath<1.4,>=1.1.0 (from sympy>=1.13.3->torch==2.9.0a0+git2d31c3d) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/43/e3/7d92a15f894aa0c9c4b49b8ee9ac9850d6e63b03c9c32c0367a13ae62209/mpmath-1.3.0-py3-none-any.whl (536 kB) Collecting MarkupSafe>=2.0 (from jinja2->torch==2.9.0a0+git2d31c3d) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/44/06/e7175d06dd6e9172d4a69a72592cb3f7a996a9c396eee29082826449bbc3/MarkupSafe-3.0.2-cp310-cp310-win_amd64.whl (15 kB) Building wheels for collected packages: torch Building editable for torch (pyproject.toml) ... error error: subprocess-exited-with-error × Building editable for torch (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [32 lines of output] Building wheel torch-2.9.0a0+git2d31c3d -- Building version 2.9.0a0+git2d31c3d Traceback (most recent call last): File "<string>", line 1024, in check_pydep File "E:\Python310\lib\importlib\__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1050, in _gcd_import File "<frozen importlib._bootstrap>", line 1027, in _find_and_load File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked ModuleNotFoundError: No module named &#39;yaml&#39; The above exception was the direct cause of the following exception: Traceback (most recent call last): File "E:\PyTorchBuild_Secure\rtx5070_env\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 389, in <module> main() File "E:\PyTorchBuild_Secure\rtx5070_env\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 373, in main json_out["return_val"] = hook(**hook_input["kwargs"]) File "E:\PyTorchBuild_Secure\rtx5070_env\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 303, in build_editable return hook(wheel_directory, config_settings, metadata_directory) File "E:\PyTorchBuild_Secure\rtx5070_env\lib\site-packages\setuptools\build_meta.py", line 468, in build_editable return self._build_with_temp_dir( File "E:\PyTorchBuild_Secure\rtx5070_env\lib\site-packages\setuptools\build_meta.py", line 404, in _build_with_temp_dir self.run_setup() File "E:\PyTorchBuild_Secure\rtx5070_env\lib\site-packages\setuptools\build_meta.py", line 317, in run_setup exec(code, locals()) File "<string>", line 1750, in <module> File "<string>", line 1628, in main File "<string>", line 971, in build_deps File "<string>", line 1026, in check_pydep RuntimeError: Missing build dependency: Unable to `import yaml`. Please install it via `conda install pyyaml` or `pip install pyyaml` [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building editable for torch Failed to build torch error: failed-wheel-build-for-install × Failed to build installable wheels for some pyproject.toml based projects ╰─> torch Test-VirtualEnv: E:\PyTorch_Build\pytorch\system_env_fixer.ps1:30 Line | 30 | Test-VirtualEnv | ~~~~~~~~~~~~~~~ | The term &#39;Test-VirtualEnv&#39; is not recognized as a name of a cmdlet, function, script file, or executable | program. Check the spelling of the name, or if a path was included, verify that the path is correct and try | again. (rtx5070_env) PS E:\PyTorch_Build\pytorch> (rtx5070_env) PS E:\PyTorch_Build\pytorch> # 最终测试 (rtx5070_env) PS E:\PyTorch_Build\pytorch> python -c "import torch; print(f&#39;CUDA可用: {torch.cuda.is_available()}&#39;)" Traceback (most recent call last): File "<string>", line 1, in <module> File "E:\PyTorch_Build\pytorch\torch\__init__.py", line 1001, in <module> raise ImportError( ImportError: Failed to load PyTorch C extensions: It appears that PyTorch has loaded the `torch/_C` folder of the PyTorch repository rather than the C extensions which are expected in the `torch._C` namespace. This can occur when using the `install` workflow. e.g. $ python -m pip install --no-build-isolation -v . && python -c "import torch" This error can generally be solved using the `develop` workflow $ python -m pip install --no-build-isolation -v -e . && python -c "import torch" # This should succeed or by running Python from a different directory. (rtx5070_env) PS E:\PyTorch_Build\pytorch> python -c "import torch; x = torch.rand(5, device=&#39;cuda&#39;); print(x)" Traceback (most recent call last): File "<string>", line 1, in <module> File "E:\PyTorch_Build\pytorch\torch\__init__.py", line 1001, in <module> raise ImportError( ImportError: Failed to load PyTorch C extensions: It appears that PyTorch has loaded the `torch/_C` folder of the PyTorch repository rather than the C extensions which are expected in the `torch._C` namespace. This can occur when using the `install` workflow. e.g. $ python -m pip install --no-build-isolation -v . && python -c "import torch" This error can generally be solved using the `develop` workflow $ python -m pip install --no-build-isolation -v -e . && python -c "import torch" # This should succeed or by running Python from a different directory. (rtx5070_env) PS E:\PyTorch_Build\pytorch> # 检查Python环境 (rtx5070_env) PS E:\PyTorch_Build\pytorch> python -c "import sys; print(f&#39;\nPython路径: {sys.prefix}\n模块搜索路径:&#39;)" Python路径: E:\PyTorchBuild_Secure\rtx5070_env 模块搜索路径: (rtx5070_env) PS E:\PyTorch_Build\pytorch> python -c "import sys; print(&#39;\n&#39;.join(sys.path))" E:\Python310\python310.zip E:\Python310\DLLs E:\Python310\lib E:\Python310 E:\PyTorchBuild_Secure\rtx5070_env E:\PyTorchBuild_Secure\rtx5070_env\lib\site-packages (rtx5070_env) PS E:\PyTorch_Build\pytorch> (rtx5070_env) PS E:\PyTorch_Build\pytorch> # 检查PyTorch构建 (rtx5070_env) PS E:\PyTorch_Build\pytorch> python -c "import torch; print(f&#39;\nCUDA可用: {torch.cuda.is_available()}&#39;)" Traceback (most recent call last): File "<string>", line 1, in <module> File "E:\PyTorch_Build\pytorch\torch\__init__.py", line 1001, in <module> raise ImportError( ImportError: Failed to load PyTorch C extensions: It appears that PyTorch has loaded the `torch/_C` folder of the PyTorch repository rather than the C extensions which are expected in the `torch._C` namespace. This can occur when using the `install` workflow. e.g. $ python -m pip install --no-build-isolation -v . && python -c "import torch" This error can generally be solved using the `develop` workflow $ python -m pip install --no-build-isolation -v -e . && python -c "import torch" # This should succeed or by running Python from a different directory. (rtx5070_env) PS E:\PyTorch_Build\pytorch> python -c "from torch.utils.cpp_extension import CUDA_HOME; print(f&#39;\nCUDA_HOME: {CUDA_HOME}&#39;)" Traceback (most recent call last): File "<string>", line 1, in <module> File "E:\PyTorch_Build\pytorch\torch\__init__.py", line 1001, in <module> raise ImportError( ImportError: Failed to load PyTorch C extensions: It appears that PyTorch has loaded the `torch/_C` folder of the PyTorch repository rather than the C extensions which are expected in the `torch._C` namespace. This can occur when using the `install` workflow. e.g. $ python -m pip install --no-build-isolation -v . && python -c "import torch" This error can generally be solved using the `develop` workflow $ python -m pip install --no-build-isolation -v -e . && python -c "import torch" # This should succeed or by running Python from a different directory. (rtx5070_env) PS E:\PyTorch_Build\pytorch> (rtx5070_env) PS E:\PyTorch_Build\pytorch> # 检查关键模块 (rtx5070_env) PS E:\PyTorch_Build\pytorch> python -c "import typing_extensions; print(&#39;\ntyping_extensions版本:&#39;, typing_extensions.__version__)" Traceback (most recent call last): File "<string>", line 1, in <module> AttributeError: module &#39;typing_extensions&#39; has no attribute &#39;__version__&#39; (rtx5070_env) PS E:\PyTorch_Build\pytorch>
最新发布
09-04
PS C:\Users\Administrator\Desktop> # ===== 修复的验证函数 ===== PS C:\Users\Administrator\Desktop> function Test-FullEnvironment { >> param( >> [string]$PythonPath = "E:\Python310" >> ) >> >> # ... [其他代码不变] ... >> >> # 修复的入口点验证(使用单引号字符串) >> $pluginStatus = python -c @&#39; >> import sys >> import os >> import traceback >> from importlib.metadata import entry_points, distribution >> >> try: >> # 检查插件是否已安装 >> dist = distribution(&#39;pth_fix_plugin&#39;) >> print("Plugin installed: " + dist.metadata[&#39;Name&#39;] + " v" + dist.metadata[&#39;Version&#39;]) >> >> # 检查入口点是否注册 >> install_eps = entry_points(group=&#39;distutils.commands&#39;, name=&#39;install&#39;) >> >> if not install_eps: >> print(&#39;ERROR: No install command entry points found&#39;) >> sys.exit(1) >> >> pth_fix_found = any(&#39;pth_fix_plugin&#39; in ep.value for ep in install_eps) >> >> if pth_fix_found: >> print(&#39;SUCCESS: Install command hook active&#39;) >> else: >> print(&#39;ERROR: Install command not hooked&#39;) >> sys.exit(1) >> >> except Exception as e: >> print(&#39;ERROR: &#39; + str(e)) >> traceback.print_exc() >> sys.exit(1) >> &#39;@ >> >> # ... [其他代码不变] ... >> } PS C:\Users\Administrator\Desktop> # ===== 完整的插件安装函数 ===== PS C:\Users\Administrator\Desktop> function Install-PthFixPlugin { >> param( >> [string]$PythonPath = "E:\Python310" >> ) >> >> $sitePackages = "$PythonPath\Lib\site-packages" >> $pluginRoot = "$sitePackages\pth_fix_plugin" >> >> # 创建插件目录结构 >> $packageDir = "$pluginRoot\pth_fix_plugin" >> New-Item -ItemType Directory -Path $packageDir -Force | Out-Null >> >> # 创建插件内容(增强删除逻辑) >> $pluginFile = "$packageDir\__init__.py" >> @&#39; >> import os >> import sys >> import sysconfig >> import traceback >> import shutil >> import atexit >> import time >> from setuptools.command.install import install >> >> class CustomInstallCommand(install): >> """Custom install command to prevent .pth file generation""" >> >> def run(self): >> # 在安装前先尝试修复 >> self.fix_pth_file() >> >> # 调用原始安装方法 >> install.run(self) >> >> # 安装后再次修复 >> self.fix_pth_file() >> >> # 延迟检查确保完全清理 >> self.schedule_delayed_check() >> >> def fix_pth_file(self): >> """Fix the .pth file issue with enhanced logic""" >> try: >> # 获取所有可能的site-packages路径 >> possible_paths = [ >> sysconfig.get_paths()["purelib"], >> sysconfig.get_paths()["platlib"], >> os.path.join(sys.prefix, "Lib", "site-packages"), >> os.path.join(sys.exec_prefix, "Lib", "site-packages") >> ] >> >> # 去重并添加可能的子目录 >> search_paths = set() >> for path in possible_paths: >> if os.path.exists(path): >> search_paths.add(path) >> # 添加所有子目录 >> search_paths.update( >> os.path.join(path, d) for d in os.listdir(path) >> if os.path.isdir(os.path.join(path, d)) >> ) >> >> # 在所有可能路径中搜索并删除.pth文件 >> removed = False >> for path in search_paths: >> pth_path = os.path.join(path, &#39;distutils-precedence.pth&#39;) >> if os.path.exists(pth_path): >> try: >> # 尝试删除文件 >> os.remove(pth_path) >> print(f"[SUCCESS] Removed .pth file: {pth_path}") >> removed = True >> except Exception as e: >> # 如果删除失败,尝试移动文件 >> try: >> backup_path = pth_path + ".bak" >> shutil.move(pth_path, backup_path) >> print(f"[SUCCESS] Moved .pth file to backup: {backup_path}") >> removed = True >> except Exception as e2: >> # 终极方案:尝试重命名 >> try: >> new_path = pth_path + ".disabled" >> os.rename(pth_path, new_path) >> print(f"[SUCCESS] Disabled .pth file: {new_path}") >> removed = True >> except Exception as e3: >> print(f"[ERROR] Failed to handle .pth file: {str(e3)}") >> traceback.print_exc() >> >> if not removed: >> print("[INFO] No .pth file found in any location") >> >> except Exception as e: >> print(f"[CRITICAL] Error: {str(e)}") >> traceback.print_exc() >> >> def schedule_delayed_check(self): >> """Schedule a delayed check to ensure file is not recreated""" >> def delayed_verification(): >> time.sleep(2) # 等待2秒确保安装完成 >> self.verify_clean_environment() >> >> atexit.register(delayed_verification) >> >> def verify_clean_environment(self): >> """Verify no .pth file exists after installation""" >> for path in [ >> sysconfig.get_paths()["purelib"], >> os.path.join(sys.prefix, "Lib", "site-packages") >> ]: >> pth_path = os.path.join(path, &#39;distutils-precedence.pth&#39;) >> if os.path.exists(pth_path): >> print(f"[WARNING] .pth file still present: {pth_path}") >> # 尝试再次删除 >> try: >> os.remove(pth_path) >> print(f"[SUCCESS] Removed delayed .pth file: {pth_path}") >> except Exception as e: >> print(f"[ERROR] Failed to remove delayed .pth file: {str(e)}") >> &#39;@ | Set-Content -Path $pluginFile -Encoding ASCII -Force >> >> # 创建入口点配置 >> $setupFile = "$pluginRoot\setup.py" >> @&#39; >> from setuptools import setup >> >> setup( >> name=&#39;pth_fix_plugin&#39;, >> version=&#39;1.0.0&#39;, >> packages=[&#39;pth_f极_plugin&#39;], >> entry_points={ >> &#39;distutils.commands&#39;: [ >> &#39;install = pth_fix_plugin:CustomInstallCommand&#39;, >> ], >> }, >> ) >> &#39;@ | Set-Content -Path $setupFile -Encoding ASCII -Force >> >> # 创建pyproject.toml文件 >> $pyprojectFile = "$pluginRoot\pyproject.toml" >> @&#39; >> [build-system] >> requires = ["setuptools>=40.8.0", "wheel"] >> build-backend = "setuptools.build_meta" >> &#39;@ | Set-Content -Path $pyprojectFile -Encoding ASCII -Force >> >> # 安装插件 >> Push-Location -Path $pluginRoot >> try { >> # 使用常规模式安装 >> python -m pip install . --no-deps --force-reinstall --no-warn-script-location >> } catch { >> Write-Host "❌ Failed to install plugin: $_" -ForegroundColor Red >> } >> Pop-Location >> >> Write-Host "✅ pth_fix plugin installed successfully" -ForegroundColor Green >> } PS C:\Users\Administrator\Desktop> # 1. 定义函数(执行上述两个函数定义) PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> # 2. 卸载现有插件 PS C:\Users\Administrator\Desktop> python -m pip uninstall -y pth_fix_plugin WARNING: Skipping pth_fix_plugin as it is not installed. PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> # 3. 确保插件目录完全删除 PS C:\Users\Administrator\Desktop> $pluginPath = "E:\Python310\Lib\site-packages\pth_fix_plugin" PS C:\Users\Administrator\Desktop> if (Test-Path $pluginPath) { >> Remove-Item -Path $pluginPath -Recurse -Force >> Write-Host "Removed old plugin directory: $pluginPath" -ForegroundColor Cyan >> } PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> # 4. 手动删除所有可能的.pth文件 PS C:\Users\Administrator\Desktop> $searchPaths = @( >> "E:\Python310\Lib\site-packages", >> "E:\Python310\Lib\site-packages\distutils-precedence.pth", >> "E:\Python310\Lib\site-packages\*.dist-info", >> "E:\Python310\Lib\site-packages\*.egg-info" >> ) PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> foreach ($path in $searchPaths) { >> if (Test-Path $path) { >> Get-ChildItem $path -Recurse -Filter "distutils-precedence.pth" | ForEach-Object { >> Remove-Item $_.FullName -Force >> Write-Host "Removed .pth file: $($_.FullName)" -ForegroundColor Yellow >> } >> >> Get-ChildItem $path -Recurse -Filter "distutils-precedence.pth.bak" | ForEach-Object { >> Remove-Item $_.FullName -Force >> Write-Host "Removed backup file: $($_.FullName)" -ForegroundColor DarkYellow >> } >> >> Get-ChildItem $path -Recurse -Filter "distutils-precedence.pth.disabled" | ForEach-Object { >> Remove-Item $_.FullName -Force >> Write-Host "Removed disabled file: $($_.FullName)" -ForegroundColor DarkYellow >> } >> } >> } Removed .pth file: E:\Python310\Lib\site-packages\distutils-precedence.pth PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> # 5. 重新安装插件 PS C:\Users\Administrator\Desktop> Install-PthFixPlugin -PythonPath "E:\Python310" Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Processing e:\python310\lib\site-packages\pth_fix_plugin Installing build dependencies ... done Getting requirements to build wheel ... error error: subprocess-exited-with-error × Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [8 lines of output] running egg_info creating pth_fix_plugin.egg-info writing pth_fix_plugin.egg-info\PKG-INFO writing dependency_links to pth_fix_plugin.egg-info\dependency_links.txt writing entry points to pth_fix_plugin.egg-info\entry_points.txt writing top-level names to pth_fix_plugin.egg-info\top_level.txt writing manifest file &#39;pth_fix_plugin.egg-info\SOURCES.txt&#39; error: package directory &#39;pth_f?_plugin&#39; does not exist [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error × Getting requirements to build wheel 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. ✅ pth_fix plugin installed successfully PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> # 6. 验证环境 PS C:\Users\Administrator\Desktop> Test-FullEnvironment -PythonPath "E:\Python310" File "<string>", line 9 print(Plugin ^ SyntaxError: &#39;(&#39; was never closed PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> # 7. 测试修复持久性 PS C:\Users\Administrator\Desktop> python -m pip install --upgrade setuptools --force-reinstall Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting setuptools Using cached https://pypi.tuna.tsinghua.edu.cn/packages/a3/dc/17031897dae0efacfea57dfd3a82fdd2a2aeb58e0ff71b77b87e44edc772/setuptools-80.9.0-py3-none-any.whl (1.2 MB) Installing collected packages: setuptools Attempting uninstall: setuptools Found existing installation: setuptools 80.9.0 Uninstalling setuptools-80.9.0: Successfully uninstalled setuptools-80.9.0 Successfully installed setuptools-80.9.0 PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> # 8. 重新验证环境 PS C:\Users\Administrator\Desktop> Test-FullEnvironment -PythonPath "E:\Python310" File "<string>", line 9 print(Plugin ^ SyntaxError: &#39;(&#39; was never closed PS C:\Users\Administrator\Desktop> 少个括号啊 大哥 都三次了 你倒是检查一下 然后加上啊!
08-23
(airformer) C:\Users\lenovo\Documents\WeChat Files\wxid_i2lj4bj8hh2v22\FileStorage\File\2025-07\SeaFormer\SeaFormer>pip install numpy scipy Requirement already satisfied: numpy in c:\users\lenovo\.conda\envs\airformer\lib\site-packages (1.24.3) Collecting scipy Using cached scipy-1.10.1-cp38-cp38-win_amd64.whl.metadata (58 kB) Using cached scipy-1.10.1-cp38-cp38-win_amd64.whl (42.2 MB) Installing collected packages: scipy Successfully installed scipy-1.10.1 (airformer) C:\Users\lenovo\Documents\WeChat Files\wxid_i2lj4bj8hh2v22\FileStorage\File\2025-07\SeaFormer\SeaFormer>python ./experiments/airformer/main.py --mode train --gpu 0 --dataset AIR_TINY Traceback (most recent call last): File "./experiments/airformer/main.py", line 14, in <module> from src.utils.helper import get_dataloader, check_device, get_num_nodes ModuleNotFoundError: No module named &#39;src&#39; (airformer) C:\Users\lenovo\Documents\WeChat Files\wxid_i2lj4bj8hh2v22\FileStorage\File\2025-07\SeaFormer\SeaFormer>pip install src Collecting src Downloading src-0.0.7.zip (6.3 kB) Preparing metadata (setup.py) ... done Building wheels for collected packages: src Building wheel for src (setup.py) ... error error: subprocess-exited-with-error × python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [60 lines of output] C:\Users\lenovo\.conda\envs\airformer\lib\site-packages\setuptools\_distutils\dist.py:261: UserWarning: Unknown distribution option: &#39;tests_require&#39; warnings.warn(msg) running bdist_wheel running build running build_py creating build\lib\src copying src\__init__.py -> build\lib\src running egg_info writing src.egg-info\PKG-INFO writing dependency_links to src.egg-info\dependency_links.txt deleting src.egg-info\entry_points.txt writing requirements to src.egg-info\requires.txt writing top-level names to src.egg-info\top_level.txt reading manifest file &#39;src.egg-info\SOURCES.txt&#39; reading manifest template &#39;MANIFEST.in&#39; adding license file &#39;LICENSE.rst&#39; writing manifest file &#39;src.egg-info\SOURCES.txt&#39; C:\Users\lenovo\.conda\envs\airformer\lib\site-packages\setuptools\_distutils\dist.py:932: SetuptoolsDeprecationWarning: setup.py install is deprecated. !! ******************************************************************************** Please avoid running ``setup.py`` directly. Instead, use pypa/build, pypa/installer or other standards-based tools. See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details. ******************************************************************************** !! command.initialize_options() Traceback (most recent call last): File "<string>", line 2, in <module> File "<pip-setuptools-caller>", line 34, in <module> File "C:\Users\lenovo\AppData\Local\Temp\pip-install-lf17u9jc\src_eb337413b1b94c31abdd9318b6b38b79\setup.py", line 70, in <module> setup( File "C:\Users\lenovo\.conda\envs\airformer\lib\site-packages\setuptools\__init__.py", line 117, in setup return distutils.core.setup(**attrs) File "C:\Users\lenovo\.conda\envs\airformer\lib\site-packages\setuptools\_distutils\core.py", line 183, in setup return run_commands(dist) File "C:\Users\lenovo\.conda\envs\airformer\lib\site-packages\setuptools\_distutils\core.py", line 199, in run_commands dist.run_commands() File "C:\Users\lenovo\.conda\envs\airformer\lib\site-packages\setuptools\_distutils\dist.py", line 954, in run_commands self.run_command(cmd) File "C:\Users\lenovo\.conda\envs\airformer\lib\site-packages\setuptools\dist.py", line 999, in run_command super().run_command(command) File "C:\Users\lenovo\.conda\envs\airformer\lib\site-packages\setuptools\_distutils\dist.py", line 973, in run_command cmd_obj.run() File "C:\Users\lenovo\.conda\envs\airformer\lib\site-packages\setuptools\command\bdist_wheel.py", line 412, in run install = self.reinitialize_command("install", reinit_subcommands=True) File "C:\Users\lenovo\.conda\envs\airformer\lib\site-packages\setuptools\__init__.py", line 227, in reinitialize_command cmd = _Command.reinitialize_command(self, command, reinit_subcommands) File "C:\Users\lenovo\.conda\envs\airformer\lib\site-packages\setuptools\_distutils\cmd.py", line 309, in reinitialize_command return self.distribution.reinitialize_command(command, reinit_subcommands) File "C:\Users\lenovo\.conda\envs\airformer\lib\site-packages\setuptools\_distutils\dist.py", line 938, in reinitialize_command for sub in command.get_sub_commands(): File "C:\Users\lenovo\.conda\envs\airformer\lib\site-packages\setuptools\_distutils\cmd.py", line 327, in get_sub_commands if method is None or method(self): File "C:\Users\lenovo\.conda\envs\airformer\lib\site-packages\setuptools\_distutils\command\install.py", line 785, in has_lib self.distribution.has_pure_modules() or self.distribution.has_ext_modules() AttributeError: &#39;NoneType&#39; object has no attribute &#39;has_pure_modules&#39; [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for src Running setup.py clean for src Failed to build src ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (src)
07-23
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值