Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在Mac10.13.4 Python3.7.0下安装失败 #172

Closed
GeekTemo opened this issue Sep 20, 2018 · 9 comments
Closed

在Mac10.13.4 Python3.7.0下安装失败 #172

GeekTemo opened this issue Sep 20, 2018 · 9 comments

Comments

@GeekTemo
Copy link

系统版本 MacOs High Sierra 10.13.4
Python版本 Python 3.7.0
安装方式 git下载安装
错误信息
patch/libs/python/src/converter/builtin_converters.cpp:51:14: error: cannot initialize return object of type 'void *' with an rvalue of type 'const char *' return PyUnicode_Check(obj) ? _PyUnicode_AsString(obj) : 0; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m/unicodeobject.h:363:18: note: expanded from macro 'PyUnicode_Check' PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_UNICODE_SUBCLASS) ^ /Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m/object.h:686:35: note: expanded from macro 'PyType_FastSubclass' #define PyType_FastSubclass(t,f) PyType_HasFeature(t,f) ^ /Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m/object.h:684:33: note: expanded from macro 'PyType_HasFeature' #define PyType_HasFeature(t,f) (((t)->tp_flags & (f)) != 0) ^ 1 error generated. error: command 'clang++' failed with exit status 1

试过之前的 #52 的方法 还是失败。

@goat98
Copy link

goat98 commented Oct 14, 2018

可以参考一下,
https://www.cnblogs.com/herosoft/p/9787164.html

@crapthings
Copy link

什么情况是因为系统版本问题吗 ?

error: $MACOSX_DEPLOYMENT_TARGET mismatch: now "10.12" but "10.13" during configure

@crapthings
Copy link

文档里说

Mac系统出现版本问题使用 MACOSX_DEPLOYMENT_TARGET=10.13 python setup.py install

试试?

@wangliangster
Copy link

文档里没说支持python3.7,还真是不支持,用python2.7/3.6装没问题. 有个奇怪的问题是python2.7装可以自动检测到 MACOSX_DEPLOYMENT_TARGET是否与OS版本匹配,setup.py里改成相应的就行(我的10.14),而python3.6/3.7会忽视setup.py里的值,无论如何都置MACOSX_DEPLOYMENT_TARGET=10.7
希望�原作者看到,尽快更新对python3.7和conda python的支持,(另直接在 ltp目录下 ./configure; make C++是没问题的)

@wangliangster
Copy link

@GeekTemo 加强制转换 (void *) 能解决
patch/libs/python/src/converter/builtin_converters.cpp 51行

image

@menghuu
Copy link

menghuu commented Mar 8, 2019

使用python3.6版本,并将setup.py中的的MACOSX_DEPLOYMENT_TARGET=10.13 具体的mac版本需要自己寻找,可以解决从源码中安装失败的现象

@wangliangster
Copy link

@menghuu 前面提过python3.6/2.7都没问题,方案是针对python3.7 conda 环境失败的解决方案。

@HAOHAOXUEXI5776
Copy link

@GeekTemo 加强制转换 (void *) 能解决
patch/libs/python/src/converter/builtin_converters.cpp 51行

image

linux系统也可以这样解决,赞👍

@HAOHAOXUEXI5776 HAOHAOXUEXI5776 mentioned this issue Jun 11, 2019
4 tasks
@Joyce-Ng
Copy link

Joyce-Ng commented Jul 3, 2019

@GeekTemo 加强制转换 (void *) 能解决
patch/libs/python/src/converter/builtin_converters.cpp 51行

image
Max OS 10.13 & python 3.7.3 用这个方法成功

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants