简体   繁体   English

使用pip从本地文件系统文件夹安装Python软件包

[英]Installing Python packages from local file system folder with pip

I am trying to install python packages from the local file system with pip as discussed in this question . 我正在尝试使用pip从本地文件系统安装python软件包,如本问题所述

I have used pip2pi as suggested in the accepted answer in the above question. 我已经按照上述问题的接受答案中的建议使用了pip2pi

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 Python-2.7.6 PIP-1.5.4 Ubuntu 14.04

--find-links=pyt/pkg

在目录中,而不是在patroni-1.4.4.tar.gz存档中找到链接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM