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文件,但现在是互相找不到对方。

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

# 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相关推荐

  1. 安装MySQL-python报错 error: command 'gcc' failed with exit status 1解决方法

    错误如: _mysql.c:2331: error: '_mysql_ConnectionObject' has no member named 'open' _mysql.c:2338: error ...

  2. 【Linux学习笔记】解决:error: command ‘gcc‘ failed with exit status 1

    报错: error: command 'gcc' failed with exit status 1 原因:缺少gcc,openssl-devel openssl-devel包是第三方软件开发时使用的 ...

  3. pip install nmslib 失败 (error: command ‘x86_64-linux-gnu-gcc‘ failed with exit status 1)

    1. 问题现象 使用 pip 安装 nmslib 命令时出现如下错误: sudo pip install nmslib ....ERROR: Complete output from command ...

  4. python mysql gcc_MySQL-python “error: command 'gcc' failed with exit status 1”错误

    安装MySQL-python-1.2.3c1出现"error: command 'gcc' failed with exit status 1"错误 具体报错信息如下: _mysq ...

  5. Mac os更新系统后安装scrapy报错error: command ‘xcrun‘ failed with exit status 1

    查看报错信息: In file included from src/twisted/test/raiser.c:4: In file included from /Library/Developer/ ...

  6. error: command 'gcc' failed with exit status 1

    使用 pip install scrapy 安装 scrapy 时,提示error: command 'gcc' failed with exit status 1 解决方法: yum  -y  in ...

  7. Ubuntu 16 安装 python 依赖出现 error: command 'i686-linux-gnu-gcc' failed with exit status 1

    问题 在 Ubuntu 下安装 python 依赖的时候出现以下错误 build/temp.linux-i686-3.5/_openssl.c:498:30: fatal error: openssl ...

  8. 【吭】centos安装mysql报错OSError: mysql_config not found/error: command ‘gcc‘ failed with exit status 1

    问题:    OSError: mysql_config not found 解决:yum install mysql-devel 问题:error: command 'gcc' failed wit ...

  9. 完美解决ERROR: Command errored out with exit status 1: command: ‘f:\program files\python\python36\pyt

    完美解决ERROR: Command errored out with exit status 1: command: 'f:\program files\python\python36\pyt 文章 ...

最新文章

  1. R语言 、Excel哪个更能胜任数据分析?
  2. LOJ#510. 「LibreOJ NOI Round #1」北校门外的回忆(线段树)
  3. html制作花样链接卡页面_花样链接卡.html
  4. python2.7安装scrapy_python 2.7 的Scrapy安装介绍
  5. [CareerCup] 9.6 Generate Parentheses 生成括号
  6. 【算法导论】0-1背包问题 与 部分背包
  7. 无法获得锁 /var/lib/dpkg/lock - open (11: 资源暂时不可用) ...ubuntu 18.04 安装vim遇到的错误...
  8. android 自定义控件之下拉刷新源码详解
  9. pandas读取csv文件数据并对指定字段分类使用matplotlib在一张图里画四张折线图子图
  10. 定时器Quartz和插件pageHelper使用
  11. 【斜对称矩阵】向量的斜对称矩阵表示
  12. 3DMax VRay 渲染笔记
  13. 联想小新系列笔记本 黑苹果BIOS配置
  14. 项目经理的修炼,直面需求变更
  15. jsonviewer
  16. 天水市师院计算机系好吗,天水师范学院专业排名及介绍 哪些专业最好
  17. python tcl tk_安装Python WARNING: The version of Tcl/Tk (8.5.9)
  18. KVM+WebVirtMgr部署安装笔记
  19. windows下安装masscan
  20. navicate如何画数据库关系图

热门文章

  1. 刷recovery工具apk_红米note4X刷lineage,不喜欢miui10广告臃肿的可以试一试
  2. 打开端口_打印机ip及端口设置
  3. uva 11490 ——Just Another Problem
  4. centos 使vim支持+python和+python3
  5. lamp mysql大小限制_LAMP 调优之:MySQL 服务器调优
  6. 作为唯一索引_Mysql什么情况下不走索引?
  7. 【剑指offer】_06 变态跳台阶
  8. linux c++线程池的实现
  9. C++::探索对象模型
  10. 字符串函数参数传入传出(字符串反转)