我正在尝试通过pip从本地文件夹安装依赖项。我的requirements.txt
如下图
--no-index
retrying==1.3.3
six==1.11.0
我遵循的步骤
support@vrni-platform:~$ mkdir app_depen
support@vrni-platform:~$ sudo pip install --download=/home/support/app_depen retrying==1.3.3
/home/support/app_depen
support@vrni-platform:~$ ls -lah /home/support/app_depen/
total 32K
drwxrwx--- 2 support support 4.0K Sep 15 15:04 .
drwx------ 5 support support 4.0K Sep 15 15:09 ..
-rw-r----- 1 root root 11K Sep 15 15:04 retrying-1.3.3.tar.gz
-rw-r----- 1 root root 11K Sep 15 15:04 six-1.11.0-py2.py3-none-any.whl
然后尝试通过如下所示的pip进行安装
support@vrni-platform:~$ sudo pip install -U --force-reinstall --allow-unverified --find-links=/home/support/app_depen/ -r requirements.txt
我遇到以下错误
Collecting retrying==1.3.3 (from -r requirements.txt (line 2))
Could not find a version that satisfies the requirement retrying==1.3.3 (from -r requirements.txt (line 2)) (from versions: )
No matching distribution found for retrying==1.3.3 (from -r requirements.txt (line 2))
我尝试过更改如下所示的权限。但是仍然出现相同的错误
support@vrni-platform:~$ ls -lah /home/support/app_depen/
total 32K
drwxrwx--- 2 support support 4.0K Sep 15 15:04 .
drwx------ 5 support support 4.0K Sep 15 15:09 ..
-rw-r-xr-x 1 root root 11K Sep 15 15:04 retrying-1.3.3.tar.gz
-rw-r----- 1 root root 11K Sep 15 15:04 six-1.11.0-py2.py3-none-any.whl
有人可以让我知道发生了什么事吗?
答案 0 :(得分:2)
将--find-links
放入requirements.txt
内,如下所示,然后执行sudo pip install -U -r requirements.txt
对我来说是有效的。
--no-index
--find-links /home/support/app_depen
retrying==1.3.3
six==1.11.0