ANTLR4 Python 安装失败,无法建立连接。

huangapple go评论116阅读模式
英文:

ANTLR4 Python failed to install and cannot establish a connection

问题

我正在尝试安装Apache AGE Python驱动程序的要求。每当安装antlr4-python3-runtime时,它都会失败。

我通过以下方式安装包:

pip3 install -r requirements.txt

这得到了以下结果:

正在收集 antlr4-python3-runtime==4.11.1
  警告: 在连接被“NewConnectionError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f8ce27dfd90>: 无法建立新连接: [Errno 101] 网络不可达))后,重新尝试 (Retry(total=4, connect=None, read=None, redirect=None, status=None)) : /packages/e0/64/c548678120cccf784f555972ed37cedcf4f026abeec30ab0340c3af4ea07/antlr4-python3-runtime-4.11.1.tar.gz
  警告: 在连接被“NewConnectionError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f8ce27df2e0>: 无法建立新连接: [Errno 101] 网络不可达))后,重新尝试 (Retry(total=3, connect=None, read=None, redirect=None, status=None)) : /packages/e0/64/c548678120cccf784f555972ed37cedcf4f026abeec30ab0340c3af4ea07/antlr4-python3-runtime-4.11.1.tar.gz
  警告: 在连接被“NewConnectionError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f8ce27dee90>: 无法建立新连接: [Errno 101] 网络不可达))后,重新尝试 (Retry(total=2, connect=None, read=None, redirect=None, status=None)) : /packages/e0/64/c548678120cccf784f555972ed37cedcf4f026abeec30ab0340c3af4ea07/antlr4-python3-runtime-4.11.1.tar.gz
  警告: 在连接被“NewConnectionError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f8ce27def50>: 无法建立新连接: [Errno 101] 网络不可达))后,重新尝试 (Retry(total=1, connect=None, read=None, redirect=None, status=None)) : /packages/e0/64/c548678120cccf784f555972ed37cedcf4f026abeec30ab0340c3af4ea07/antlr4-python3-runtime-4.11.1.tar.gz
  警告: 在连接被“NewConnectionError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f8ce27df0d0>: 无法建立新连接: [Errno 101] 网络不可达))后,重新尝试 (Retry(total=0, connect=None, read=None, redirect=None, status=None)) : /packages/e0/64/c548678120cccf784f555972ed37cedcf4f026abeec30ab0340c3af4ea07/antlr4-python3-runtime-4.11.1.tar.gz
错误: 由于OSError,无法安装包:HTTPSConnectionPool(host='files.pythonhosted.org', port=443): 最大重试次数(由于NewConnectionError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f8ce2818190>: 无法建立新连接: [Errno 101] 网络不可达))已超出 URL: /packages/e0/64/c548678120cccf784f555972ed37cedcf4f026abeec30ab0340c3af4ea07/antlr4-python3-runtime-4.11.1.tar.gz
  • 操作系统:Ubunutu 22.04
  • Python版本:3.10.6

要复制:

# 更新并安装
sudo apt-get update
sudo apt-get install python3-dev libpq-dev
# 获取apache age
git clone https://github.com/apache/age
# 进入驱动程序目录
cd age/drivers/python
# 创建虚拟环境
virtualenv venv
# 激活
source venv/bin/activate
# 安装
pip3 install -r requirements.txt

附注:当我尝试从 https://pypi.org/project/antlr4-python3-runtime/#files 下载软件包文件时,它已经被下载。

是否有人遇到过类似的问题和/或解决方法?

英文:

I am trying to install the requirements of Apache AGE Python driver. Whenever it comes to installing the antlr4-python3-runtime, it fails.

I install the packages through:

pip3 install -r requirements.txt

This gets the following:

