ERROR: Could not find a version that satisfies the requirement antlr4 (from versions: none) ERROR: N

一、报错信息

输入安装命令pip install antlr4说找不到满足需求的版本。

ERROR: Could not find a version that satisfies the requirement antlr4 (from versions: none)
ERROR: No matching distribution found for antlr4

二、解决方法

安装antlr4-python3-runtime库:

pip3 install antlr4-python3-runtime

但是我遇到了hydra-core和omegaconf依赖不满足的报错:

(pt112py38) dzh@dzh-Lenovo-Legion-Y7000:~/yolov7-mask$ pip3 install antlr4-python3-runtime
Collecting antlr4-python3-runtime
  Downloading antlr4_python3_runtime-4.13.0-py3-none-any.whl (144 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 144.5/144.5 kB 15.9 kB/s eta 0:00:00
Installing collected packages: antlr4-python3-runtime
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
hydra-core 1.3.2 requires antlr4-python3-runtime==4.9.*, but you have antlr4-python3-runtime 4.13.0 which is incompatible.
omegaconf 2.3.0 requires antlr4-python3-runtime==4.9.*, but you have antlr4-python3-runtime 4.13.0 which is incompatible.
Successfully installed antlr4-python3-runtime-4.13.0

根据错误信息,先卸载刚刚安装的antlr4-python3-runtime。

Found existing installation: antlr4-python3-runtime 4.13.0
Uninstalling antlr4-python3-runtime-4.13.0:
  Would remove:
    /home/dzh/anaconda3/envs/pt112py38/bin/pygrun
    /home/dzh/anaconda3/envs/pt112py38/lib/python3.8/site-packages/antlr4/*
    /home/dzh/anaconda3/envs/pt112py38/lib/python3.8/site-packages/antlr4_python3_runtime-4.13.0.dist-info/*
Proceed (Y/n)? y
  Successfully uninstalled antlr4-python3-runtime-4.13.0

再次输入指定版本的安装命令:pip install antlr4-python3-runtime==4.9.1

Collecting antlr4-python3-runtime==4.9.1
  Downloading antlr4-python3-runtime-4.9.1.tar.gz (173 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 173.3/173.3 kB 10.4 kB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: antlr4-python3-runtime
  Building wheel for antlr4-python3-runtime (setup.py) ... done
  Created wheel for antlr4-python3-runtime: filename=antlr4_python3_runtime-4.9.1-py3-none-any.whl size=144428 sha256=3b1704b1f7056ab8f50542990867cd9a74168303b108affa5759e6ee6402bf5d
  Stored in directory: /home/dzh/.cache/pip/wheels/96/a8/d2/c0ce0154e512fde86f8f3fee2df94d2ac58af57a486bf1a1cb
Successfully built antlr4-python3-runtime
Installing collected packages: antlr4-python3-runtime
Successfully installed antlr4-python3-runtime-4.9.1

猜你喜欢

转载自blog.csdn.net/qq_42257666/article/details/130811459