安装django时出错

时间:2016-09-26 16:44:12

标签: python django

我正在尝试学习Django框架。 我有Windows机器,我已经安装了虚拟机(oracle VM VirtualBox manager)。 我已经安装了python。

我没看到在这个VM上安装了pip。所以我试图通过以下方式安装django:

 wget https://www.djangoproject.com/download/1.10.1/tarball/

这会出现以下错误:

 Resolving www.djangoproject.com... 162.242.220.127,      2001:4802:7801:102:be76:4eff:fe20:789f
 Connecting to www.djangoproject.com|162.242.220.127|:443... connected.
 ERROR: cannot verify www.djangoproject.com's certificate, issued by `/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3':
 Unable to locally verify the issuer's authority.
 ERROR: certificate common name `djangoproject.com' doesn't match requested host name `www.djangoproject.com'.
 To connect to www.djangoproject.com insecurely, use `--no-check-certificate'.
 Unable to establish SSL connection
 --------------------

所以我在下面尝试过:

wget --user=username --password --no-check-certificate https://www.djangoproject.com/download/1.10.1/tarball/

但仍然是错误:

ERROR: cannot verify www.djangoproject.com's certificate, issued by `/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3':
Unable to locally verify the issuer's authority.
ERROR: certificate common name `djangoproject.com' doesn't match requested host name `www.djangoproject.com'.
To connect to www.djangoproject.com insecurely, use `--no-check-certificate'.
Unable to establish SSL connection.

有人可以帮忙吗?

3 个答案:

答案 0 :(得分:1)

安装pip并运行,然后按照建议使用pip安装

官方指示 [查看说明] [1] 每http://www.pip-installer.org/en/latest/installing.html

下载get-pip.py,小心将其保存为.py文件而不是.txt。然后,从命令提示符运行它:

python get-pip.py

pip install django

pip freeze | grep Django

      Django==1.9.9     # to see which version is installed

PS。请记住,一旦你安装了pip,如果你运行pip并且你仍然得到类似“找不到命令”的东西,你可能只需要关闭shell并重新启动它。

答案 1 :(得分:-1)

为什么不从github repo下载

以这种方式工作

wget https://github.com/django/django/archive/master.tar.gz

答案 2 :(得分:-2)

(我假设您在此VM上使用Ubuntu)

使用以下命令安装pip:

sudo apt-get install python-pip python-dev build-essential