pkuseg-python icon indicating copy to clipboard operation
pkuseg-python copied to clipboard

python3.8安装报错

Open Aohanseven opened this issue 4 years ago • 5 comments

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.

Aohanseven avatar May 11 '20 09:05 Aohanseven

I meet the same problem, my python version is 3.8.1.

nishizhumagu avatar Jun 16 '20 01:06 nishizhumagu

This also happened on a machine running macOS 10.15.7 and Python 3.8.3

entalent avatar Oct 20 '20 03:10 entalent

meet the same problem

yiming-lzx avatar Jan 08 '21 05:01 yiming-lzx

meet the same problem, running on macOS 11.1 and Python 3.9.5

umuoy1 avatar Jun 23 '21 07:06 umuoy1

可以尝试使用 GitHub 上最新版安装:

  1. pip install https://github.com/lancopku/pkuseg-python/archive/master.zip
  2. release 处下载你想要的模型,比如 default_v2
  3. 下载下来后解压放到某目录下;
  4. 代码中这样使用:
import pkuseg
seg = pkuseg.pkuseg('某目录/default_v2')
print(seg.cut('我爱北京天安门'))

我用此方法成功了。

secsilm avatar Jul 14 '22 10:07 secsilm