【问题标题】:pyproj fails to compile when i pip install it. And it's not about gcc当我 pip 安装它时,pyproj 无法编译。这与 gcc 无关
【发布时间】:2018-08-22 09:22:18
【问题描述】:

它会抛出错误,使代码看起来确实有问题,例如:

 _proj.c:7486:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
     tstate->exc_type = local_type;
             ^~~~~~~~
             curexc_type
_proj.c:7487:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
     tstate->exc_value = local_value;
             ^~~~~~~~~
             curexc_value
_proj.c:7488:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
     tstate->exc_traceback = local_tb;

是pyproj版本1.9.5.1

【问题讨论】:

    标签: python pyproj


    【解决方案1】:

    这些文件由 Cython 生成。尝试将 Cython 升级到支持 Python 的版本并重新生成文件。 (对于 Python 3.7,Cython >= 0.27.3)

    编辑:

    This thread 建议通过指向 pyproj 的 git repo 来安装 pyproj。

    pipenv install cython
    pipenv install git+https://github.com/jswhit/pyproj.git#egg=pyproj
    

    通过从 Git 安装,Cython 将重新编译必要的 c 文件。

    【讨论】:

    • 您好,谢谢,仍然出现错误。不过这次只有一个:src/projects.h:113:25: error: ‘M_2_PI’ undeclared (first use in this function);你的意思是“M_PI”吗? #define M_TWO_D_PI M_2_PI /* 2/pi */
    猜你喜欢
    • 2015-04-26
    • 2020-02-12
    • 1970-01-01
    • 1970-01-01
    • 2015-06-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多