我试图在Bluemix中推送python Django应用程序。
我使用了一些全局依赖,以及一些具有全局依赖性的个人包。
当我在应用程序文件夹中添加个人包时,我的应用程序运行良好。
egin requirements.txt:
Mezzanine==4.1.0
cartridge
Django==1.9.7
-r ./my_personal_package/requirements.txt
in ./my_personal_package/requirements.txt:
pyOpenSSL==16.0.0
requests==2.9.1
psutil==4.3.0
但是,如果我使用pip工具将我的个人包打包为pypi包。并将其放入bluemix可以访问的个人pypi服务器中。我的申请将无法启动。它在安装cffi包时失败了(在这个问题的最后附加了错误消息)
我的requirements.txt如下:
-extra-index-url https://mypypiserver.mybluemix.net/repos/simple/
my-personal-package
Mezzanine==4.1.0
cartridge
Django==1.9.7
我将使用方法1和方法2下载的软件包进行了比较,它们完全相同。方法2仅在安装cffi时失败:
2016-09-08T20:40:32.62-0500 [STG/0] OUT Running setup.py install for cffi: started
2016-09-08T20:40:33.42-0500 [STG/0] OUT Running setup.py install for cffi: finished with status 'error'
错误讯息:
016-09-08T20:40:33.43-0500 [STG/0] OUT Complete output from command /app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-k3BUbl/cffi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-C_rmOt-record/install-record.txt --single-version-externally-managed --compile:
2016-09-08T20:40:33.43-0500 [STG/0] OUT Perhaps you should add the directory containing `libffi.pc'
2016-09-08T20:40:33.43-0500 [STG/0] OUT to the PKG_CONFIG_PATH environment variable
2016-09-08T20:40:33.43-0500 [STG/0] OUT Package libffi was not found in the pkg-config search path.
2016-09-08T20:40:33.44-0500 [STG/0] OUT Package libffi was not found in the pkg-config search path.
2016-09-08T20:40:33.44-0500 [STG/0] OUT Perhaps you should add the directory containing `libffi.pc'
2016-09-08T20:40:33.44-0500 [STG/0] OUT to the PKG_CONFIG_PATH environment variable
2016-09-08T20:40:33.44-0500 [STG/0] OUT Package libffi was not found in the pkg-config search path.
2016-09-08T20:40:33.44-0500 [STG/0] OUT to the PKG_CONFIG_PATH environment variable
2016-09-08T20:40:33.44-0500 [STG/0] OUT Package libffi was not found in the pkg-config search path.
2016-09-08T20:40:33.43-0500 [STG/0] OUT Package libffi was not found in the pkg-config search path.
2016-09-08T20:40:33.43-0500 [STG/0] OUT Perhaps you should add the directory containing `libffi.pc'
2016-09-08T20:40:33.43-0500 [STG/0] OUT to the PKG_CONFIG_PATH environment variable
2016-09-08T20:40:33.44-0500 [STG/0] OUT No package 'libffi' found
2016-09-08T20:40:33.44-0500 [STG/0] OUT Perhaps you should add the directory containing `libffi.pc'
2016-09-08T20:40:33.44-0500 [STG/0] OUT No package 'libffi' found
2016-09-08T20:40:33.44-0500 [STG/0] OUT Perhaps you should add the directory containing `libffi.pc'
2016-09-08T20:40:33.44-0500 [STG/0] OUT to the PKG_CONFIG_PATH environment variable
2016-09-08T20:40:33.44-0500 [STG/0] OUT No package 'libffi' found
2016-09-08T20:40:33.44-0500 [STG/0] OUT running install
2016-09-08T20:40:33.44-0500 [STG/0] OUT running build
2016-09-08T20:40:33.44-0500 [STG/0] OUT running build_py
2016-09-08T20:40:33.44-0500 [STG/0] OUT creating build
2016-09-08T20:40:33.44-0500 [STG/0] OUT creating build/lib.linux-x86_64-2.7
2016-09-08T20:40:33.44-0500 [STG/0] OUT creating build/lib.linux-x86_64-2.7/cffi
2016-09-08T20:40:33.44-0500 [STG/0] OUT copying cffi/cparser.py -> build/lib.linux-x86_64-2.7/cffi
2016-09-08T20:40:33.44-0500 [STG/0] OUT copying cffi/vengine_gen.py -> build/lib.linux-x86_64-2.7/cffi
2016-09-08T20:40:33.44-0500 [STG/0] OUT copying cffi/commontypes.py -> build/lib.linux-x86_64-2.7/cffi
2016-09-08T20:40:33.44-0500 [STG/0] OUT copying cffi/lock.py -> build/lib.linux-x86_64-2.7/cffi
2016-09-08T20:40:33.44-0500 [STG/0] OUT copying cffi/recompiler.py -> build/lib.linux-x86_64-2.7/cffi
2016-09-08T20:40:33.44-0500 [STG/0] OUT copying cffi/backend_ctypes.py -> build/lib.linux-x86_64-2.7/cffi
2016-09-08T20:40:33.44-0500 [STG/0] OUT copying cffi/vengine_cpy.py -> build/lib.linux-x86_64-2.7/cffi
2016-09-08T20:40:33.44-0500 [STG/0] OUT copying cffi/__init__.py -> build/lib.linux-x86_64-2.7/cffi
2016-09-08T20:40:33.44-0500 [STG/0] OUT copying cffi/setuptools_ext.py -> build/lib.linux-x86_64-2.7/cffi
2016-09-08T20:40:33.44-0500 [STG/0] OUT copying cffi/cffi_opcode.py -> build/lib.linux-x86_64-2.7/cffi
2016-09-08T20:40:33.44-0500 [STG/0] OUT copying cffi/model.py -> build/lib.linux-x86_64-2.7/cffi
2016-09-08T20:40:33.44-0500 [STG/0] OUT copying cffi/ffiplatform.py -> build/lib.linux-x86_64-2.7/cffi
2016-09-08T20:40:33.44-0500 [STG/0] OUT copying cffi/api.py -> build/lib.linux-x86_64-2.7/cffi
2016-09-08T20:40:33.44-0500 [STG/0] OUT copying cffi/verifier.py -> build/lib.linux-x86_64-2.7/cffi
2016-09-08T20:40:33.44-0500 [STG/0] OUT copying cffi/_cffi_include.h -> build/lib.linux-x86_64-2.7/cffi
2016-09-08T20:40:33.44-0500 [STG/0] OUT copying cffi/parse_c_type.h -> build/lib.linux-x86_64-2.7/cffi
2016-09-08T20:40:33.44-0500 [STG/0] OUT running build_ext
2016-09-08T20:40:33.44-0500 [STG/0] OUT building '_cffi_backend' extension
2016-09-08T20:40:33.44-0500 [STG/0] OUT creating build/temp.linux-x86_64-2.7/c
2016-09-08T20:40:33.45-0500 [STG/0] OUT gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DUSE__THREAD -I/usr/include/ffi -I/usr/include/libffi -I/app/.heroku/python/include/python2.7 -c c/_cffi_backend.c -o build/temp.linux-x86_64-2.7/c/_cffi_backend.o
2016-09-08T20:40:33.45-0500 [STG/0] OUT c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory
2016-09-08T20:40:33.45-0500 [STG/0] OUT #include <ffi.h>
2016-09-08T20:40:33.45-0500 [STG/0] OUT compilation terminated.
2016-09-08T20:40:33.45-0500 [STG/0] OUT error: command 'gcc' failed with exit status 1
2016-09-08T20:40:33.45-0500 [STG/0] OUT ----------------------------------------
2016-09-08T20:40:33.44-0500 [STG/0] OUT copying cffi/_embedding.h -> build/lib.linux-x86_64-2.7/cffi
2016-09-08T20:40:33.44-0500 [STG/0] OUT creating build/temp.linux-x86_64-2.7
2016-09-08T20:40:34.65-0500 [STG/0] ERR Command "/app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-k3BUbl/cffi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-C_rmOt-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-k3BUbl/cffi/
答案 0 :(得分:1)
cffi安装失败的原因是&#34;没有包&#39; libffi&#39;发现&#34 ;. &#39; libffi&#39;众所周知,安装和使用都很麻烦。由于您使用托管依赖包的pypi服务器,我想要检查的第一个地方是服务器是否根据cffi installation instructions正确设置。