0

I am trying to install python packages from the local file system with pip as discussed in this question.

I have used pip2pi as suggested in the accepted answer in the above question.

dmanna@ubuntu:~$ mkdir -p pyt/pkg
dmanna@ubuntu:~$ pip2tgz pyt/pkg/ patroni[zookeeper]

The downloaded packages

dmanna@ubuntu:~$ ls /home/dmanna/pyt/pkg/
cdiff-1.0.tar.gz
certifi-2018.4.16-py2.py3-none-any.whl
chardet-3.0.4-py2.py3-none-any.whl
click-6.7-py2.py3-none-any.whl
idna-2.7-py2.py3-none-any.whl
kazoo-2.5.0-py2.py3-none-any.whl
patroni-1.4.4.tar.gz
prettytable-0.7.2.tar.bz2
psutil-5.4.6.tar.gz
psycopg2-2.7.4.tar.gz
python_dateutil-2.7.3-py2.py3-none-any.whl
pytz-2018.4-py2.py3-none-any.whl
PyYAML-3.12.tar.gz
requests-2.19.1-py2.py3-none-any.whl
six-1.11.0-py2.py3-none-any.whl
tzlocal-1.5.1.tar.gz
urllib3-1.23-py2.py3-none-any.whl

Then when I am trying to install the required package from the above local directory. It is giving me the below error

dmanna@ubuntu:~$ sudo pip install --no-index --find-links=pyt/pkg/patroni-1.4.4.tar.gz patroni[zookeeper]
Ignoring indexes: https://pypi.python.org/simple/
Downloading/unpacking patroni[zookeeper]
  Running setup.py (path:/tmp/pip_build_root/patroni/setup.py) egg_info for package patroni

  Installing extra requirements: 'zookeeper'
Downloading/unpacking urllib3>=1.19.1,!=1.21 (from patroni[zookeeper])
  Could not find any downloads that satisfy the requirement urllib3>=1.19.1,!=1.21 (from patroni[zookeeper])
Cleaning up...
No distributions at all found for urllib3>=1.19.1,!=1.21 (from patroni[zookeeper])
Storing debug log for failure in /home/dmanna/.pip/pip.log

Can someone let me know what I am doing wrong?

Python - 2.7.6 PIP - 1.5.4 Ubuntu 14.04

Njeru Cyrus
  • 1,753
  • 21
  • 22
tuk
  • 5,941
  • 14
  • 79
  • 162

1 Answers1

0
--find-links=pyt/pkg

Find links in the directory, not in the patroni-1.4.4.tar.gz archive.

phd
  • 82,685
  • 13
  • 120
  • 165
  • One more query. If I run `sudo pip install --no-index --find-links=file://pyt/pkg/ patroni[zookeeper]` then it is failing with the error `Ignoring indexes: https://pypi.python.org/simple/ Downloading/unpacking patroni[zookeeper] Could not find any downloads that satisfy the requirement patroni[zookeeper] Cleaning up... No distributions at all found for patroni[zookeeper] Storing debug log for failure in /home/dmanna/.pip/pip.log `. Any idea why it is failing with `file:///` ? – tuk Jun 15 '18 at 15:27
  • Why do you think it should work at all? It must be either a directory or an html file with links. `file://` URL is neither. – phd Jun 15 '18 at 15:48