【python】prepare for python env

//////

////// install pip

//////

[[email protected] tools]# python get-pip.py

/tmp/tmp4BEPxg/pip.zip/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.

You are using pip version 7.0.3, however version 7.1.2 is available.

You should consider upgrading via the ‘pip install --upgrade pip‘ command.

Collecting pip

/tmp/tmp4BEPxg/pip.zip/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.

Downloading pip-7.1.2-py2.py3-none-any.whl (1.1MB)

100% |████████████████████████████████| 1.1MB 50kB/s

Collecting wheel

Downloading wheel-0.26.0-py2.py3-none-any.whl (63kB)

100% |████████████████████████████████| 65kB 35kB/s

Installing collected packages: pip, wheel

Successfully installed pip-7.1.2 wheel-0.26.0

[[email protected] tools]#

//////

////// upgrade pip

//////

[[email protected] tools]# pip install --upgrade pip

Requirement already up-to-date: pip in /usr/lib/python2.7/site-packages

[[email protected] tools]#

//////

////// install tornado

//////

[[email protected] tools]# pip install tornado

Collecting tornado

/usr/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.

InsecurePlatformWarning

Downloading tornado-4.3.tar.gz (450kB)

100% |████████████████████████████████| 454kB 583kB/s

Requirement already satisfied (use --upgrade to upgrade): backports.ssl-match-hostname in /usr/lib/python2.7/site-packages (from tornado)

Collecting singledispatch (from tornado)

Downloading singledispatch-3.4.0.3-py2.py3-none-any.whl

Collecting certifi (from tornado)

Downloading certifi-2015.9.6.2-py2.py3-none-any.whl (371kB)

100% |████████████████████████████████| 372kB 273kB/s

Collecting backports-abc>=0.4 (from tornado)

Downloading backports_abc-0.4-py2.py3-none-any.whl

Requirement already satisfied (use --upgrade to upgrade): six in /usr/lib/python2.7/site-packages (from singledispatch->tornado)

Building wheels for collected packages: tornado

Running setup.py bdist_wheel for tornado

Stored in directory: /root/.cache/pip/wheels/2d/e6/19/1a61a89abb78cc3e1761a5844eaa1fdc86fd41b38353df5967

Successfully built tornado

Installing collected packages: singledispatch, certifi, backports-abc, tornado

Successfully installed backports-abc-0.4 certifi-2015.9.6.2 singledispatch-3.4.0.3 tornado-4.3

[[email protected] tools]#

//////

////// install mysql-python

//////

[[email protected] tools]# pip install mysql-python

Collecting mysql-python

/usr/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.

InsecurePlatformWarning

Downloading MySQL-python-1.2.5.zip (108kB)

100% |████████████████████████████████| 110kB 412kB/s

Building wheels for collected packages: mysql-python

Running setup.py bdist_wheel for mysql-python

Complete output from command /usr/bin/python -c "import setuptools;__file__=‘/tmp/pip-build-yf1v45/mysql-python/setup.py‘;exec(compile(open(__file__).read().replace(‘\r\n‘, ‘\n‘), __file__, ‘exec‘))" bdist_wheel -d /tmp/tmpbTaMkNpip-wheel-:

running bdist_wheel

running build

running build_py

creating build

creating build/lib.linux-x86_64-2.7

copying _mysql_exceptions.py -> build/lib.linux-x86_64-2.7

creating build/lib.linux-x86_64-2.7/MySQLdb

copying MySQLdb/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb

copying MySQLdb/converters.py -> build/lib.linux-x86_64-2.7/MySQLdb

copying MySQLdb/connections.py -> build/lib.linux-x86_64-2.7/MySQLdb

copying MySQLdb/cursors.py -> build/lib.linux-x86_64-2.7/MySQLdb

copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb

copying MySQLdb/times.py -> build/lib.linux-x86_64-2.7/MySQLdb

creating build/lib.linux-x86_64-2.7/MySQLdb/constants

copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants

copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants

copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants

copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants

copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants

copying MySQLdb/constants/REFRESH.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants

copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants

running build_ext

building ‘_mysql‘ extension

creating build/temp.linux-x86_64-2.7

gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Dversion_info=(1,2,5,‘final‘,1) -D__version__=1.2.5 -I/usr/include/mysql -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o -g -m64 -fPIC -g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing

unable to execute gcc: No such file or directory

error: command ‘gcc‘ failed with exit status 1

----------------------------------------

Failed building wheel for mysql-python

Failed to build mysql-python

Installing collected packages: mysql-python

Running setup.py install for mysql-python

Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__=‘/tmp/pip-build-yf1v45/mysql-python/setup.py‘;exec(compile(getattr(tokenize, ‘open‘, open)(__file__).read().replace(‘\r\n‘, ‘\n‘), __file__, ‘exec‘))" install --record /tmp/pip-OxlOGK-record/install-record.txt --single-version-externally-managed --compile:

running install

running build

running build_py

running build_ext

building ‘_mysql‘ extension

gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Dversion_info=(1,2,5,‘final‘,1) -D__version__=1.2.5 -I/usr/include/mysql -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o -g -m64 -fPIC -g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing

