python - 当我 pip 安装它时,pyproj 无法编译。这与 gcc 无关
问题描述
它会引发错误,使代码看起来确实有问题,例如:
_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
解决方案
这些文件由 Cython 生成。尝试将 Cython 升级到支持 Python 的版本并重新生成文件。(对于 Python 3.7,Cython >= 0.27.3)
编辑:
该线程建议通过指向 pyproj 的 git repo 来安装 pyproj。
pipenv install cython
pipenv install git+https://github.com/jswhit/pyproj.git#egg=pyproj
通过从 Git 安装,Cython 将重新编译必要的 c 文件。
推荐阅读
- typescript - Typescript 构造函数泛型参数推断
- php - Laravel 迁移一对一关系错误
- arguments - Solidity Remix:传递多个 bytes32 类型参数
- login - 在 Asp Classic 中确定多个登录?
- c++ - 将代码移出类定义时未展开参数包
- python - 来自 Google Developers 视频的 Tensorboard 中的图形创建问题
- rest - TFS Rest API - 放弃拉取请求
- python - Flask - Gevent - Pushbullet - Twilio - 此操作将永远阻塞
- wordpress - Wordpress 排除类别
- .net - 如何从接口动态创建模拟对象?