我正在尝试通过 virtualenv 和 pip 在WebFaction虚拟机上安装PyProj,但是遇到了编译错误。我使用的命令如下:
$ pip install pyproj
有很多输出,最终以这个结束:
src/geodesic.c: In function ‘InverseStart’:
src/geodesic.c:1093: error: ISO C90 forbids mixed declarations and code
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/home/<user>/webapps/<webapp>/env/py34/bin/python3.4 -c "import setuptools, tokenize;__file__='/tmp/pip-build-ow1vcsjk/pyproj/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-cl2pbd20-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/<user>/webapps/<webapp>/env/py34/include/site/python3.4" failed with error code 1 in /tmp/pip-build-ow1vcsjk/pyproj
我不太确定从哪里开始。根据这个SO问题,问题在于PyProj兼容C90,我可以尝试使用C99进行编译。只是猜测而已。
如前所述,这是在具有shell访问权限的远程VM上。我的开发机(Mac)上有一个匹配的Virtualenv,可以顺利编译。但是,有不同的编译器:
开发环境:
$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
VM:
$ gcc --version
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-11)
有什么想法吗?谢谢您的帮助。