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

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

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

發布時間:2023/11/29 编程问答 41 豆豆
生活随笔 收集整理的這篇文章主要介紹了 解决 error: command 'swig' failed with exit status 1 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

2019獨角獸企業重金招聘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文件,但現在是互相找不到對方。

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

# ls /usr/include/openssl/

opensslconf-x86_64.h ?opensslconf.h

文件都是存在的。看一下哪個文件報的錯,/usr/include/openssl/opensslconf.h:36,第36行報錯,打開這個文件

#include "opensslconf-sparc.h"

#elif defined(__x86_64__)

#include "opensslconf-x86_64.h"??? #原來是這樣寫的,說明默認去找x86_64位的頭文件

#else

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

#endif

?

#undef openssl_opensslconf_multilib_redirection_h

默認去找x86_64位的頭文件報了錯,那就說明希望去找x86的文件了,修改方法如下

#include "opensslconf-sparc.h"

#elif defined(__x86_64__)

#include "opensslconf-x86_64.h"

#else

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

#endif

?

#undef openssl_opensslconf_multilib_redirection_h

再次執行pip install docker-registry

……

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

問題解決

轉載于:https://my.oschina.net/lionel45/blog/664017

總結

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

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。