Pip install in a docker Container

Hello,
Something’s changed in Docker. Two weeks ago, you had to install pip to use it inside a container. Then you could install it with pip. Now, pip is immediately available in a new container, but it can no longer find the sources. Example:
#pip install numpy
results in:
Looking in indexes: https://pypi.jetson-ai-lab.dev/jp6/cu126
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 0xffffa2ed8d00>: Failed to establish a new connection: [Errno 113] No route to host’)': /jp6/cu126/numpy/
It works the same way with all other Python packages.
I’m working with jetpack 6.0.

*** Please note that this reply is generated by LLM automatically ***

The issue you’re experiencing with Docker on Jetson AGX Orin, where pip is immediately available in a new container but can’t find sources for packages like numpy, suggests a change in the Docker configuration or the container environment. This problem is occurring after a recent change, two weeks prior, where you had to install pip inside a container to use it, and then you could install packages with pip.

To address this issue, let’s break down the potential causes and solutions:

  1. Docker Configuration Change: The fact that pip is now immediately available suggests a change in the Docker image or the way containers are set up. This could be due to an update in the jetson-containers or the base image dustynv/l4t-pytorch:r36.2.0. Check the Docker configuration file /etc/docker/daemon.json for any changes or updates that might affect how containers are run or how pip behaves within them.

  2. Network Connectivity: The error message Failed to establish a new connection: Errno 113 No route to host indicates a network connectivity issue. This could be due to several reasons:

    • DNS Resolution: The container might not be able to resolve the hostname http://pypi.jetson.ai.lab. Check your DNS settings and ensure that the container has access to the necessary DNS servers.
    • Proxy Settings: If you’re behind a proxy, ensure that your Docker container is configured to use the proxy. You can do this by setting environment variables in your Docker run command or by configuring the Docker daemon to use a proxy.
    • Firewall/Networking: There might be firewall rules or networking policies blocking the connection to the Python Package Index (PyPI). Check your firewall settings and network policies to ensure that the container can connect to external resources.
  3. PyPI Mirror: The error mentions http://pypi.jetson.ai.lab, which seems to be a mirror or a specific PyPI index for Jetson devices. Ensure that this mirror is accessible and functioning correctly. If it’s not, you might need to switch to the default PyPI index or another mirror that’s accessible.

  4. JetPack Version: You’re working with JetPack 6.0, which might have introduced changes in how Docker containers are managed or how networking is handled within containers. Check the JetPack documentation for any specific instructions or known issues related to Docker and network connectivity.

  5. Comparison with Previous Setup: Since the setup was working previously and the change occurred recently, comparing the current Docker configuration and container setup with the previous one might highlight what exactly has changed and how to revert or adjust the settings to resolve the issue.

To troubleshoot further:

  • Try running the container with --network=host to see if it resolves the connectivity issue.
  • Check the DNS resolution within the container by running a command like nslookup pypi.jetson.ai.lab or ping pypi.jetson.ai.lab.
  • If possible, try installing packages using the default PyPI index by specifying the index URL in the pip install command, e.g., pip install --index-url https://pypi.org/simple numpy.

By systematically checking these potential causes and comparing your current setup with the previous working configuration, you should be able to identify and resolve the issue preventing pip from finding and installing packages within your Docker container on Jetson AGX Orin.

*** Please give the thumbs up if you get answers you like. Or provide feedback to help us improve the answer. ***

1 Like

Thanks for the reply.
Two more comments:
pip looks at the addresses:
http://jetson.webredirect.org/jp6/cu122
results in: ERR_ADDRESS_UNREACHABLE
and
https://pypi.ngc.nvidia.com
the page is empty.
I’m using:
pip install --isolated,
that works.

What python version in the docker image?

python -V

If python 3.10 use

pip install --index-url Simple index --no-cache-dir numpy==2.2.3

If >3.10 use

pip install --index-url https://pypi.org/simple --no-cache-dir numpy


Note url top level domain is .io not .dev

https://pypi.jetson-ai-lab.io/jp6/cu126

If you want to install anything from there it might work to use following

pip install --extra-index-url https://pypi.jetson-ai-lab.io packagename.whl

but to be safe just right-click and download the file then

pip install filename.whl

Hello whitesscottt

thanks for reply. My python version in docker is: Python 3.10.12 and
pip install --index-url Simple index --no-cache-dir numpy
works.

Hans

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.