安装 scikit-image 时如何解决此错误?

How do i solve this error when installing scikit-image?

使用 pip install scikit-image 时出现以下错误。注意我已经安装了 Microsoft VS。 是什么原因造成的? 不确定这是否是 numpy 的问题? 谢谢

ERROR: Command errored out with exit status 1:
 command: 'c:\users\student\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Student\AppData\Local\Temp\pip-install-2dp2c1cs\scikit-image_610bd9ad5a3b4de0a232ce6491f9d39a\setup.py'"'"'; __file__='"'"'C:\Users\Student\AppData\Local\Temp\pip-install-2dp2c1cs\scikit-image_610bd9ad5a3b4de0a232ce6491f9d39a\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Student\AppData\Local\Temp\pip-record-r78qb75l\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\student\appdata\local\programs\python\python39\Include\scikit-image'
     cwd: C:\Users\Student\AppData\Local\Temp\pip-install-2dp2c1cs\scikit-
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\student\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Student\AppData\Local\Temp\pip-install-2dp2c1cs\scikit-image_610bd9ad5a3b4de0a232ce6491f9d39a\setup.py'"'"'; __file__='"'"'C:\Users\Student\AppData\Local\Temp\pip-install-2dp2c1cs\scikit-image_610bd9ad5a3b4de0a232ce6491f9d39a\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Student\AppData\Local\Temp\pip-record-r78qb75l\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\student\appdata\local\programs\python\python39\Include\scikit-image' Check the logs for full command output.

根据 GitHub 上的 this issue,它在 Python 3.9 上仍然不可用。

他们提供了一些解决方案:

  • conda install -c conda-forge scikit-learn 与康达
  • pip install --pre -U scikit-learn 在 windows

对于python==3.10.4: 只需以管理员身份在您的 CMD 中升级您的 pip 命令,一切都会正常进行。

python -m pip install –-upgrade pip