pkuseg-python
pkuseg-python copied to clipboard
python3.8安装报错
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-et09_yi1/pkuseg/setup.py'"'"'; __file__='"'"'/tmp/pip-install-et09_yi1/pkuseg/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-et09_yi1/pkuseg/pip-egg-info
cwd: /tmp/pip-install-et09_yi1/pkuseg/
Complete output (13 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-et09_yi1/pkuseg/setup.py", line 53, in <module>
setup_package()
File "/tmp/pip-install-et09_yi1/pkuseg/setup.py", line 47, in setup_package
ext_modules=cythonize(extensions, annotate=True),
File "/usr/local/lib/python3.8/dist-packages/Cython/Build/Dependencies.py", line 965, in cythonize
module_list, module_metadata = create_extension_list(
File "/usr/local/lib/python3.8/dist-packages/Cython/Build/Dependencies.py", line 815, in create_extension_list
for file in nonempty(sorted(extended_iglob(filepattern)), "'%s' doesn't match any files" % filepattern):
File "/usr/local/lib/python3.8/dist-packages/Cython/Build/Dependencies.py", line 114, in nonempty
raise ValueError(error_msg)
ValueError: 'pkuseg/inference.pyx' doesn't match any files
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I meet the same problem, my python version is 3.8.1.
This also happened on a machine running macOS 10.15.7 and Python 3.8.3
meet the same problem
meet the same problem, running on macOS 11.1 and Python 3.9.5
可以尝试使用 GitHub 上最新版安装:
-
pip install https://github.com/lancopku/pkuseg-python/archive/master.zip
; - 在 release 处下载你想要的模型,比如 default_v2;
- 下载下来后解压放到某目录下;
- 代码中这样使用:
import pkuseg
seg = pkuseg.pkuseg('某目录/default_v2')
print(seg.cut('我爱北京天安门'))
我用此方法成功了。