问题
I'm using win7, python 2.7 and I have a project with several packages running.
I wanted to move the project to my friends laptop (which can't access to internet, not an option). so I downloaded Python/Django/All required packages, Installed python and run python setup.py install in each package directory.
I've found that some packages, even after I download them, requires somethings from the internet to be downloaded and causes error. so:
How can I download a package and all it's dependencies or what ever it needs to be installed offline?
回答1:
This is how you can do it
Install Django and all related packages to a Python virtual environment
Run
pip freeze > requirements.txtwhich will list all installed packages and their versions in this fileUse
pip wheel -r requirements.txtcommand which builds awheelhousefolder of the package listZip this folder
Go to your friend's computer, unzip
create virtual environment and run
pip install wheelhouse/*(Install all packages from the wheelhouse)
More about pip wheel.
Python and pip needs to be separately copied and installed.
来源:https://stackoverflow.com/questions/34704163/installing-django-and-related-packages-on-an-offline-computer