简体   繁体   English

安装Django时出错

[英]error while installing django

I am trying to learn Django framework. 我正在尝试学习Django框架。 I have windows machine and on that I have installed virtual machine (oracle VM VirtualBox manager). 我有Windows计算机,并在上面安装了虚拟机(Oracle VM VirtualBox管理器)。 I have python installed on that. 我在上面安装了python。

I dont see pip installed on this VM. 我没有在此VM上看到pip。 so i tried to install django via below: 所以我尝试通过以下方式安装django:

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

This gives the following error: 这给出了以下错误:

 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
 --------------------

so i tried below: 所以我尝试如下:

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

but still error: 但仍然错误:

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.

Can somebody help? 有人可以帮忙吗?

Get pip installed and working and then install it using pip as suggested 安装pip并正常工作,然后根据建议使用pip安装它

Official instructions [check out instructions][1] Per http://www.pip-installer.org/en/latest/installing.html : 官方说明 [退房说明] [1]每个http://www.pip-installer.org/en/latest/installing.html

Download get-pip.py, being careful to save it as a .py file rather than .txt. 下载get-pip.py,请小心将其另存为.py文件而不是.txt。 Then, run it from the command prompt: 然后,在命令提示符下运行它:

python get-pip.py

pip install django

pip freeze | grep Django

      Django==1.9.9     # to see which version is installed

ps. ps。 Keep in mind, once you have pip installed, if you run pip and you still get something like "command not found" you may have to just close the shell and start it again. 请记住,一旦安装了pip,如果运行pip并仍然出现类似“找不到命令”之类的信息,则可能必须关闭外壳并重新启动它。

why not just download from github repo 为什么不只是从github repo下载

in that way this will work 这样就可以了

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

(I am assuming you use Ubuntu on this VM) (我假设您在此VM上使用Ubuntu)

Just install pip with the following command: 只需使用以下命令安装pip:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM