hankcs / HanLP

中文分词 词性标注 命名实体识别 依存句法分析 成分句法分析 语义依存分析 语义角色标注 指代消解 风格转换 语义相似度 新词发现 关键词短语提取 自动摘要 文本分类聚类 拼音简繁转换 自然语言处理
https://hanlp.hankcs.com/
Apache License 2.0
33.9k stars 10.15k forks source link

无法安装python版本 #1244

Closed sunc33 closed 4 years ago

sunc33 commented 5 years ago

具体操作和报错如下: Last login: Mon Jul 15 20:16:21 on ttys001 MacBook-Pro-de-Chen:~ noah$ pip install pyhanlp Collecting pyhanlp Collecting jpype1>=0.7.0 (from pyhanlp) Using cached https://files.pythonhosted.org/packages/28/63/784834e8a24ec2e1ad7f703c3dc6c6fb372a77cc68a2fdff916e18a4449e/JPype1-0.7.0.tar.gz Building wheels for collected packages: jpype1 Building wheel for jpype1 (setup.py) ... error ERROR: Complete output from command /Users/noah/anaconda3/bin/python -u -c 'import setuptools, tokenize;file='"'"'/private/var/folders/bb/yzzgnhrj70q9s996rsfz6txw0000gn/T/pip-install-ynmh4yg5/jpype1/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/bb/yzzgnhrj70q9s996rsfz6txw0000gn/T/pip-wheel-1dve7lyv --python-tag cp37: ERROR: /Users/noah/anaconda3/lib/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'use_scm_version' warnings.warn(msg) running bdist_wheel running build running build_py creating build creating build/lib.macosx-10.7-x86_64-3.7 creating build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_jcollection.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_jcomparable.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_classpath.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_jio.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_jtypes.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_pykeywords.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_jproxy.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_gui.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_darwin.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/nio.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_jstring.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_cygwin.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/init.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_jboxed.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/types.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/beans.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_jvmfinder.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/imports.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_jcustomizer.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_core.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_jinit.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_linux.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_jarray.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_jobject.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_jclass.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_windows.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_jexception.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/reflect.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_jpackage.py -> build/lib.macosx-10.7-x86_64-3.7/jpype running build_ext running build_java Using Jar cache creating build/lib creating build/lib/org creating build/lib/org/jpype creating build/lib/org/jpype/classloader copying native/jars/org/jpype/classloader/JPypeClassLoader.class -> build/lib/org/jpype/classloader copying native/jars/org.jpype.jar -> build/lib running build_thunk Building thunks including thunk build/lib/org/jpype/classloader/JPypeClassLoader.class including thunk build/lib/org.jpype.jar /private/var/folders/bb/yzzgnhrj70q9s996rsfz6txw0000gn/T/pip-install-ynmh4yg5/jpype1/setupext/build_ext.py:85: FeatureNotice: Turned ON Numpy support for fast Java array access FeatureNotice) building '_jpype' extension creating build/temp.macosx-10.7-x86_64-3.7 creating build/temp.macosx-10.7-x86_64-3.7/build creating build/temp.macosx-10.7-x86_64-3.7/build/src creating build/temp.macosx-10.7-x86_64-3.7/native creating build/temp.macosx-10.7-x86_64-3.7/native/python creating build/temp.macosx-10.7-x86_64-3.7/native/common gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Users/noah/anaconda3/include -arch x86_64 -I/Users/noah/anaconda3/include -arch x86_64 -DMACOSX=1 -DHAVE_NUMPY=1 -Inative/common/include -Inative/python/include -Ibuild/src -Inative/jni_include -I/Users/noah/anaconda3/lib/python3.7/site-packages/numpy/core/include -I/Users/noah/anaconda3/include/python3.7m -c build/src/jp_thunk.cpp -o build/temp.macosx-10.7-x86_64-3.7/build/src/jp_thunk.o -ggdb warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found] In file included from build/src/jp_thunk.cpp:1: In file included from build/src/jp_thunk.h:3: native/common/include/jpype.h:82:10: fatal error: 'map' file not found

include

       ^~~~~

1 warning and 1 error generated. error: command 'gcc' failed with exit status 1

