最近在复现一篇论文,首先就要安装ffcv,但是一直在报同一个错误,bing和gpt之类的全都用过了也没有用,到底是哪里的问题,求问
(ffcv382)0:\sqpyth\data-transfer-main>pip install ffcv
Looking in indexes: https://mirrons.aliyun.com/pypi/simple, https://pypi.ngc.nvidia.cor
Collecting ffcv
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]
Traceback(most recent call last):
File "<string>", line 2,in <module>
File "<pip-setuptools caller>",line 34,in <module>
File "c: users\zrwaylAppatalLocallTemplpip-install-evcjerlulffcv 2a02e9feaa6d403997387ae5a00f22a2\setup.py", line 87, in <module,
extension_kwargs = pkgconfig_windows('opencv4',extension_kwargs)
File "c: usersizrwaylAppatalLocallTempipip-install-evcjgrlu ffcv 2a02e9feaa6d403997387ae5a00f22a2|setup.py", line 62, in pkgconfig windows
raise Exception(f"Could not find required package: {package}.")
Exception: could not find required package: opencv4.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
erron: metadata-generation-failed
Encountered error while generating package metadata
-> See above for output.
This is an issue with the package mentioned above, not pip.
note:
hint: see above for details
Exception: could not find required package: opencv4.
opencv装了吗?
装了,路径也配置了,一直就是报错
@dqyyy: pip install python-opencv 这个也装了吗?
@www378660084:这个也装了
弄错操作系统了。。白忙活,已经更换了T T
...我刚测试了,安装好opencv4,把安装路径(D:\opencv4\build\bin)加到PATH里就没这个错误了...
@www378660084: 您好!您这个是在linux系统里的还是Windows里的?我之前试过加到path里但是没成功
@dqyyy: windows
@www378660084: 请问文件名是opencv4还是opencv?试过添加opencv到path里报错了,后来搜索发现要加到pkgconfig对应的path里,但是pkgconfig说是linux的库,windows不适配,然后就不知道怎么办了
@dqyyy: 我装的是windows版本的opencv4,我加到path里的是这个D:\opencv4\build\bin,就是dll所在的路径.
来自AI:
看起来你在安装ffcv时遇到了问题。错误消息显示没有找到所需的包opencv4。这可能是导致安装失败的原因之一。
要解决这个问题,可以尝试以下几个方法:
pip list
来检查已安装的包列表中是否有opencv4。如果没有,你可以尝试手动安装opencv4。pip install opencv-python
命令来安装opencv的Python包。这会安装最新版本的opencv,可能能够解决缺少opencv4的问题。pip install --upgrade pip setuptools
命令可以更新这两个工具的版本。