Chinaunix首页 | 论坛 | 博客
  • 博客访问: 395955
  • 博文数量: 101
  • 博客积分: 2207
  • 博客等级: 大尉
  • 技术积分: 2508
  • 用 户 组: 普通用户
  • 注册时间: 2011-04-19 20:45
文章分类

全部博文(101)

文章存档

2013年(15)

2012年(86)

我的朋友

分类: Python/Ruby

2012-11-08 10:27:59

1.Windows安装忘记了
下载安装python安装工具
下载地址: 可以找到正确的版本进行下载。win7 32位可以下载setuptools-0.6c11.win32-py2.7.exe 。 注意:win7 64位必须使用进行安装。方法是下载ez_setup.py后,在cmd下执行 python ez_setup.py,即可自动安装setuptools。目前没有直接的exe安装版本。 
下载完成后双击执行安装文件,即可在D:\Program Files\python2.7\scripts下安装easy_install。包含一个easy_install.exe,然后进行环境变量设置,在系统环境变量中做如下设置:
(也就是将D:\Program Files\python2.7\scripts添加到环境变量中)
 

 
此时可以在控制台看easy_install 是否安装上了。
 
Microsoft Windows [版本 6.1.7600]
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。

C:\Users\zhuyupeng>easy_install
error: No urls, filenames, or requirements specified (see --help)
 
上面这种方式不正确,需要使用下面的方式:

C:\Users\zhuyupeng>easy_install virtualenv
Searching for virtualenv
Best match: virtualenv 1.7.2
Processing virtualenv-1.7.2-py2.7.egg
virtualenv 1.7.2 is already the active version in easy-install.pth
Installing virtualenv-script.py script to D:\Program Files\Python2.7\Scripts
Installing virtualenv.exe script to D:\Program Files\Python2.7\Scripts
Installing virtualenv.exe.manifest script to D:\Program Files\Python2.7\Scripts
Installing virtualenv-2.7-script.py script to D:\Program Files\Python2.7\Scripts

Installing virtualenv-2.7.exe script to D:\Program Files\Python2.7\Scripts
Installing virtualenv-2.7.exe.manifest script to D:\Program Files\Python2.7\Scri
pts

Using d:\program files\python2.7\lib\site-packages\virtualenv-1.7.2-py2.7.egg
Processing dependencies for virtualenv
Finished processing dependencies for virtualenv


2.先说说我的机器情况,python 预装版本为2.4.3
在下载源码包

点击(此处)折叠或打开

  1. wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz
编译Python 2.7.3版本

点击(此处)折叠或打开

  1. tar czvf Python-2.7.3.tgz
  2. cd Python-2.7.3
  3. ./configure --prefix=/home/yesg/
  4. make
  5. make install
采用easy_install 来安装ipython
需要先安装easy_install
先下载easy_install源码

点击(此处)折叠或打开

  1. wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz#md5=7df2a529a074f613b509fb44feefe74e
安装easy_install

点击(此处)折叠或打开

  1. tar xzvf setuptools-0.6c11.tar.gz
  2.  cd setuptools-0.6c11
  3.  python2.7 setup.py install
使用easy_install-2.7安装ipython

点击(此处)折叠或打开

  1. easy_install-2.7 ipython

运行ipython查看成果

点击(此处)折叠或打开

  1. WARNING: IPython History requires SQLite, your history will not be saved
  2. WARNING: Readline services not available or not loaded.WARNING: The auto-indent feature requires the readline libraryPython 2.7.3 (default, Dec 11 2012, 23:01:21)
悲剧啊
重新安装sqlite3

点击(此处)折叠或打开

  1. wget http://www.sqlite.org/sqlite-autoconf-3071401.tar.gz
  2. tar xzvf sqlite-autoconf-3071401.tar.gz
  3. cd sqlite-autoconf-3071401
  4. ./configure --prefix=/usr/local/
  5. make
  6. make install
最后发现必须./configure --prefix=/usr/local/也就是指定安装路径
这样重新安装Python2.7 make的时候才不会报_sqlite3模块安装失败
再重新安装easy_install
利用easy_install安装ipython
阅读(5344) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~