如何根據本地目錄中的requirements.txt文件使用pip安裝軟件包?

問題:

Here is the problem 這是問題所在 json

I have a requirements.txt that looks like: 我有一個require.txt看起來像: ui

BeautifulSoup==3.2.0
Django==1.3
Fabric==1.2.0
Jinja2==2.5.5
PyYAML==3.09
Pygments==1.4
SQLAlchemy==0.7.1
South==0.7.3
amqplib==0.6.1
anyjson==0.3
...

I have a local archive directory containing all the packages + others. 我有一個本地存檔目錄,其中包含全部軟件包和其餘軟件包。 spa

I have created a new virtualenv with 我建立了一個新的virtualenv .net

bin/virtualenv testing

upon activating it, I tried to install the packages according to requirements.txt from the local archive directory. 激活它後,我嘗試根據本地存檔目錄中的requirements.txt安裝軟件包。 code

source bin/activate
pip install -r /path/to/requirements.txt -f file:///path/to/archive/

I got some output that seems to indicate that the installation is fine 我獲得一些輸出,彷佛代表安裝正常 ip

Downloading/unpacking Fabric==1.2.0 (from -r ../testing/requirements.txt (line 3))
  Running setup.py egg_info for package Fabric
    warning: no previously-included files matching '*' found under directory 'docs/_build'
    warning: no files found matching 'fabfile.py'
Downloading/unpacking South==0.7.3 (from -r ../testing/requirements.txt (line 8))
  Running setup.py egg_info for package South
....

But later check revealed none of the package is installed properly. 但後來檢查發現該軟件包均未正確安裝。 I cannot import the package, and none is found in the site-packages directory of my virtualenv. 我沒法導入軟件包,但在virtualenv的site-packages目錄中找不到任何軟件包。 So what went wrong? 那麼出了什麼問題? rem


解決方案:

參考一: https://stackoom.com/question/UJmm/如何根據本地目錄中的requirements-txt文件使用pip安裝軟件包
參考二: https://oldbug.net/q/UJmm/How-to-install-packages-using-pip-according-to-the-requirements-txt-file-from-a-local-directory
相關文章
相關標籤/搜索