今天本地安装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
根据提示安装成功了。