侧边栏壁纸
博主头像
落叶人生博主等级

走进秋风,寻找秋天的落叶

  • 累计撰写 130562 篇文章
  • 累计创建 28 个标签
  • 累计收到 9 条评论
标签搜索

目 录CONTENT

文章目录

python 本地安装docker仓库

2023-11-21 星期二 / 0 评论 / 0 点赞 / 68 阅读 / 2575 字

今天本地安装docker仓库时报错,记录一下。 # pip install docker-registry swigging SWIG/_m2crypto.i to SWIG/_m2crypto

今天本地安装docker仓库时报错,记录一下。

# pip install docker-registry
 

    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
    
    ----------------------------------------
  Rolling back uninstall of M2Crypto
Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-ohrQyj/M2Crypto/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('/r/n', '/n'), __file__, 'exec'))" install --record /tmp/pip-BAFZHY-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-ohrQyj/M2Crypto

根据报错看是问题是出在了opensslconf.h这个文件的36行,所以特意打开看看

vim /usr/include/openssl/opensslconf.h

第36行:

可见到问题的原因是opensslconf-x86_64.h这个文件加载失败,查看/usr/include/openssl目录下opensslconf-x86_64.h文件和opensslconf.h文件

既然64位加载不了那就试试opensslconf.h,将opensslconf.h里面36行注释,在上面一行添加加载自己的语句

保存,尝试安装

# pip install docker-registry

Installing collected packages: M2Crypto, sqlalchemy, docker-registry
  Found existing installation: M2Crypto 0.21.1
    Uninstalling M2Crypto-0.21.1:
      Successfully uninstalled M2Crypto-0.21.1
  Running setup.py install for M2Crypto
  Running setup.py install for sqlalchemy
  Running setup.py install for docker-registry
Successfully installed M2Crypto-0.22.3 docker-registry-0.9.1 sqlalchemy-0.9.4
 

根据提示安装成功了。

 


 

广告 广告

评论区