在离线计算机上安装Django和相关软件包 [英] Installing Django and related packages on an offline computer

查看:165
本文介绍了在离线计算机上安装Django和相关软件包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用win7,python 2.7,并且我有一个运行多个软件包的项目. 我想将项目移到我的朋友笔记本电脑(无法访问互联网,不是一种选择).所以我下载了Python/Django/所有必需的软件包,安装了python并在每个软件包目录中运行python setup.py install.

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.

我发现,即使下载了某些软件包,也需要从Internet上下载某些内容,并且会导致错误.所以:

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?

推荐答案

这是您可以做到的

运行pip freeze > requirements.txt,它将在此文件中列出所有已安装的软件包及其版本

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

使用pip wheel -r requirements.txt命令建立软件包列表的wheelhouse文件夹

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

压缩此文件夹

转到您朋友的计算机,解压

Go to your friend's computer, unzip

创建虚拟环境并运行pip install wheelhouse/*(从驾驶室安装所有软件包)

create virtual environment and run pip install wheelhouse/* (Install all packages from the wheelhouse)

有关 .

Python和pip需要分别复制和安装.

Python and pip needs to be separately copied and installed.

这篇关于在离线计算机上安装Django和相关软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