unable to execute gcc: No such file or directory

error: command ‘gcc‘ failed with exit status 1

----------------------------------------

Command "/usr/bin/python -c "import setuptools, tokenize;__file__=‘/tmp/pip-build-yf1v45/mysql-python/setup.py‘;exec(compile(getattr(tokenize, ‘open‘, open)(__file__).read().replace(‘\r\n‘, ‘\n‘), __file__, ‘exec‘))" install --record /tmp/pip-OxlOGK-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-yf1v45/mysql-python

[[email protected] tools]#

//////

////// install dev support

//////

# yum install gcc

# yum install gcc-c++

# yum install python-devel

# yum install git

# yum install subversion

时间: 2024-10-05 17:34:17

【python】prepare for python env的相关文章

【python】ipython与python的区别

[python]ipython与python的区别 (2014-06-05 12:27:40) 转载▼   分类: Python http://mba.shengwushibie.com/itbook/BookChapter.asp?id=8745 http://www.cnblogs.com/yangze/archive/2011/07/11/2103040.html http://matrix.42qu.com/10735149 http://www.cnblogs.com/weishun/

【leetcode】Candy(python)

题目要求比其高的邻居要比本身的奖励多,那么最少也要多一个,所有我们可以找到所有的凹点,凹点如下三种情形. 找到所有的凹点后,我们就可以从凹点处开始向左右两个方向依次查找递增序列,其中每个高的都要比相邻的矮的多一个,比如1,2,5,4.我们找到凹点为1 和4,那么从1开始向左没有其他点,我们向右,依次得到2 比1高,2的糖果应该是1的基础上加1,为2, 5比2高,5的糖果是在2的基础上加1,为3.令一个凹点4, 向左,5比4高,5的糖果应该是在4的基础上加 1,为2,这时我们发现冲突了,从凹点1

【Python】决策树的python实现

[Python]决策树的python实现 2016-12-08 数据分析师Nieson 1. 决策树是什么? 简单地理解,就是根据一些 feature 进行分类,每个节点提一个问题,通过判断,将数据分为几类,再继续提问.这些问题是根据已有数据学习出来的,再投入新数据的时候,就可以根据这棵树上的问题,将数据划分到合适的叶子上. 2. 决策树有什么算法? 常用的几种决策树算法有ID3.C4.5.CART: ID3:选择信息熵增益最大的feature作为node,实现对数据的归纳分类. C4.5:是I

【总结】学用python写程序

工作多年,因为项目需要,用过的编程语言不少了:c/c++.java.c#.汇编.vb.objective c.apple script.不过主要使用的还是c/c++,一方面是用得久了,习惯了.另一方面,思考问题的方式已经偏"底层"了,不想内存.不考虑指针,似乎就浑身冷汗,无法编程了.连带我在面试一些小朋友的时候也会不自觉的问一些底层的知识点.再有一方面,就是想要程序的运行效率更高一些,个人一直以写高效的(算法)程序为目标,而c/c++是除了汇编之外的,能写出的运行效率最高的编程语言--

【原创】MySQL 以及 Python 实现排名窗口函数

大部分数据库都提供了窗口函数,比如RANK,ROW_NUMBER等等. MySQL 这方面没有直接提供,但是可以变相的实现,我以前写了row_number 的实现,今天有时间把 rank 的实现贴出来. 这里,我用MySQL 以及Python 分别实现了rank 窗口函数. 原始表信息: t_girl=# \d group_concat; Table "ytt.group_concat" Column | Type | Modifiers ----------+------------

【学习】JennyHui学Python

主要学习材料:<笨办法学习Python> ,(虫师的博客) 后面根据虫师的Python教程再对Pyhon进行了一次重新学习 ========================================================================= <笨办法学习Python> 注释什么的对菜鸟来说真的很重要 python的各种函数 学会记录自己的错误 各种转义字符 Pydoc,待理解 Python输入的另一种方法 读取文件(1) 读取文件(2) 方法和变量 方

【爬虫】如何用python+selenium网页爬虫

一.前提 爬虫网页(只是演示,切勿频繁请求):https://www.kaola.com/ 需要的知识:Python,selenium 库,PyQuery 参考网站:https://selenium-python-zh.readthedocs.io/en/latest/waits.html 二.简单的分析下网站 三.步骤 1.目标: 1.open brower 2.open url from selenium import webdriver from selenium.common.excep

【转】详解Python的装饰器

原文链接:http://python.jobbole.com/86717/ Python中的装饰器是你进入Python大门的一道坎,不管你跨不跨过去它都在那里. 为什么需要装饰器 我们假设你的程序实现了say_hello()和say_goodbye()两个函数. def say_hello(): print "hello!" def say_goodbye(): print "hello!" # bug here if __name__ == '__main__':

【Python】Linux下python科学计算库的安装

scipy系列库有相当多的依赖,导致安装过程比较痛苦.要不停的去找依赖. 发现一个小日本给出的安装过程: 原载: http://memo.yomukaku.net/entries/jbRkQkq 1.  安装Python 2.7.3 Python 2.7.3のインストール cd src wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz tar zxvf Python-2.7.3.tgz cd Python-2.7.3 ./c