win7(64bit)python相关环境模块搭建
包括Python,eclipse,jdk,pydev,pip,setuptools,beautifulsoup,pyyaml,nltk,mysqldb的下载安装配置。
*************************************************
python
下载:
python-2.7.6.amd64.msi
http://www.python.org/
Python 2.7.6 released
Python 2.7.6 is now available.
http://www.python.org/download/releases/2.7.6/
Windows X86-64 MSI Installer (2.7.6) [1] (sig)
安装
配置:
我的电脑->属性->高级->环境变量->系统变量中的PATH增加:C:\Python27;
验证:
在桌面建立一个文件pt.py,内容为print 'hello python'
在cmd中输入命令python C:\Users\***\Desktop\pt.py
***为电脑用户名。
C:\Users\***>python C:\Users\***\Desktop\pt.py
hello python
C:\Users\***>
*************************************************
Eclipse:
eclipse-java-indigo-SR2-win32-x86_64.zip
http://www.eclipse.org/downloads/
Older Versions
http://wiki.eclipse.org/Older_Versions_Of_Eclipse
Eclipse Indigo SR2 Packages (v 3.7.2)
http://www.eclipse.org/downloads/packages/release/indigo/sr2
Eclipse IDE for Java Developers, (128 MB)
Downloaded 1,226,421 TimesDetails Windows 32-bit 64-bit
http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/indigo/SR2/eclipse-java-indigo-SR2-win32-x86_64.zip
Download eclipse-java-indigo-SR2-win32-x86_64.zip from:
*************************************************
jdk:
jdk-7u45-windows-x64.exe
http://www.oracle.com/technetwork/java/javase/downloads/index.html
Windows x64 125.31 MB jdk-7u45-windows-x64.exe
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
*************************************************
pydev
为了在Eclipse中进行python工程的开发。
http://sourceforge.net/projects/pydev/files/
PyDev for EclipseLooking for the latest version? Download PyDev 3.2.0.zip (8.2 MB)
版本一直在更新中,几天前是3.1.0.zip
下载完,解压缩,将features和plugins文件夹中的内容分别复制到eclipse的features和plugins文件夹下。
重复则替换。
具体方法见windows xp,32位,环境下,Eclipse+python平台搭建
http://blog.sina.com.cn/s/blog_8af1069601019uaw.html“安装python插件”,打开eclipse先来配置preference-》PyDev-》Interpreter-Python-》New python的执行exe文件的目录
*************************************************
pip
https://pypi.python.org/pypi/pip
Download
pip-1.4.1.tar.gzA tool for installing and managing Python packages.
解压缩,在cmd中进入到pip-1.4.1目录,执行 python setup.py install
报错:
ImportError: No module named setuptools
所以,需要先安装setuptools
*************************************************
setuptools
https://pypi.python.org/pypi/setuptools/
setuptools 2.0.2
点击右侧Downloads按钮,跳至Downloads
Scroll to the very bottom of the page to find the links.
需要到页面底部去找链接下载。
File Type Py Version Uploaded on Size
setuptools-2.0.2-py2.py3-none-any.whl (md5) Python Wheel 3.4 2013-12-29 527KB
setuptools-2.0.2.tar.gz (md5) Source 2013-12-29 765KB
下载setuptools-2.0.2.tar.gz (md5)
解压缩
在cmd中进入到setuptools-2.0.2目录,执行 python setup.py install
成功标志:
Installed c:\python27\lib\site-packages\setuptools-2.0.2-py2.7.egg
Processing dependencies for setuptools==2.0.2
Finished processing dependencies for setuptools==2.0.2
如果中途出现错误UnicodeDecodeError: 'ascii' codec can't decode byte 0xca in position 12: ord..在setup.py中添加:
import sys
reload(sys)
sys.setdefaultencoding('gb18030')
---------------第二个解决办法------
open C:\Python27\Lib\ mimetypes.py with Notepad ++ or other editor, then search the line " default_encoding = sys.getdefaultencoding()". add codes to the line above like this:
default_encoding = sys.getdefaultencoding()
if sys.getdefaultencoding() != 'gbk':
reload(sys)
sys.setdefaultencoding('gbk')
default_encoding = sys.getdefaultencoding()
简单来说,就是有些国内软件修改注册表导致python无法安装库,要改下lib目录下的代码。
继续安装pip
*************************************************
pip
在cmd中进入到pip-1.4.1目录,执行 python setup.py install
成功标记:
Installed c:\python27\lib\site-packages\pip-1.4.1-py2.7.egg
Processing dependencies for pip==1.4.1
Finished processing dependencies for pip==1.4.1
添加到系统环境变量Path:C:\Python27\Scripts;
在cmd测试,输入pip,输出:
C:\Users\***>pip
Usage:
pip [options]
Commands:
install Install packages.
uninstall Uninstall packages.
freeze Output installed packages in requirements format.
list List installed packages.
show Show information about installed packages.
search Search PyPI for packages.
wheel Build wheels from your requirements.
zip Zip individual packages.
unzip Unzip individual packages.
bundle Create pybundles.
help Show help for commands.
*************************************************
BeautifulSoup
可以利用pip进行安装:
在cmd中敲入命令查找BeautifulSoup:
C:\Users\***>pip search BeautifulSoup
BeautifulSoup - HTML/XML parser for quick-turnaround applications
like screen-scraping.
pynliner - Python CSS-to-inline-styles conversion tool for
HTML using BeautifulSoup and cssutils
Detextile - Convert HTML to Textile syntax using
BeautifulSoup.
TreeSoup - BeautifulSoup-like wrapper around ElementTree.
beautifulscraper - Python web-scraping library that wraps urllib2 and
BeautifulSoup.
ElementSoup - ElementTree wrapper for BeautifulSoup HTML parser
beautifulsoup4 - Screen-scraping library
collective.soupstrainer - Clean up HTML using BeautifulSoup and filter
rules.
在cmd中敲入命令安装BeautifulSoup
C:\Users\***>pip install BeautifulSoup
Downloading/unpacking BeautifulSoup
Downloading BeautifulSoup-3.2.1.tar.gz
Running setup.py egg_info for package BeautifulSoup
Installing collected packages: BeautifulSoup
Running setup.py install for BeautifulSoup
Successfully installed BeautifulSoup
Cleaning up...
还可参见:安装Beautiful Soup
http://blog.sina.com.cn/s/blog_8af1069601019vr2.html
*************************************************
PyYAML
可以利用pip进行安装
C:\Users\***>pip search pyyaml
PyYAML - YAML parser and emitter for Python
pyaml - PyYAML-based module to produce pretty and readable
YAML-serialized data
yamly - pyyaml wrapper
enhancedyaml - It makes it more convenient to use PyYAML.
C:\Users\***>pip install PyYAML
Downloading/unpacking PyYAML
Downloading PyYAML-3.10.tar.gz (241kB): 241kB downloaded
Running setup.py egg_info for package PyYAML
Installing collected packages: PyYAML
Running setup.py install for PyYAML
checking if libyaml is compilable
Unable to find vcvarsall.bat
skipping build_ext
Successfully installed PyYAML
Cleaning up...
*************************************************
nltk
https://pypi.python.org/pypi/nltk/
nltk 2.0.4
File Type Py Version Uploaded on Size
nltk-2.0.4.tar.gz (md5) Source 2012-11-07 933KB
nltk-2.0.4.win32.exe (md5) MS Windows installer 2.5 2012-11-07 1MB
nltk-2.0.4.zip (md5) Source 2012-11-07 1MB
下载nltk-2.0.4.tar.gz
解压缩,在cmd中进入到nltk-2.0.4目录,执行 python setup.py install
成功标志:
Installed c:\python27\lib\site-packages\nltk-2.0.4-py2.7.egg
Processing dependencies for nltk==2.0.4
Searching for PyYAML==3.10
Best match: PyYAML 3.10
Adding PyYAML 3.10 to easy-install.pth file
Using c:\python27\lib\site-packages
Finished processing dependencies for nltk==2.0.4
打开python Idle:
输入import nltk
输入nltk.download()
出现一个NLTK Downloader对话框,修改Download Diretory(E盘或其他盘符下)。点击all开始下载。
下载慢还可以到NLTK Corpora http://nltk.org/nltk_data/手工下载缺失的,然后放到Download Diretory,zip别删。
重装系统后nltk_data文件夹可以保留,避免重复下载。
*************************************************
mysqldb
http://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python
MySQL-python-1.2.4.win-amd64-py2.7.exe
直接双击安装。
成功验证:
py文件:
import MySQLdb
connection = MySQLdb.connect(host="127.0.0.1",user="root",passwd="root",db="dbtest")
cursor = connection.cursor()
cursor.execute( "SELECT id,content FROM tabletest ")
print "Rows selected:", cursor.rowcount
运行结果输出dbtest数据库中tabletest表的行数。
win7(64bit)python相关环境模块搭建的更多相关文章
- Python学习系列之一: python相关环境的搭建
前言 学习python和使用已经一年多了,这段时间抽空整理了一下以前的笔记,方便日后查阅. Python介绍 Python 是一个高层次的结合了解释性.编译性.互动性和面向对象的脚本语言. Pytho ...
- Python开发环境的搭建(win7)
一个.安装和配置Python 事实上,在开发python最好ubuntu环境.简单和易于扩展每个package. 在谈到如何win7建筑物Python开发环境. 因为python十字-platform ...
- Visual Studio 2017进行Python开发环境的搭建,使用VS2017进行python代码的编写。
Visual Studio 2017进行Python开发环境的搭建,使用VS2017进行python代码的编写. 前提:已经安装过VS2017且进行过配置. 第一部分: Python环境的搭建: 建议 ...
- Sublime text3的安装及python开发环境的搭建
作者:struct_mooc 博客地址:https:////www.cnblogs.com/structmooc/p/12376592.html 一. Sublime text3的安装 1.subli ...
- Sublime text3的安装以及python开发环境的搭建
作者:struct_mooc 博客地址:https://www.cnblogs.com/structmooc/p/12376601.html 一. Sublime text3的安装 1.sublime ...
- python初略复习(2)及python相关数据分析模块的介绍
常用模块 Python中的模块在使用的时候统一都是采用的句点符(.) # 就是模块名点方法的形式 import time time.time() import datetime datetime.da ...
- Win7下Python WEB环境搭建
环境介绍: Win7 64位 SP1 Python:2.7.6 网关接口:flup Nginx安装:http://blog.csdn.net/jacson_bai/article/details/46 ...
- opencv+opencv_contrib 人脸识别和检测 python开发环境快速搭建(30分钟)图文教程
很多朋友为了学习python.ML(机器学习).DL(深度学习).opencv等花费了大量时间配置安装环境(一个朋友花了4天时间才配置好)各种搜索.下载.安装配置,出问题等. 市面上的配置资料很多,选 ...
- db2+python+sqlchemy环境的搭建
记录了通过sqlalchemy 管理db2数据库的环境搭建 1.db2数据库安装配置 利用winscp复制iso文件到/mnt/IBM_db2 目录下 IBM_db2为自己创建 重命名 mv IBM\ ...
随机推荐
- 【Mac】『终端』显示、隐藏所有文件
如果你想打开整个系统的隐藏文件可以在终端下输入以下命令 defaults write com.apple.finder AppleShowAllFiles -bool true 关闭显示隐藏功能def ...
- 【转】angular通过$http与服务器通信
http://www.cooklife.cn/detail/54c5044ec93620284e964b58#View angular是一个前端框架,实现了可交互式的页面,但是对于一个web应用,页面 ...
- cell1这个字符串如何截取掉前边的cell剩下后边的数字 后边数字长度不固定
cell1这个字符串如何截取掉前边的cell剩下后边的数字 后边数字长度不固定'cell1'.replace(/cell/,'')string.substr(4)string.slice(4)
- asp.net文本编辑器(FCKeditor)
FCKeditor介绍 FCKeditor是一个功能强大支持所见即所得功能的文本编辑器,可以为用户提供微软office软件一样的在线文档编辑服务.它不需要安装任何形式的客户端,兼容绝大多数主流浏览器, ...
- VTK三维重建(2)-根据脚部骨骼CT的三维重建和显示
[效果演示] 根据脚部的骨骼CT扫描的照片,利用VTK完成读取和三维重建. [程序实现] void main () { vtkRenderer *aRenderer = vtkRenderer::Ne ...
- 【转】C/C++除法实现方式及负数取模详解
原帖:http://blog.csdn.net/sonydvd123/article/details/8245057 一.下面的题目你能全做对吗? 1.7/4=? 2.7/(-4)=? 3.7%4=? ...
- REST和SOAP
转自:http://blog.csdn.net/smstong/article/details/5312136 我感觉维基百科说的REST解释的就听明白的,摘录下来: 含状态传输(英文:Represe ...
- 2016"百度之星" - 复赛(Astar Round3) 1003 拍照
拍照 思路:先静态,离线树状数组,分别统计每个点向左向右能看到的船的数量.再枚举整个区间求最大值. 应为人和船都是动态的,假设船往左走,处理每个点看到向左最大船的数量,满足动态条件.就是向左的船一开始 ...
- 基于Qt的P2P局域网聊天及文件传送软件设计
基于Qt的P2P局域网聊天及文件传送软件设计 zouxy09@qq.com http://blog.csdn.net/zouxy09 这是我的<通信网络>的课程设计作业,之 ...
- 【Stage3D学习笔记续】山寨Starling(十一):Touch事件体系
我们的山寨Starling版本将会在这里停止更新了,主要还是由于时间比较有限,而且我们的山寨版本也很好的完成了他的任务“了解Starling的核心渲染”,接下来的Starling解析我们将会直接阅读S ...