Yum 报pycurl等三种错误处理方法

727次阅读
没有评论

以下步骤在Centos7.6.1810下测试通过
第一种错误:

pycurl: libcurl link-time ssl backend (nss) is different from compile-time ssl backend (none/other)

第二种错误:

There was a problem importing one of the Python modules required to run yum. The error leading to this problem was:
No module named pycurl 
Please install a package which provides this module, or verify that the module is installed correctly. 
It's possible that the above module doesn't match the current version of Python,
which is: 2.7.5 (default, Aug  7 2019, 00:51:29) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] 
If you cannot solve this problem yourself
please go to the yum faq at:   http://yum.baseurl.org/wiki/Faq

第三种错误:

Exception: `curl-config' not found -- please install the libcurl development files

解决方法如下:
1.先确认yum调用的python版本,部分使用者系统安装了多个版本的python

#查看yum路径
which yum
#查看第一行如果调用的为其他版本python,修改为python2.6或python2.7
cat /usr/bin/yum

2.检查是否已经安装过curl,如无未安装参考下列代码:

#下载比较新的curl版本即可
wget http://curl.haxx.se/download/curl-7.24.0.tar.gz
tar -xvf curl-7.24.0.tar.gz
cd curl-7.24
./configure
make
make install

3.安装pycurl

#下载指定版本pycurl解压
wget http://pycurl.sourceforge.net/download/pycurl-7.19.0.tar.gz
tar -xvf pycurl-7.19.0.tar.gz
cd pycurl-7.19.0
#使用--curl-config=制定curl-config的路径,curl路径替换为自己的路径
python setup.py install --curl-config=/usr/bin/curl-config
#安装成功后应如下所示
Using /usr/local/bin/curl-config (libcurl 7.24.0)
running install
running build
running build_py
running build_ext
running install_lib
copying build/lib.linux-x86_64-2.7/pycurl.so -> /usr/lib/python2.7/site-packages
running install_data
running install_egg_info
Writing /usr/lib/python2.7/site-packages/pycurl-7.19.0-py2.7.egg-info

4.使用yum相关命令测试

yum insatll nodejs
yum list
正文完
 0
Ticifer
版权声明:本站原创文章,由 Ticifer 2023-12-25发表,共计1500字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
评论(没有评论)