我试图导入品红使用波网络,但它总是失败,我无法在网上找到任何有用的信息。它一直给我这个错误信息
Building wheels for collected packages: numba, python-rtmidi, llvmlite
Building wheel for numba (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [14 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:Users13003AppDataLocalTemppip-install-417gts98numba_d67d4f03411546d299e8418ef12a08c5setup.py", line 358, in <module>
metadata['ext_modules'] = get_ext_modules()
File "C:Users13003AppDataLocalTemppip-install-417gts98numba_d67d4f03411546d299e8418ef12a08c5setup.py", line 94, in get_ext_modules
import numpy.distutils.misc_util as np_misc
File "D:Anacondaenvsvenvlibsite-packagesnumpydistutils__init__.py", line 24, in <module>
from . import ccompiler
File "D:Anacondaenvsvenvlibsite-packagesnumpydistutilsccompiler.py", line 20, in <module>
from numpy.distutils import log
File "D:Anacondaenvsvenvlibsite-packagesnumpydistutilslog.py", line 4, in <module>
from distutils.log import Log as old_Log
ImportError: cannot import name 'Log' from 'distutils.log' (D:Anacondaenvsvenvlibsite-packagessetuptools_distutilslog.py)
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for numba
Running setup.py clean for numba
error: subprocess-exited-with-error
c:users13003appdatalocaltemppip-install-417gts98python-rtmidi_e5f4214911f54de8b049d39f4499d15asrcRtMidi.h(48): fatal error C1083: Cannot open include file: 'exception': No such file or directory
error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe' failed with exit code 2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for python-rtmidi
Running setup.py clean for python-rtmidi
Building wheel for llvmlite (setup.py) ... error
error: subprocess-exited-with-error
Message: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -D__WINDOWS_MM__ -Isrc -ID:\Anaconda\envs\venv\include -ID:\Anaconda\envs\venv\Include /EHsc /Tpsrc\RtMidi.cpp /Fobuild\temp.win-amd64-cpython-39\Release\src\RtMidi.obj /EHsc'
Arguments: ()
RtMidi.cpp
c:users13003appdatalocaltemppip-install-417gts98python-rtmidi_e5f4214911f54de8b049d39f4499d15asrcRtMidi.h(48): fatal error C1083: Cannot open include file: 'exception': No such file or directory
error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe' failed with exit code 2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
Rolling back uninstall of python-rtmidi
Moving to d:anacondaenvsvenvlibsite-packagespython_rtmidi-1.4.9.dist-info
from D:AnacondaenvsvenvLibsite-packages~ython_rtmidi-1.4.9.dist-info
Moving to d:anacondaenvsvenvlibsite-packagesrtmidi
from D:AnacondaenvsvenvLibsite-packages~tmidi
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> python-rtmidi
我确定我已经安装了python-rtmidi, numba,llvmlite,但它总是在一个不退出的路径中找到它们。有人能帮我吗??我真的很感激。
尝试先设置这个环境变量:
export SETUPTOOLS_USE_DISTUTILS=stdlib
或者给命令加上前缀,例如,将poetry install
更改为:
SETUPTOOLS_USE_DISTUTILS=stdlib poetry install
(源)