Collecting antlr4-python3-runtime==4.11.1
  WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by &#39;NewConnectionError(&#39;&lt;pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f8ce27dfd90&gt;: Failed to establish a new connection: [Errno 101] Network is unreachable&#39;)&#39;: /packages/e0/64/c548678120cccf784f555972ed37cedcf4f026abeec30ab0340c3af4ea07/antlr4-python3-runtime-4.11.1.tar.gz
  WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by &#39;NewConnectionError(&#39;&lt;pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f8ce27df2e0&gt;: Failed to establish a new connection: [Errno 101] Network is unreachable&#39;)&#39;: /packages/e0/64/c548678120cccf784f555972ed37cedcf4f026abeec30ab0340c3af4ea07/antlr4-python3-runtime-4.11.1.tar.gz
  WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by &#39;NewConnectionError(&#39;&lt;pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f8ce27dee90&gt;: Failed to establish a new connection: [Errno 101] Network is unreachable&#39;)&#39;: /packages/e0/64/c548678120cccf784f555972ed37cedcf4f026abeec30ab0340c3af4ea07/antlr4-python3-runtime-4.11.1.tar.gz
  WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by &#39;NewConnectionError(&#39;&lt;pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f8ce27def50&gt;: Failed to establish a new connection: [Errno 101] Network is unreachable&#39;)&#39;: /packages/e0/64/c548678120cccf784f555972ed37cedcf4f026abeec30ab0340c3af4ea07/antlr4-python3-runtime-4.11.1.tar.gz
  WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by &#39;NewConnectionError(&#39;&lt;pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f8ce27df0d0&gt;: Failed to establish a new connection: [Errno 101] Network is unreachable&#39;)&#39;: /packages/e0/64/c548678120cccf784f555972ed37cedcf4f026abeec30ab0340c3af4ea07/antlr4-python3-runtime-4.11.1.tar.gz
ERROR: Could not install packages due to an OSError: HTTPSConnectionPool(host=&#39;files.pythonhosted.org&#39;, port=443): Max retries exceeded with url: /packages/e0/64/c548678120cccf784f555972ed37cedcf4f026abeec30ab0340c3af4ea07/antlr4-python3-runtime-4.11.1.tar.gz (Caused by NewConnectionError(&#39;&lt;pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f8ce2818190&gt;: Failed to establish a new connection: [Errno 101] Network is unreachable&#39;))
  • OS: Ubunutu 22.04
  • Python version: 3.10.6

To reproduce:

# update and install
sudo apt-get update
sudo apt-get install python3-dev libpq-dev
# get apache age
git clone https://github.com/apache/age
# move to the drivers
cd age/drivers/python
# create virtual environment 
virtualenv venv
# active
source venv/bin/activate
# install
pip3 install -r requirements.txt

P.S When I have tried to download the package files from https://pypi.org/project/antlr4-python3-runtime/#files
it has been downloaded

Has anyone got a similar issue and/or a fix?

答案1

得分: 1

你可以尝试手动安装该包:

  1. 如果你还没有下载该包:
wget https://files.pythonhosted.org/packages/e0/64/c548678120cccf784f555972ed37cedcf4f026abeec30ab0340c3af4ea07/antlr4-python3-runtime-4.11.1.tar.gz
  1. 安装该包:
pip install antlr4-python3-runtime-4.11.1.tar.gz
英文:

You can try manually installing the package:

  1. If you haven't already downloaded the package:
wget https://files.pythonhosted.org/packages/e0/64/c548678120cccf784f555972ed37cedcf4f026abeec30ab0340c3af4ea07/antlr4-python3-runtime-4.11.1.tar.gz
  1. Install the package:
pip install antlr4-python3-runtime-4.11.1.tar.gz

答案2

得分: 0

你可以尝试重新安装 antlr
卸载:

pip uninstall antlr4-python3-runtime

安装:

pip install antlr4-python3-runtime==4.11.1

我正在使用 antlr 版本 4.11.1,并且它运行正常。

英文:

You can try to reinstall antlr.
To uninstall:

pip uninstall antlr4-python3-runtime

To install:

pip install antlr4-python3-runtime==4.11.1

I am using antlr version 4.11.1, and it is working fine.

答案3

得分: -1

我建议您尝试将 antlr4-python3-runtime 4.13.0 安装到其他库中。

如果您已经安装了这些包,那么可以直接在文件中运行 pip install,如下所示:

pip3 install antlr4.11.1.tar.gz
英文:

I recommend you try to install the antlr4-python3-runtime 4.13.0 in other library.

in the case you already have installed the packages, so run the pip install directly in the file, like:

pip3 install antlr4.11.1.tar.gz

答案4

得分: -1

你需要安装特定版本的antlr4,最好选择4.9.2或4.11版本,具体取决于仓库是克隆还是直接安装了AGE。

参考这个答案:链接

英文:

You have to install a specific version of antlr4 preferably as the driver does not work with all versions, 4.9.2 or 4.11 should work depending on whether the repo was cloned or you installed AGE directly.

Refer to this answer.

huangapple
  • 本文由 发表于 2023年7月28日 02:35:06
  • 转载请务必保留本文链接:https://go.coder-hub.com/76782554.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定