日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

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

發(fā)布時(shí)間:2023/11/29 编程问答 46 豆豆
生活随笔 收集整理的這篇文章主要介紹了 解决 error: command 'swig' failed with exit status 1 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

2019獨(dú)角獸企業(yè)重金招聘Python工程師標(biāo)準(zhǔn)>>>

# pip install docker-registry


分析:觀察出現(xiàn)的錯(cuò)誤,發(fā)現(xiàn)最開(kāi)始報(bào)錯(cuò)的地方提示不能找到openssl.h頭文件。一般.h頭文件都是放到/usr/inclue目錄下的,而且頭文件所在的安裝包一般叫openssl-devel。

解決辦法:使用yum install openssl-devel安裝openssl的頭文件,成功后重新執(zhí)行pip install docker-registry。又出現(xiàn)了下面的錯(cuò)誤

??? 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.

網(wǎng)上說(shuō)的,重新安裝m2crypto,先卸載系統(tǒng)中已經(jīng)安裝的m2crypto再用pip安裝的方法都是沒(méi)有用的。

解決辦法:這個(gè)提示大意是說(shuō)openssl-devel版本不適合你的系統(tǒng)架構(gòu),也就是x86的去找x86的頭文件,x86_64的去找x86_64文件,但現(xiàn)在是互相找不到對(duì)方。

查看一下安裝的文件是否x86x64位的頭文件都有

# ls /usr/include/openssl/

opensslconf-x86_64.h ?opensslconf.h

文件都是存在的??匆幌履膫€(gè)文件報(bào)的錯(cuò),/usr/include/openssl/opensslconf.h:36,第36行報(bào)錯(cuò),打開(kāi)這個(gè)文件

#include "opensslconf-sparc.h"

#elif defined(__x86_64__)

#include "opensslconf-x86_64.h"??? #原來(lái)是這樣寫的,說(shuō)明默認(rèn)去找x86_64位的頭文件

#else

#error "This openssl-devel package does not work your architecture?"

#endif

?

#undef openssl_opensslconf_multilib_redirection_h

默認(rèn)去找x86_64位的頭文件報(bào)了錯(cuò),那就說(shuō)明希望去找x86的文件了,修改方法如下

#include "opensslconf-sparc.h"

#elif defined(__x86_64__)

#include "opensslconf-x86_64.h"

#else

#include "opensslconf.h"???? #去掉了原來(lái)的error提示,改成了安裝opensslconf.h文件。

#endif

?

#undef openssl_opensslconf_multilib_redirection_h

再次執(zhí)行pip install docker-registry

……

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

問(wèn)題解決

轉(zhuǎn)載于:https://my.oschina.net/lionel45/blog/664017

總結(jié)

以上是生活随笔為你收集整理的解决 error: command 'swig' failed with exit status 1的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。