AIX Open Source

 View Only
  • 1.  Error while installing Python modules like requests

    Posted Tue July 05, 2022 01:22 PM

    /opt/bin/python3 -m pip install requests-2.28.0

    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 0x30b05e80>: Failed to establish a new connection: [Errno 8] Hostname and service name not provided or found')': /simple/requests-2-28-0/

    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 0x30b053d0>: Failed to establish a new connection: [Errno 8] Hostname and service name not provided or found')': /simple/requests-2-28-0/

    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 0x30b053b8>: Failed to establish a new connection: [Errno 8] Hostname and service name not provided or found')': /simple/requests-2-28-0/

    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 0x30b05520>: Failed to establish a new connection: [Errno 8] Hostname and service name not provided or found')': /simple/requests-2-28-0/

    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 0x30b054a8>: Failed to establish a new connection: [Errno 8] Hostname and service name not provided or found')': /simple/requests-2-28-0/

    ERROR: Could not find a version that satisfies the requirement requests-2.28.0 (from versions: none)

    ERROR: No matching distribution found for requests-2.28.0



    ------------------------------
    Ramesh Shardha
    ------------------------------



  • 2.  RE: Error while installing Python modules like requests

    Posted Wed July 06, 2022 02:07 AM
    The syntax differs for pip install. You have to use "pip install requests==2.28.0"

    ------------------------------
    Ayappan P
    ------------------------------



  • 3.  RE: Error while installing Python modules like requests

    Posted Wed July 06, 2022 09:26 AM
    Thanks for the reply.
    I am installing on AIX, what is correct syntax of commands to install it on AIX.

    ------------------------------
    Ramesh Shardha
    ------------------------------



  • 4.  RE: Error while installing Python modules like requests

    Posted Wed July 06, 2022 09:41 AM

    I got the same error.

    # /opt/bin/pip3 install requests==2.28.0
    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 0x30adb9e8>: Failed to establish a new connection: [Errno 8] Hostname and service name not provided or found')': /simple/requests/
    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 0x30adb880>: Failed to establish a new connection: [Errno 8] Hostname and service name not provided or found')': /simple/requests/
    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 0x30adbc10>: Failed to establish a new connection: [Errno 8] Hostname and service name not provided or found')': /simple/requests/
    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 0x30864a18>: Failed to establish a new connection: [Errno 8] Hostname and service name not provided or found')': /simple/requests/
    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 0x30af6118>: Failed to establish a new connection: [Errno 8] Hostname and service name not provided or found')': /simple/requests/
    ERROR: Could not find a version that satisfies the requirement requests==2.28.0 (from versions: none) ​

    ------------------------------
    Ramesh Shardha
    ------------------------------



  • 5.  RE: Error while installing Python modules like requests

    Posted Wed July 06, 2022 10:04 AM
    You need to check whether the machine has outbound access. 
    Try pinging pypi.org

    ------------------------------
    Ayappan P
    ------------------------------



  • 6.  RE: Error while installing Python modules like requests

    Posted Wed July 06, 2022 02:49 PM
    The machine does not have access to the internet.
    Can I download the requirements, and keep them locally.

    ------------------------------
    Ramesh Shardha
    ------------------------------



  • 7.  RE: Error while installing Python modules like requests
    Best Answer

    Posted Wed July 06, 2022 05:03 PM
    From an Internet-connected host, you can do something like:

    python3 -m pip download \
      --dest=my-download-directory \
      --no-binary=:all: \
      requests==2.28.0

    This will download the source packages for the modules to my-download-directory. You will still need to install any libraries that the Python modules need in order to to be built. It is possible to download wheel files, but it's more complicated if you're not on the same OS and architecture as the target system. Also, I'm not sure how complete the wheel coverage is for AIX...

    Copy the download directory to the target system.

    To install the modules, it's something like this:

    python3 -m pip install requests==2.28.0 \
                   --no-index \
                   --find-links my-download-directory

    These may not be exactly correct for you, but it's the method I use to download packages for linux-x86_64 on my macOS-arm64 system.

     If this is something that you're going to keep track of long-term, you probably want to create a requirements and/or constraints file for pip.

    Liberty,

    -- 
    Stephen L. Ulmer
    Enterprise Architect
    Mainline Information Systems
    (m) 352-870-8649