前言:
眼前大家对“centos452报错”大概比较着重,看官们都需要剖析一些“centos452报错”的相关知识。那么小编同时在网上搜集了一些关于“centos452报错””的相关资讯,希望各位老铁们能喜欢,你们一起来了解一下吧!背景
在安装python 的过程中遇到的一些报错.贴上解决办法
具体报错
报错1
[root@xunjian ~]# pip install mysql-pythonDEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at pip 21.0 will remove support for this functionality.Collecting mysql-python Using cached MySQL-python-1.2.5.zip (108 kB)Building wheels for collected packages: mysql-python Building wheel for mysql-python (setup.py) ... error ERROR: Command errored out with exit status 1: command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-N3rhLO/mysql-python/setup.py'"'"'; __file__='"'"'/tmp/pip-install-N3rhLO/mysql-python/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-VJKqE2 cwd: /tmp/pip-install-N3rhLO/mysql-python/ Complete output (30 lines): 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/data/app/mysql/include -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o _mysql.c:44:23: fatal error: my_config.h: No such file or directory #include "my_config.h" ^ compilation terminated. error: command 'gcc' failed with exit status 1 ---------------------------------------- ERROR: Failed building wheel for mysql-python Running setup.py clean for mysql-pythonFailed to build mysql-pythonInstalling collected packages: mysql-python Running setup.py install for mysql-python ... error
解决方法:
查看自己的/usr/bin 目录下的python对不对[root@xunjian lepus]# ll /usr/bin/pypydoc python python2 python2.7-config python2-config python.bak python-config 我目录下边的这个python默认不是2.7的python的软连接.所以我把这个python改为了python2.7的mv python python.bak[root@xunjian bin]# mv python2.7 python
再执行
root@xunjian data]# pip install mysql-pythonDEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at pip 21.0 will remove support for this functionality.Collecting mysql-python Using cached MySQL-python-1.2.5.zip (108 kB)Building wheels for collected packages: mysql-python Building wheel for mysql-python (setup.py) ... done Created wheel for mysql-python: filename=MySQL_python-1.2.5-cp27-cp27mu-linux_x86_64.whl size=84943 sha256=ebe4a01c2b575e60d61c5351d1fd416e1b4d778dcd0195761bd64119a45d20cc Stored in directory: /root/.cache/pip/wheels/55/eb/3b/661bdcd5ca5a576f0331400468db9d5dcbda118fb6c85fd3eeSuccessfully built mysql-pythonInstalling collected packages: mysql-pythonSuccessfully installed mysql-python-1.2.5已解决
报错2:
bash: pip:command not find
在CentOS7中,python基础版本是2.7 但是默认是没有装pip的.所以我们需要手动装一下pip
curl -O get-pip.py
问题解决
问题3:
ImportError: libmysqlclient.so.20: cannot open shared object file: No such file or directory
解决办法:
从自己的mysql程序目录下找出libmysqlclient.so.20 文件.然后软链接到/usr/lib64/libmysqlclient.so.20ln -s /opt/mysql/lib/libmysqlclient.so.20 /usr/lib64/libmysqlclient.so.20
版权声明:
本站文章均来自互联网搜集,如有侵犯您的权益,请联系我们删除,谢谢。
标签: #centos452报错