P3zhman
P3zhman

Reputation: 243

Installing Django and related packages on an offline computer

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?

Upvotes: 0

Views: 3316

Answers (1)

Mikko Ohtamaa
Mikko Ohtamaa

Reputation: 83788

This is how you can do it

  • Install Django and all related packages to a Python virtual environment

  • Run pip freeze > requirements.txt which will list all installed packages and their versions in this file

  • Use pip wheel -r requirements.txt command which builds a wheelhouse folder of the package list

  • Zip 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.

Upvotes: 4

Related Questions