win7(64bit)python相关环境模块搭建

操作方法

  • 01

    包括Python,eclipse,jdk,pydev,pip,setuptools,beautifulsoup,pyyaml,nltk,mysqldb的下载安装配置。 *************************************************python下载:python-2.7.6.amd64.msihttp://www.python.org/Python 2.7.6 releasedPython 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.pyhello python C:\Users\***> *************************************************Eclipse:eclipse-java-indigo-SR2-win32-x86_64.ziphttp://www.eclipse.org/downloads/Older Versionshttp://wiki.eclipse.org/Older_Versions_Of_EclipseEclipse Indigo SR2 Packages (v 3.7.2)http://www.eclipse.org/downloads/packages/release/indigo/sr2Eclipse 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.zipDownload eclipse-java-indigo-SR2-win32-x86_64.zip from: *************************************************jdk:jdk-7u45-windows-x64.exehttp://www.oracle.com/technetwork/java/javase/downloads/index.htmlWindows 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文件的目录 *************************************************piphttps://pypi.python.org/pypi/pipDownloadpip-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 *************************************************setuptoolshttps://pypi.python.org/pypi/setuptools/setuptools 2.0.2点击右侧Downloads按钮,跳至DownloadsScroll to the very bottom of the page to find the links.需要到页面底部去找链接下载。 File Type Py Version Uploaded on Sizesetuptools-2.0.2-py2.py3-none-any.whl (md5)  Python Wheel  3.4 2013-12-29 527KBsetuptools-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.eggProcessing dependencies for setuptools==2.0.2Finished processing dependencies for setuptools==2.0.2 继续安装pip *************************************************pip在cmd中进入到pip-1.4.1目录,执行 python setup.py install成功标记:Installed c:\python27\lib\site-packages\pip-1.4.1-py2.7.eggProcessing dependencies for pip==1.4.1Finished 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 BeautifulSoupBeautifulSoup             - HTML/XML parser for quick-turnaround applications                            like screen-scraping.pynliner                  - Python CSS-to-inline-styles conversion tool for                            HTML using BeautifulSoup and cssutilsDetextile                 - 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 parserbeautifulsoup4            - Screen-scraping librarycollective.soupstrainer   - Clean up HTML using BeautifulSoup and filter                            rules.在cmd中敲入命令安装BeautifulSoupC:\Users\***>pip install BeautifulSoupDownloading/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 BeautifulSoupCleaning up...还可参见:安装Beautiful Souphttp://blog.sina.com.cn/s/blog_8af1069601019vr2.html *************************************************PyYAML 可以利用pip进行安装C:\Users\***>pip search pyyamlPyYAML                    - YAML parser and emitter for Pythonpyaml                     - PyYAML-based module to produce pretty and readable                            YAML-serialized datayamly                     - pyyaml wrapperenhancedyaml              - It makes it more convenient to use PyYAML. C:\Users\***>pip install PyYAMLDownloading/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 PyYAMLCleaning up... *************************************************nltkhttps://pypi.python.org/pypi/nltk/nltk 2.0.4File Type Py Version Uploaded on Sizenltk-2.0.4.tar.gz (md5)  Source  2012-11-07 933KBnltk-2.0.4.win32.exe (md5)  MS Windows installer  2.5 2012-11-07 1MBnltk-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.eggProcessing dependencies for nltk==2.0.4Searching for PyYAML==3.10Best match: PyYAML 3.10Adding PyYAML 3.10 to easy-install.pth fileUsing c:\python27\lib\site-packagesFinished 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文件夹可以保留,避免重复下载。 *************************************************mysqldbhttp://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-pythonMySQL-python-1.2.4.win-amd64-py2.7.exe直接双击安装。 成功验证:py文件:import MySQLdbconnection = 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表的行数。

(0)

相关推荐

  • 如何在win7下设置python的环境变量

    在win7中安装python,并且设置python的环境变量,方便在cmd中,直接输入. 操作方法 01 反键点击"计算机",然后点击"属性",如图所示: 02 ...

  • 如何搭建python开发环境(python需要搭建环境吗)

    Python环境搭建Python是一个跨平台.可移植的编程语言,因此可在windows.Linux和Mac OS X系统中安装使用. 安装完成后,你会得到Python解释器环境,可以通过终端输入pyt ...

  • win7系统下如何为python配置环境变量

    环境变量是在操作系统中一个具有特定名字的对象,它包含了一个或者多个应用程序所将使用到的信息.比如Windows和DOS操作系统中的path环境变量,那么Win7系统下怎么配置python环境变量?下面 ...

  • 怎么用python的pdb模块进行调试?

    python目前可能是最流行的编程语言,比如人工智能,机器学习,神经网络等在2017年非常火的领域基本上都是和python相关的.这个指南就是简单介绍python是怎么进行简单的代码调试. 操作方法 ...

  • Win7系统中的环境变量PATH怎么修改

    方法一、通过命令设置环境变量 1、打开“开始→运行”,在运行框中“cmd”,回车打开命令提示符窗口; 2、在打开的命令提示符窗口中,输入“path”,回车就可查看环境变量设置; 3、 更改环境变量有两 ...

  • Python利用operator模块实现对象的多级排序

    最近在工作中碰到一个小的排序问题,需要按嵌套对象的多个属性来排序,于是发现了Python里的operator模块和sorted函数组合可以实现这个功能.本文介绍了Python用operator模块实现 ...

  • Notepad++配置C/C++、C#、Java、Python编译环境详细教程

    如果只是测试小程序可以用这种方法 比较方便,如果对于大程序建议使用专业的IDE. 经常需要写一些小程序来运行,又不想运行Visual Studio.Eclipse这样的环境,而Notepad++是一个 ...

  • APMServ教程 PHP环境的搭建之利器

    今天讲本地php环境的搭建,主要是利用APMServ软件,不仅仅简单,而且是快速。 PHP环境的搭建 – APMServ APMServ是一款快速搭建Apache2.2.X、PHP5.2.X、MySQ ...

  • python 如何安装模块

    Python作为现在非常流行的语言,可以说是非常的火了.特别是它的模块的概念,让开发者可以使用丰富的第三方模块.开发出丰富的应用,下面就跟随本教程一起来学习如何在Python中安装模块吧. pip安装 ...