簡體   English   中英

安裝Django時出錯

[英]error while installing django

我正在嘗試學習Django框架。 我有Windows計算機,並在上面安裝了虛擬機(Oracle VM VirtualBox管理器)。 我在上面安裝了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.

有人可以幫忙嗎?

安裝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並仍然出現類似“找不到命令”之類的信息,則可能必須關閉外殼並重新啟動它。

為什么不只是從github repo下載

這樣就可以了

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

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

只需使用以下命令安裝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