首页 > 学院 > 开发设计 > 正文

cnetos6.4x64阿里云环境初探--安装pip,及pymysql

2019-11-14 17:22:32
字体:
来源:转载
供稿:网友

由于以前帮朋友买过阿里云服务器,一直以为,不能再体验新用户免费了,由于最近比较有心情研究python,linux,就报着侥幸的心理,重新注册一个帐号试一下,注册完之后,惊奇的发现,原来阿里只要是新注册的帐户就可以免费申请半年的ces,不验证身份信息,同一个实名认证下不同的帐号,也可以免费申请,开了1M带宽,并顺手申请了免费的数据库,yeah….开始真正的服务器学习之旅了.

centos6.5下默认的python 是2.6.6 本来想升级到2.7的, bing了一下,发现升级后有系统默认的很多东西要重新配,比如yum ,所以做罢,2.6就2.6吧.

下面是安装 pip 和pyMySQL过程

[root@iZ28w7cidk2Z ~]# yum install python-pipLoaded plugins: securitySetting up Install PRocessResolving Dependencies--> Running transaction check---> Package python-pip.noarch 0:1.3.1-4.el6 will be installed--> Finished Dependency ResolutionDependencies Resolved================================================================================ Package             Arch            Version                Repository     Size================================================================================Installing: python-pip          noarch          1.3.1-4.el6            epel          330 kTransaction Summary================================================================================Install       1 Package(s)Total download size: 330 kInstalled size: 1.0 MIs this ok [y/N]: yDownloading Packages:python-pip-1.3.1-4.el6.noarch.rpm                        | 330 kB     00:00     Running rpm_check_debugRunning Transaction TestTransaction Test SucceededRunning Transaction  Installing : python-pip-1.3.1-4.el6.noarch                                1/1   Verifying  : python-pip-1.3.1-4.el6.noarch                                1/1 Installed:  python-pip.noarch 0:1.3.1-4.el6                                               Complete![root@iZ28w7cidk2Z ~]# pip install pymysqlDownloading/unpacking pymysql  Downloading PyMySQL-0.6.3.tar.gz (53kB): 53kB downloaded  Running setup.py egg_info for package pymysqlInstalling collected packages: pymysql  Running setup.py install for pymysqlSuccessfully installed pymysqlCleaning up...[root@iZ28w7cidk2Z ~]# pythonPython 2.6.6 (r266:84292, Jan 22 2014, 09:42:36) [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2Type "help", "copyright", "credits" or "license" for more information.>>> import pymysql>>>

其实 就两句:

#yum install python-pip#pip install pymysql

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表