运行YOLOv5时遇到的一些问题(Requirement already satisfied)

Requirement already satisfied

原因分析:这种问题一般出现在,当我们运行某个python文件时,报错ModuleNotFoundError: No module named 'xxxx',这是告诉我们需要下载xxxx库 。注:xxxx指的是库名

但是当我们在终端输入pip install xxxx时

pip install xxxx

却报出Requirement already satisfied: easydict in d:\app\code\lib\site-packages (1.10),这是说我们电脑存在一个xxxx库在d:\app\code\lib\site-packages (1.10)路径下。而我们正在使用的环境中没有xxxx库。

解决方法:我们目前使用的环境路径为d:\app\code\envs\pytorch\lib\site-packages,所以只需要在这个目录下在安装xxxx库就能解决问题。在终端输入pip install --target=d:\app\code\envs\pytorch\lib\site-packages xxxx

pip install --target=d:\app\code\envs\pytorch\lib\site-packages xxxx

总结:我们电脑中存在一个我们我们需要的库,但是不在我们使用的环境中。我们只需要在终端重新输入pip install  --target=我们需要使用的环境路径 库名,即可。

猜你喜欢

转载自blog.csdn.net/m0_52070737/article/details/128167740