ERROR: Failed building wheel for jpype1 Running setup.py clean for jpype1 Failed to build jpype1 Installing collected packages: jpype1, pyhanlp Running setup.py install for jpype1 ... error ERROR: Complete output from command /Users/noah/anaconda3/bin/python -u -c 'import setuptools, tokenize;file='"'"'/private/var/folders/bb/yzzgnhrj70q9s996rsfz6txw0000gn/T/pip-install-ynmh4yg5/jpype1/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/var/folders/bb/yzzgnhrj70q9s996rsfz6txw0000gn/T/pip-record-l51xr0fq/install-record.txt --single-version-externally-managed --compile: ERROR: /Users/noah/anaconda3/lib/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'use_scm_version' warnings.warn(msg) running install running build running build_py creating build/lib.macosx-10.7-x86_64-3.7 creating build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_jcollection.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_jcomparable.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_classpath.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_jio.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_jtypes.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_pykeywords.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_jproxy.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_gui.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_darwin.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/nio.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_jstring.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_cygwin.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/init.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_jboxed.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/types.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/beans.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_jvmfinder.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/imports.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_jcustomizer.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_core.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_jinit.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_linux.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_jarray.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_jobject.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_jclass.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_windows.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_jexception.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/reflect.py -> build/lib.macosx-10.7-x86_64-3.7/jpype copying jpype/_jpackage.py -> build/lib.macosx-10.7-x86_64-3.7/jpype running build_ext running build_java Using Jar cache copying native/jars/org/jpype/classloader/JPypeClassLoader.class -> build/lib/org/jpype/classloader copying native/jars/org.jpype.jar -> build/lib running build_thunk Building thunks including thunk build/lib/org/jpype/classloader/JPypeClassLoader.class including thunk build/lib/org.jpype.jar /private/var/folders/bb/yzzgnhrj70q9s996rsfz6txw0000gn/T/pip-install-ynmh4yg5/jpype1/setupext/build_ext.py:85: FeatureNotice: Turned ON Numpy support for fast Java array access FeatureNotice) building '_jpype' extension creating build/temp.macosx-10.7-x86_64-3.7 creating build/temp.macosx-10.7-x86_64-3.7/build creating build/temp.macosx-10.7-x86_64-3.7/build/src creating build/temp.macosx-10.7-x86_64-3.7/native creating build/temp.macosx-10.7-x86_64-3.7/native/python creating build/temp.macosx-10.7-x86_64-3.7/native/common gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Users/noah/anaconda3/include -arch x86_64 -I/Users/noah/anaconda3/include -arch x86_64 -DMACOSX=1 -DHAVE_NUMPY=1 -Inative/common/include -Inative/python/include -Ibuild/src -Inative/jni_include -I/Users/noah/anaconda3/lib/python3.7/site-packages/numpy/core/include -I/Users/noah/anaconda3/include/python3.7m -c build/src/jp_thunk.cpp -o build/temp.macosx-10.7-x86_64-3.7/build/src/jp_thunk.o -ggdb warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found] In file included from build/src/jp_thunk.cpp:1: In file included from build/src/jp_thunk.h:3: native/common/include/jpype.h:82:10: fatal error: 'map' file not found

include

         ^~~~~
1 warning and 1 error generated.
error: command 'gcc' failed with exit status 1
----------------------------------------

ERROR: Command "/Users/noah/anaconda3/bin/python -u -c 'import setuptools, tokenize;file='"'"'/private/var/folders/bb/yzzgnhrj70q9s996rsfz6txw0000gn/T/pip-install-ynmh4yg5/jpype1/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/var/folders/bb/yzzgnhrj70q9s996rsfz6txw0000gn/T/pip-record-l51xr0fq/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/bb/yzzgnhrj70q9s996rsfz6txw0000gn/T/pip-install-ynmh4yg5/jpype1/ MacBook-Pro-de-Chen:~ noah$

求问如何解决

yaleimeng commented 5 years ago

哥们,Python3.7太新了,非常可能Jpype不支持。换3.6版本吧,稳定,毛病少

sunc33 commented 5 years ago

求问该怎么换? = =。我是直接在terminal上操作的

yaleimeng commented 5 years ago

就是卸载当前版本,安另一个版本。不想影响系统自身的话也可以建一个特定Python版本的虚拟环境。 具体可以网上搜一下

hankcs commented 4 years ago

感谢您对HanLP1.x的支持,我一直为没有时间回复所有issue感到抱歉,希望您提的问题已经解决。或者,您可以从《自然语言处理入门》中找到答案。

时光飞逝,HanLP1.x感谢您的一路相伴。我于东部标准时间2019年12月31日发布了HanLP1.x在上一个十年最后一个版本,代号为最后的武士。此后1.x分支将提供稳定性维护,但不是未来开发的焦点。

值此2020新年之际,我很高兴地宣布,HanLP2.0发布了。HanLP2.0的愿景是下一个十年的前沿NLP技术。为此,HanLP2.0采用TensorFlow2.0实现了最前沿的深度学习模型,通过精心设计的框架支撑下游NLP任务,在海量语料库上取得了最前沿的准确率。作为第一个alpha版本,HanLP 2.0.0a0支持分词、词性标注、命名实体识别、依存句法分析、语义依存分析以及文本分类。而且,这些功能并不仅限中文,而是面向全人类语种设计。HanLP2.0提供许多预训练模型,而终端用户仅需两行代码即可部署,深度学习落地不再困难。更多详情,欢迎观看HanLP2.0的介绍视频,或参与论坛讨论

展望未来,HanLP2.0将集成1.x时代继承下来的高效率务实风范,同时冲刺前沿研究,做工业界和学术界的两栖战舰,请诸君继续多多指教,谢谢。

Mywayking commented 4 years ago

mac下安装 conda install gcc conda install -c conda-forge jpype1==0.7.0 pip install pyhanlp

wu0211 commented 2 years ago

mac下安装 conda install gcc conda install -c conda-forge jpype1==0.7.0 pip install pyhanlp

能问一下,docker 打包的时候这几个怎么安装吗