python2.6 升级为 2.7 CentOS 6.3自带的Python版本为2.6,首先需要升级到2.7版本。由于旧版本的Python已被深度依赖,所以不能卸载原有的Python,只能全新安装。
/usr/bin/python2.6
usr/bin/python2.6.6 8.配置iBus 将/usr/bin/ibus-setup 和 /usr/libexec/ibus-ui-gtk 这两个文件中exec python改为exec python2.6...87083c0b9867963b29f7aba3613e8f4 tar zxvf pip-8.1.2.tar.gz cd pip-8.1.2 python setup.py install 11,测试pip是否可用 # pip install mysql-python...执行下面的命令可以解决这个问题: mv /usr/bin/pip /usr/bin/pip_bak ln -sv /usr/local/bin/pip2.7 /usr/bin/pip pip install mysql-python
查看版本 [root@localhost Python-2.7.8]# python Python 2.6.6 (r266:84292, Aug 18 2016...
centos安装默认python2.6升级为python2.7,并解决python工具包安装的各种问题。 思路指导:升级2.7不能用yum安装python工具包。...local/ # 编译安装: make make install # 检查 Python 版本: [root@dbmasterxxx ~]# python2.7 -V Python 2.7.8 4.备份python2.6...,设置python2.7 mv /usr/bin/python /usr/bin/python2.6 ln -s /usr/local/bin/python2.7 /usr/bin/python...Python 2.7.8 5.pip安装(pip 是一个安装和管理 Python 包的工具,用于取代easy_install) 升级为2.7后安装python模块不能使用yum,因为yum会把模块默认安装到python2.6
requests Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.6.../site-packages/requests/__init__.py", line 43, in import urllib3 File "/usr/lib/python2.6...connectionpool import HTTPConnectionPool, HTTPSConnectionPool, connection_from_url File "/usr/lib/python2.6...这种情况可以选择MySQL的Python驱动包代替,pip安装MySQL的Python驱动包也不一定成功,我最后用yum安装成功的。 ? 更奇葩的是2.6下,django也无法安装成功, ?
,因为ContOS里的很多库依赖Python2.6,当安装完Python2.7后会出现各种问题。如果能让其2个版本很好的并存可以解决此问题。...bootstrap.pypa.io/get-pip.py | python2.7 解决yum不能用的问题 因为yum不支持pthon2.7经过上面的步骤你会发现yum不能用了,这们上面安装的时候并没有移除掉python2.6.../usr/bin/python2.6 现在运行一下yum看看是不是能用了。 以上就是本文的全部内容,希望对大家的学习有所帮助。
/usr/bin/python python修改为 python2.6 import sys try: import yum except ImportError:
1, download Python2.7 wget https://www.python.org/ftp/python/2.7.9/Python-2....
/usr/bin/python2.6 这样,整个升级过程才算完成!!.../usr/bin/python2.6 pip安装报错如下: Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-root
源码包安装pip 下载 https://pypi.python.org/packages/source/p/pip/ tar zxvf pip-0.7.2.tar.gz cd pip-0.7.2 python2.6...install 到此python-pip安装成功 联网安装 pip install python-debugtools https://pypi.python.org/packages/source/M/MySQL-python.../ tar zxvf MySQL-python-1.2.3.tar.gz cd MySQL-python-1.2.3 yum install python-dev python2.6 setup.py...build python2.6 setup.py install python2.6 >>> import MySQLdb .
File "/usr/lib64/python2.6/ssl.py", line 136, in read return self....-I/usr/include/python2.6 -c _mysql.c -o build/temp.linux-x86_64-2.6/_mysql.o -g -pipe -Wp,-D_FORTIFY_SOURCE.../my_config.h:14, from _mysql.c:44: /usr/include/mysql/my_config_x86_64.h:1082...from /usr/include/python2.6/Python.h:8, from _mysql.c:29:...gcc -pthread -shared build/temp.linux-x86_64-2.6/_mysql.o -L/usr/lib64/mysql -L/usr/lib64 -lmysqlclient_r
package/scripts/hive_metastore.py", line 259, in HiveMetastore().execute() File "/usr/lib/python2.6...package/scripts/hive_metastore.py", line 73, in configure hive(name = 'metastore') File "/usr/lib/python2.6...0.12.0.2.0/package/scripts/hive.py", line 320, in hive user = params.hive_user File "/usr/lib/python2.6...273, in action_run tries=self.resource.tries, try_sleep=self.resource.try_sleep) File "/usr/lib/python2.6...core/shell.py", line 141, in _call_wrapper result = _call(command, **kwargs_copy) File "/usr/lib/python2.6
1)编译安装python2.7 [root@mysql-master ~]# python -V Python 2.6.6 查看python的版本信息(之前的yum是通过yum安装的) [root@mysql-master....tar.xz [root@mysql-master src]# ls debug kernels Python-2.7.9.tar [root@mysql-master src]# tar -xf... Python-2.7.9.tar [root@mysql-master src]# cd Python-2.7.9 [root@mysql-master Python-2.7.9]# ....-2.7.9]# mv /usr/bin/python /usr/bin/python2.6 mv:是否覆盖"/usr/bin/python2.6"? .../usr/bin/python2.6 import sys try: import yum except ImportError: print >> sys.stderr, """\ There
版权声明:本文为博主原创文章,转载请注明源地址。 https://blog.csdn.net...
MySQL-python是Python访问MySQL数据库的第三方模块库; 在安装过程中出现如下错误: [root@localhost MySQL-python-1.2.5]# python setup.py...setuptools # python setup.py build 开始执行setuptools安装 # python setup.py install 安装完成; # ls -l /usr/lib/python2.6.../site-packages/setuptools-0.6c11-py2.6.egg -rw-r--r--. 1 root root 333591 Mar 29 14:21 /usr/lib/python2.6
简单写一下如何升级Python2.6到Python2.7并能同步使用pip,以及通过pip安装Django。踩过不少坑,总结了下,按下面步骤逐步安装不然会有报错。...python2.6.6 ln -s /usr/local/Python2.7/bin/python2.7 /usr/bin/python vim /usr/bin/yum 修改第一行python为python2.6...install ln -s /usr/local/python27/bin/pip /usr/bin/pip 5、安装MySQLdb(用Python操作数据库的一个模块) yum install -y MySQL-python...#先安装2.6版本的MySQLdb 把2.6包下的MySQLdb相关文件copy到2.7的包目录下 cp -r /usr/lib64/python2.6/site-packages/MySQLdb /...usr/local/python27/lib/python2.7/site-packages/ cp -r /usr/lib64/python2.6/site-packages/_mysql* /usr
ln -s /usr/local/mysql_5.7/bin/mysql_config /usr/bin/mysql_config 然后继续调用下面的命令。..._5.7/include -I/usr/include/python2.6 -c _mysql.c -o build/temp.linux-x86_64-2.6/_mysql.o _mysql.c:29...directory _mysql.c:74: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token _mysql.c...>>> import MySQLdb /usr/lib64/python2.6/site-packages/MySQL_python-1.2.5-py2.6-linux-x86_64.egg/_mysql.py...:3: UserWarning: Module _mysql was already imported from /usr/lib64/python2.6/site-packages/MySQL_python
apr* neon* yum -y install mysql-server 可以选择yum安装mysql 或者编译安装mysql 注,编译安装的mysql,90%运维会装在/usr/local/mysql...对于编译安装的mysql,解决办法如下 yum安装的mysql命令将在/usr/local/bin/下,不需要软连。.../bin/* /usr/local/bin/ mysql安装此处不再介绍 编译也好,yum也好,看需求及使用mysql的级别。...mkdir /usr/lib64/python2.6/site-packages/pysvn cp pysvn/__init__.py /usr/lib64/python2.6/site-packages.../pysvn cp pysvn/_pysvn*.so /usr/lib64/python2.6/site-packages/pysvn 5、 安装mod_wsgi yum -y install mod_wsgi
[root@localhost opt]# wget http://sourceforge.net/projects/mysql-python/files/mysql-python/1.2.3/MySQL-python...‘result’ _mysql.c: In function ‘_mysql_ResultObject_dealloc’: _mysql.c:2100: warning...[0].offset’) _mysql.c: In function ‘_mysql_ConnectionObject_getattr’: _mysql.c:2444..."help", "copyright", "credits" or "license" for more information. >>> import MySQLdb /usr/local/lib/python2.6...already imported from /usr/local/lib/python2.6/site-packages/MySQL_python-1.2.3-py2.6-linux-x86_64.egg
领取专属 10元无门槛券
手把手带您无忧上云