0

I can install a local package as below:

....,root,root # /usr/bin/pip3 install PyYAML-5.3.tar.gz
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Processing ./PyYAML-5.3.tar.gz
Installing collected packages: PyYAML
  Found existing installation: PyYAML 3.13
    Uninstalling PyYAML-3.13:
      Successfully uninstalled PyYAML-3.13
  Running setup.py install for PyYAML ... done
Successfully installed PyYAML-5.3
....,root,root #

but if I try below command it fails as it will search on the internet (my VM has no internet connection)

,root,root # /usr/bin/pip3 install PyYAML==5.3
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Collecting PyYAML==5.3
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f17164e0080>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/pyyaml/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f17164e0198>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/pyyaml/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f17164e0278>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/pyyaml/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f17164e0358>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/pyyaml/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f17164e0400>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/pyyaml/
  Could not find a version that satisfies the requirement PyYAML==5.3 (from versions: )
No matching distribution found for PyYAML==5.3
.....,root,root #

so the question is where to put my downloaded package "PyYAML-5.3.tar.gz" into default location to make this command (/usr/bin/pip3 install PyYAML==5.3) look for it locally and not on the internet ?

  • https://stackoverflow.com/search?q=%5Bpip%5D+offline, esp. this answer: https://stackoverflow.com/a/14447068/7976758 – phd Dec 01 '20 at 13:19
  • `pip install --no-index --find-links /path/to/download/dir/ PyYAML==5.3` – phd Dec 01 '20 at 13:20
  • I need to use same command syntax pip3 install PyYAML==5.3 so where is the default location that pip3 look for ? – osamaelnino Dec 01 '20 at 13:49
  • The default location is https://pypi.org/ – phd Dec 01 '20 at 14:08
  • I mean the default location onto my Virtual machine because my VM doesn't have internet connection so I want to download the package onto my pc then upload it to VM default location of PIP3 so whenever I launch the install command it goes and check this default local location and install the manually downloaded package. – osamaelnino Dec 01 '20 at 18:18
  • 1
    The default location is network. `pip` doesn't have the default location at local filesystem. You can configure `pip` by adding options to `pip.conf` or passing options at command-line. But by default (without additional configuration) `pip` always tries to contact PyPI. – phd Dec 01 '20 at 18:40

0 Answers0