1500字范文,内容丰富有趣,写作好帮手!
1500字范文 > 解决 error: command 'swig' failed with exit status 1

解决 error: command 'swig' failed with exit status 1

时间:2020-08-05 05:05:28

相关推荐

解决 error: command 'swig' failed with exit status 1

独角兽企业重金招聘Python工程师标准>>>

# pip install docker-registry

分析:观察出现的错误,发现最开始报错的地方提示不能找到openssl的.h头文件。一般.h头文件都是放到/usr/inclue目录下的,而且头文件所在的安装包一般叫openssl-devel。

解决办法:使用yum install openssl-devel安装openssl的头文件,成功后重新执行pip install docker-registry。又出现了下面的错误

running build_ext

building 'M2Crypto.__m2crypto' extension

swigging SWIG/_m2crypto.i to SWIG/_m2crypto_wrap.c

swig -python -I/usr/include/python2.7 -I/usr/include -I/usr/include/openssl -includeall -modern -o SWIG/_m2crypto_wrap.c SWIG/_m2crypto.i

/usr/include/openssl/opensslconf.h:36: Error: CPP #error ""This openssl-devel package does not work your architecture?"". Use the -cpperraswarn option to continue swig processing.

error: command 'swig' failed with exit status 1

即“/usr/include/openssl/opensslconf.h:36: Error: CPP #error ""This openssl-devel package does not work your architecture?"". Use the -cpperraswarn option to continue swig processing.”

网上说的,重新安装m2crypto,先卸载系统中已经安装的m2crypto再用pip安装的方法都是没有用的。

解决办法:这个提示大意是说openssl-devel版本不适合你的系统架构,也就是x86的去找x86的头文件,x86_64的去找x86_64文件,但现在是互相找不到对方。

查看一下安装的文件是否x86和x64位的头文件都有

# ls /usr/include/openssl/

opensslconf-x86_64.h opensslconf.h

文件都是存在的。看一下哪个文件报的错,/usr/include/openssl/opensslconf.h:36,第36行报错,打开这个文件

默认去找x86_64位的头文件报了错,那就说明希望去找x86的文件了,修改方法如下

再次执行pip install docker-registry

……

Successfully installed M2Crypto-0.22.3 docker-registry-0.9.1 sqlalchemy-0.9.4

问题解决

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。