1

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 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f8ce27dfd90>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /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 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f8ce27df2e0>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /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 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f8ce27dee90>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /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 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f8ce27def50>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /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 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f8ce27df0d0>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /packages/e0/64/c548678120cccf784f555972ed37cedcf4f026abeec30ab0340c3af4ea07/antlr4-python3-runtime-4.11.1.tar.gz
ERROR: Could not install packages due to an OSError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/e0/64/c548678120cccf784f555972ed37cedcf4f026abeec30ab0340c3af4ea07/antlr4-python3-runtime-4.11.1.tar.gz (Caused by NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f8ce2818190>: Failed to establish a new connection: [Errno 101] Network is unreachable'))
  • 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?

Adrian Mole
  • 49,934
  • 160
  • 51
  • 83

5 Answers5

1

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
Safi50
  • 379
  • 1
  • 7
0

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.

abhishek2046
  • 312
  • 1
  • 11
-1

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
Marcos Silva
  • 115
  • 5
-1

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.

Tito
  • 289
  • 8
  • 1
    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/low-quality-posts/34927812) – Cody Duong Sep 01 '23 at 15:20
-1

If you are able to download the packages without encountering any problems then lets just install it using the pip install antlr4-python3-runtime-4.11.1.tar.gz command.