Loading...
「ツール」は右上に移動しました。
利用したサーバー: wtserver1
3いいね 1,366 views回再生

Python pip install from local cache

Python pip install from local cache
http://fosshelp.blogspot.com/2014/11/...

1)
Enable download_cache for pip.

Create a configuration file named ~/.pip/pip.conf, and add the following contents:
[global]
download_cache = ~/.cache/pip

2)
Install a package
#pip install six

Add the package "six" to cache and install

3)
Check the files in the cache
#ls -lsh ~/.cache/pip/

4)
Install the same package again and you can see that it takes from the cache
#pip install six

Get the package "six" from cache and install

5)
You can also manually add packages to pip cache

a)
Download the package https://pypi.python.org/packages/sour...

b)
Copy the downloaded "Babel-1.3.tar.gz" file to "~/.cache/pip/" folder and rename ot complete url path.
#mv Babel-1.3.tar.gz https://pypi.python.org/packages/sour...

c)
Modify the name
Replace "/" with %2F
Repalce ":" with %3A
Like : https%3A%2F%2Fpypi.python.org%2Fpackages%2Fsource%2FB%2FBabel%2FBabel-1.3.tar.gz

d)
Create another file with above name and extension ".content-type" and add the content "application/octet-stream".

Example:
#vim https%3A%2F%2Fpypi.python.org%2Fpackages%2Fsource%2Fm%2Fmock%2Fmock-1.0.1.tar.gz.content-type

application/octet-stream

コメント