pip install error

安装SEC,DSRG三维CRF时,问题:

ubuntu@fadfd17f190d:~/user_space/SGAN$ pip3 install CRF/
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Processing ./CRF
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3.5 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-6j6vk0ud/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-6j6vk0ud/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 pip-egg-info
         cwd: /tmp/pip-req-build-6j6vk0ud/
    Complete output (20 lines):

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
    # distutils: sources = src/densecrf_wrapper.cpp
    ^
    ------------------------------------------------------------

    krahenbuhl2013/wrapper.pyx:1:0: 'krahenbuhl2013/wrapper' is not a valid module name
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-req-build-6j6vk0ud/setup.py", line 32, in <module>
        language="c++",
      File "/usr/local/lib/python3.5/dist-packages/Cython/Build/Dependencies.py",line 1097, in cythonize
        cythonize_one(*args)
      File "/usr/local/lib/python3.5/dist-packages/Cython/Build/Dependencies.py",line 1220, in cythonize_one
        raise CompileError(None, pyx_file)
    Cython.Compiler.Errors.CompileError: krahenbuhl2013/wrapper.pyx
    Compiling krahenbuhl2013/wrapper.pyx because it changed.
    [1/1] Cythonizing krahenbuhl2013/wrapper.pyx
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check thelogs for full command output.

解决:将CRF/setup.py 修改:

setup(
    name='CRF',
    version=1.0,
    packages=['krahenbuhl2013'],
    ext_modules=cythonize(Extension(
        #'krahenbuhl2013/wrapper',
        'wrapper',  //修改位置
        sources=[
            'krahenbuhl2013/wrapper.pyx',
            "src/densecrf.cpp",
            "src/labelcompatibility.cpp",
            "src/pairwise.cpp",
            "src/permutohedral.cpp",
            "src/unary.cpp",
            "src/util.cpp",
            "src/densecrf_wrapper.cpp",
        ],
        include_dirs=[
            numpy.get_include(),
            "include",
            "/usr/include/eigen3",

 

 

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值