最新消息:20181230 VPS服务器已从Linode换到腾讯云香港,主题仍用朋友推荐的大前端D8

【记录】使用pip安装官方版本的Django

Django crifan 1310浏览 0评论

继续参考:

Quick install guide – > Install an official release

去安装django,然后又参考:

PIP Installation instructions

去下载

get-pip.py

然后cmd中去运行,结果出错:

E:\Dev_Tools\python\pip>get-pip.py
An error occured while trying to run E:\Dev_Tools\python\pip\get-pip.py. Make sure you have setuptools or distribute installed.

所以,再先去安装distribute:

【记录】为Python安装distribute

安装完毕后,接着去运行那个get-pip.py:

E:\Dev_Tools\python\pip>dir
 驱动器 E 中的卷是 Develop
 卷的序列号是 0003-B490

 E:\Dev_Tools\python\pip 的目录

2012/10/14  13:29    <DIR>          .
2012/10/14  13:29    <DIR>          ..
2012/10/14  13:29            85,929 get-pip.py
               1 个文件         85,929 字节
               2 个目录  2,169,856,000 可用字节

E:\Dev_Tools\python\pip>get-pip.py
Downloading/unpacking pip
  Downloading pip-1.2.1.tar.gz (102Kb): 102Kb downloaded
  Running setup.py egg_info for package pip

    warning: no files found matching '*.html' under directory 'docs'
    warning: no previously-included files matching '*.txt' found under directory 'docs\_build'
    no previously-included directories found matching 'docs\_build\_sources'
Installing collected packages: pip
  Running setup.py install for pip

    warning: no files found matching '*.html' under directory 'docs'
    warning: no previously-included files matching '*.txt' found under directory 'docs\_build'
    no previously-included directories found matching 'docs\_build\_sources'
    Installing pip-script.py script to E:\dev_install_root\Python27\Scripts
    Installing pip.exe script to E:\dev_install_root\Python27\Scripts
    Installing pip-2.7-script.py script to E:\dev_install_root\Python27\Scripts
    Installing pip-2.7.exe script to E:\dev_install_root\Python27\Scripts
Successfully installed pip
Cleaning up...

E:\Dev_Tools\python\pip>

安装pip完毕后,就可以回去接着安装Django了。

期间,遇到了

‘pip’ 不是内部或外部命令,也不是可运行的程序或批处理文件。

的问题,折腾过程参见:

【已解决】Python中,运行pip install Django出错:’pip’ 不是内部或外部命令,也不是可运行的程序或批处理文件。

 

最后,终于可以正常安装Django了:

E:\Dev_Tools\webserver\django>pip install Django
Downloading/unpacking Django
  Downloading Django-1.4.1.tar.gz (7.7MB): 7.7MB downloaded
  Running setup.py egg_info for package Django

Installing collected packages: Django
  Running setup.py install for Django

Successfully installed Django
Cleaning up...

然后再去验证一下django是否成功安装:

E:\Dev_Tools\webserver\django>python
Python 2.7.2 (default, Jun 12 2011, 14:24:46) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import django

结果表明是OK的.

对应的,去Python27\Scripts中,也可以看到对应的django-admin.py了.

这样以后使用django-admin.py创建项目,也就终于可以正常执行的了.

转载请注明:在路上 » 【记录】使用pip安装官方版本的Django

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
57 queries in 0.170 seconds, using 10.04MB memory