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

编译安装报错 recipe for target 'CMakeFiles/pyltp.dir/rule' failed #232

Closed
MrRace opened this issue Oct 16, 2020 · 3 comments
Closed

Comments

@MrRace
Copy link

MrRace commented Oct 16, 2020

问题类型

从源码安装失败

出错场景

安装步骤:

 $ git clone https://github.com/HIT-SCIR/pyltp
 $ git submodule init
 $ git submodule update
 $ python setup.py install

失败:

CMakeFiles/Makefile2:91: recipe for target 'CMakeFiles/pyltp.dir/rule' failed
make[1]: *** [CMakeFiles/pyltp.dir/rule] Error 2
Makefile:164: recipe for target 'pyltp' failed
make: *** [pyltp] Error 2
Traceback (most recent call last):
  File "setup.py", line 97, in <module>
    cmdclass=dict(build_ext=CMakeBuild)
  File "/usr/local/lib/python3.6/dist-packages/setuptools/__init__.py", line 165, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python3.6/dist-packages/setuptools/command/install.py", line 67, in run
    self.do_egg_install()
  File "/usr/local/lib/python3.6/dist-packages/setuptools/command/install.py", line 109, in do_egg_install
    self.run_command('bdist_egg')
  File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python3.6/dist-packages/setuptools/command/bdist_egg.py", line 174, in run
    cmd = self.call_command('install_lib', warn_dir=0)
  File "/usr/local/lib/python3.6/dist-packages/setuptools/command/bdist_egg.py", line 160, in call_command
    self.run_command(cmdname)
  File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python3.6/dist-packages/setuptools/command/install_lib.py", line 11, in run
    self.build()
  File "/usr/lib/python3.6/distutils/command/install_lib.py", line 109, in build
    self.run_command('build_ext')
  File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "setup.py", line 33, in run
    self.build_extension(ext)
  File "setup.py", line 62, in build_extension
    subprocess.check_call(['cmake', '--build', '.'] + build_args + target_args, cwd=self.build_temp)
  File "/usr/lib/python3.6/subprocess.py", line 311, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j2', 'pyltp']' returned non-zero exit status 2.

运行环境

python 3.6
debian buster

@lixuanhng
Copy link

请问解决了吗?我也遇到了这个问题。。。我看有人说还需要安装Visual Studio C++,没有更多信息了

@Sniper-LZX
Copy link

请问解决了吗?这个问题困扰我好长时间了

@AlongWY
Copy link

AlongWY commented Jul 24, 2022

已经解决了该问题,大部分版本已经上传至 pypi

@AlongWY AlongWY closed this as completed Jul 24, 2022
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

4 participants