这两个路径都是Python 2.6的库文件路径,但它们之间存在一些区别:
总的来说,/usr/local/lib/python2.6是用户自定义的Python库路径,而/usr/lib/python2.6是系统默认的Python库路径。在使用Python时,这两个路径都会被Python解释器搜索,但是如果两个路径下存在同名的库文件,系统会优先使用/usr/local/lib/python2.6下的库文件。
/usr/lib/python2.6/site-packages/ /usr/lib64/python2.6/site-packages/ 我的复制过程是这样的: cp -r /usr/lib/python2.6.../usr/local/lib/python2.7/site-packages/ cp -r /usr/lib/python2.6/site-packages/iniparse /usr/local/lib...-r /usr/lib64/python2.6/site-packages/curl /usr/local/lib/python2.7/site-packages/ cp -p /usr/lib64/...python2.6/site-packages/pycurl.so /usr/local/lib/python2.7/site-packages/ cp -p /usr/lib64/python2.6/.../usr/local/lib/python2.7/site-packages/ cp -p /usr/lib64/python2.6/site-packages/sqlitecachec.pyo /usr
/local/python27/bin/easy_install pip 到这里python2.7.11 和 pip套件都安装了可以使用了。...Python Traceback (most recent call last): File "/usr/lib64/python2.6/runpy.py", line 122, in _run_module_as_main..."__main__", fname, loader, pkg_name) File "/usr/lib64/python2.6/runpy.py", line 34, in _run_code...exec code in run_globals File "/usr/lib/python2.6/site-packages/virtualenvwrapper/hook_loader.py...", line 16, in from stevedore import ExtensionManager File "/usr/lib/python2.6/site-packages
/bin/python2.7 /usr/bin/python /usr/bin/python2.7-config /usr/bin/python2.6 /usr/bin/python2.6-config.../usr/bin/python2.bak /usr/lib/python2.7 /usr/lib/python2.6 /usr/lib64/python2.7 /etc/python /usr/local.../bin/python2.6 /usr/local/bin/python2.6-config /usr/local/lib/python2.6 /usr/include/python2.7 /usr/share.../man/man1/python.1.gz 果真存在两个python: /usr/bin/python2.7和/usr/lib/python2.6 3.查找编辑yum文件 [root@cs7 ~]#.../usr/bin/python2.7 [root@cs7 ~]# 4.补充 CentOS 6只要修改/usr/bin/yum CentOS 7需要同时修改/usr/bin/yum以及/usr/
1.PSSH简介 PSSH提供OpenSSH和相关工具的并行版本。包括pssh,pscp,prsync,pnuke和pslurp。该项目包括psshlib,可以在自定义应用程序中使用。...creating /usr/lib/python2.6/site-packages/psshlib copying build/lib/psshlib/task.py -> /usr/lib/python2.6...-> /usr/lib/python2.6/site-packages/psshlib copying build/lib/psshlib/manager.py -> /usr/lib/python2.6.../lib/psshlib/color.py -> /usr/lib/python2.6/site-packages/psshlib byte-compiling /usr/lib/python2.6/site-packages..._.pyc byte-compiling /usr/lib/python2.6/site-packages/psshlib/cli.py to cli.pyc byte-compiling /usr/lib
import load_entry_point File "/usr/lib/Python2.6/site-packages/pkg_resources.py", line 2655, in working_set.require(__requires__) File "/usr/lib/python2.6/site-packages/pkg_resources.py", line...648, in require needed = self.resolve(parse_requirements(requirements)) File "/usr/lib/python2.6.../configure --prefix=/usr/local/python2.7 make make install 3、创建软连接覆盖系统默认的python ln -fs /usr/local/python2.7.../usr/bin/python2.6 4、安装pip包管理工具 pip是一个安装和管理python包的工具. wget https://raw.github.com/pypa/pip/master/contrib
/configure [root@mq01 Python-2.7]# make && make install python2.7安装后路径默认是在/usr/local/lib/python2.7 [root...@mq01 Python-2.7]# ll /usr/local/lib/ total 9980 -r-xr-xr-x. 1 root root 10191084 Sep 5 06:20 libpython2.7.../python2.6 /usr/bin/python /usr/lib/python2.6 /usr/lib64/python2.6 /usr/local/bin/python2.7 /usr/local.../bin/python /usr/local/bin/python2.7-config /usr/local/lib/python2.7 /usr/include/python2.6 /usr/share.../bin/python /usr/bin/python.bak [root@mq01 Python-2.7]# ln -s /usr/local/bin/python2.7 /usr/bin/python
2008, 'title': 'Python Web Development'} >>> 'year' in book True >>> 'pub' in book False setdefault和get.../usr/bin/python #filename:func_local.py def func(x): print 'x is',x x=2 print 'Changed localx.../lib64/python26.zip', '/usr/lib64/python2.6', '/usr/lib64/python2.6/plat-linux2', '/usr/lib64/python2.6.../lib-tk', '/usr/lib64/python2.6/lib-old', '/usr/lib64/python2.6/lib-dynload', '/usr/lib64/python2.6.../site-packages', '/usr/lib/python2.6/site-packages'] 其中:using_sys.py 是sys.argv[0] we 是 sys.argv
"/usr/local/lib/python2.6/site-packages/tornado-1.2.1-py2.6.egg/tornado/stack_context.py", line 173,...in wrapped File "/usr/local/lib/python2.6/site-packages/tornado-1.2.1-py2.6.egg/tornado/httpserver.py...", line 238, in _handle_events File "/usr/local/lib/python2.6/socket.py", line 195, in accept error:...File "/usr/local/python/lib/python2.6/site-packages/tornado-2.1.1-py2.6.egg/tornado/netutil.py", line...314, in accept_handler File "/usr/local/python/lib/python2.6/socket.py", line 195, in accept error:
1 首先想到动态链接库,于是添加/usr/lib/python3.5/site-packages到ld.so.conf中。 失败。 在网上搜到有答案说要安装python头文件。...我查看/usr/include,有python3.5m目录,包含头文件。 于是想不是这个问题。 然后想到查看lib中的site-packages目录。...于是比较/usr/lib/python3.5/site-packages和/usr/lib/python2.7/site-packages目录。...中的文件拷贝到Python2.6安装目录下的Lib/site-packages即可。...把该解决方法套用过来,将OpenCV安装目录下(我的是/usr/local/lib(/python3.5/site-packages))的cv2.cpython-35m-x86_64-linux-gnu.so
>", line 1, in ImportError: No module named tab >>> import readline >>> 而python2.7默认tab模块和readline...能够import readline成功的原因是因为有这个模块:/usr/lib64/python2.6/lib-dynload/readline.so (默认安装就有的),python2.7.5不能import...操作如下: [root@90-163 lib-dynload]# cp /usr/lib64/python2.6/lib-dynload/readline.so /usr/local/lib/python2.7.../local/lib/python2.7/site-packages 添加一个tab.py文件即可使用import tab,内容如下; [root@90-163 site-packages]# pwd.../usr/local/lib/python2.7/site-packages [root@90-163 site-packages]# cat tab.py try: import readline
/configure --prefix=/usr/local/python2.7 --enable-unicode=ucs4--enable-shared # make && make install...# cd /usr/bin/ # ls -l |grep python # mv python python.back # ln -sv /usr/local/python2.7/bin/python.../usr/bin/python # cp /usr/local/python2.7/lib/libpython2.7.so.1.0 /usr/local/lib # cd /usr/local/lib.../lib/libpython2.7.so.1.0 //显示即OK # vim /etc/ld.so.conf.d/ python2.7.conf /usr/local/lib //添加此内容.../usr/bin/python2.6 //即使用系统原来的python2.6版本
.centos.noarch yum-utils-1.1.30-17.el6_5.noarch 2、查看python版本 [root@mail ~]# whereis python python: /usr.../bin/python2.6 /usr/bin/python /usr/lib/python2.6 /usr/lib64/python2.6 /usr/local/bin/python /usr/local.../bin/python2.7-config /usr/local/bin/python2.7 /usr/local/lib/python2.7 /usr/include/python2.6 /usr/...@mail ~]# sed -i 's#/usr/bin/python#/usr/bin/python2.6#g' /usr/bin/yum 重新查看一下yum ?...现在yum就可以正常使用了 三、问题总结 所以最终到时yum无法正常使用的问题还是python升级导致的,我们只需要更新yum的文件即可,因为yum是python写的,对python版本有要求。
该步骤配合步骤1安装ssl模块 SSL=/usr/local/ssl _ssl _ssl.c -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl.../configure --prefix=/usr/local/python27 make&&make install mv /usr/bin/python /usr/bin/python2.6.6 ...ln -s /usr/local/Python2.7/bin/python2.7 /usr/bin/python vim /usr/bin/yum 修改第一行python为python2.6,保证yum...版本的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/local/python27
8月 18 2016 /usr/bin/python.bak whereis python 1 python: /usr/bin/python /usr/bin/python2.6 /usr/bin.../python.bak /usr/lib/python2.6 /usr/lib64/python2.6 /usr/include/python2.6 /usr/share/man/man1/python...安装完毕,安装目录为 /usr/local/python3 创建软链到执行目录下 /usr/bin ln -s /usr/local/python3/bin/python3 /usr/bin/python3.../local/python3/bin/django-admin /usr/local/python3/bin/django-admin.py /usr/local/python3/lib.../python3.6/site-packages/Django-2.0.5.dist-info/* /usr/local/python3/lib/python3.6/site-packages
Linux下默认系统自带python2.6的版本,这个版本被系统很多程序所依赖,所以不建议删除,如果使用最新的Python3那么我们知道编译安装源码包和系统默认包之间是没有任何影响的,所以可以安装python3.../bin/python [root@node1 ~]# which python3 /usr/local/bin/python3 [root@node1 ~]# ll /usr/bin/python...-f /usr/bin/python /usr/bin/python2 [root@node1 ~]# ln -s /usr/local/bin/python3 /usr/bin/python [root...* lrwxrwxrwx 1 root root 22 1月 4 09:41 /usr/bin/python -> /usr/local/bin/python3 lrwxrwxrwx 1 root..." [root@node1 ~]# ansible all -m shell -a "head -1 /usr/bin/yum-config-manager" 附: mv /usr/local/lib/
#Linux >>> import sys >>> sys.path ['', '/usr/lib64/python26.zip', '/usr/lib64/python2.6', '/usr/lib64.../python2.6/plat-linux2', '/usr/lib64/python2.6/lib-tk', '/usr/lib64/python2.6/lib-old', '/usr/lib64/python2.6.../lib-dynload', '/usr/lib64/python2.6/site-packages', '/usr/lib64/python2.6/site-packages/gtk-2.0', '/...' from '/usr/lib64/python2.6/copy_reg.pyc'>, 'encodings': , 'readline': <module 'readline' from '/usr/lib64/python2.6
>>> import sys >>> print sys.path ['', '/usr/lib64/python26.zip', '/usr/lib64/python2.6', '/usr/lib64.../python2.6/plat-linux2', '/usr/lib64/python2.6/lib-tk', '/usr/lib64/python2.6/lib-old', '/usr/lib64/python2.6.../lib-dynload', '/usr/lib64/python2.6/site-packages', '/usr/lib64/python2.6/site-packages/gtk-2.0', '/...usr/lib/python2.6/site-packages'] >>> sys.path.append('/home/test') >>> import mymoudle
1.1.2-16.el6.x86_64 2.查看python的版本号,发现有2种版本号 [root@bjzw-mcu01-x86p-app01 ~]# whereis python python: /usr.../bin/python2.6 /usr/bin/python /usr/lib/python2.6 /usr/lib64/python2.6 /usr/include/python2.6 /usr/local.../python2.7 /usr/share/man/man1/python.1.gz 3. ...credits" or "license" for more information. 4.修改yum命令所使用的python版本号 [root@bjzw-mcu01-x86p-app01 ~]# vim /usr.../usr/bin/python2.6
1、首先需要安装readline-devel,因为系统默认没有readline相关模块,如果不安装此模块,则在python的shell里使用方向键和删除键会出现乱码。 .../configure --prefix=/usr/local/python2.7 make make install 3、创建链接使系统默认的python变为python2.7 ln -fs /usr.../usr/bin/python修改为系统原有的python版本地址#!/usr/bin/python2.6 至此,python已经升级完成。...所以可以将原来/usr/lib/python2.6/site-packages里的东西全复制到python2.7的目录(/usr/local/python2.7/lib/python2.7/site-packages.../) cp -pr /usr/lib/python2.6/site-packages/* /usr/local/python2.7/lib/python2.7/site-packages/
File "/usr/lib/python2.6/site-packages/swift/common/utils.py", line 1558, in wrapped#012 return...", line 712, in PUT#012 file.put(fd, metadata)#012 File "/usr/lib64/python2.6/contextlib.py", line.../swift/obj/server.py", line 286, in mkstemp#012 yield fd#012 File "/usr/lib/python2.6/site-packages...#012 sample_rate)#012 File "/usr/lib/python2.6/site-packages/swift/common/utils.py", line 496, in..._send(metric, timing_ms, 'ms', sample_rate)#012 File "/usr/lib/python2.6/site-packages/swift/common/
领取专属 10元无门槛券
手把手带您无忧上云