报错:Command "python setup.py egg_info

系统 1593 0

安装pydensecrf时报错:

            
              (venv) dorothy@dorothy-MS-7A94:~/project/venv/bin$ pip install pydensecrf
Collecting pydensecrf
  Using cached https://files.pythonhosted.org/packages/31/5a/1c2ab48e8019d282c128bc5c621332267bb954d32eecdda3ba57306b1551/pydensecrf-1.0rc3.tar.gz
Building wheels for collected packages: pydensecrf
  Running setup.py bdist_wheel for pydensecrf ... error
  Complete output from command /home/dorothy/project2/venv/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-6jjoctul/pydensecrf/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 /tmp/tmph56xsy38pip-wheel- --python-tag cp35:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.5
  creating build/lib.linux-x86_64-3.5/pydensecrf
  copying pydensecrf/__init__.py -> build/lib.linux-x86_64-3.5/pydensecrf
  copying pydensecrf/utils.py -> build/lib.linux-x86_64-3.5/pydensecrf
  running build_ext
  building 'pydensecrf.eigen' extension
  creating build/temp.linux-x86_64-3.5
  creating build/temp.linux-x86_64-3.5/pydensecrf
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Ipydensecrf/densecrf/include -I/home/dorothy/project2/venv/include -I/usr/include/python3.5m -c pydensecrf/eigen.cpp -o build/temp.linux-x86_64-3.5/pydensecrf/eigen.o
  cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
  pydensecrf/eigen.cpp:23:20: fatal error: Python.h: 没有那个文件或目录
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  
  ----------------------------------------
  Failed building wheel for pydensecrf
  Running setup.py clean for pydensecrf
Failed to build pydensecrf
Installing collected packages: pydensecrf
  Running setup.py install for pydensecrf ... error
    Complete output from command /home/dorothy/project2/venv/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-6jjoctul/pydensecrf/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-hgybpc8s-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/dorothy/project2/venv/include/site/python3.5/pydensecrf:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.5
    creating build/lib.linux-x86_64-3.5/pydensecrf
    copying pydensecrf/__init__.py -> build/lib.linux-x86_64-3.5/pydensecrf
    copying pydensecrf/utils.py -> build/lib.linux-x86_64-3.5/pydensecrf
    running build_ext
    building 'pydensecrf.eigen' extension
    creating build/temp.linux-x86_64-3.5
    creating build/temp.linux-x86_64-3.5/pydensecrf
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Ipydensecrf/densecrf/include -I/home/dorothy/project2/venv/include -I/usr/include/python3.5m -c pydensecrf/eigen.cpp -o build/temp.linux-x86_64-3.5/pydensecrf/eigen.o
    cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
    pydensecrf/eigen.cpp:23:20: fatal error: Python.h: 没有那个文件或目录
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    
    ----------------------------------------
Command "/home/dorothy/project2/venv/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-6jjoctul/pydensecrf/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-hgybpc8s-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/dorothy/project2/venv/include/site/python3.5/pydensecrf" failed with error code 1 in /tmp/pip-build-6jjoctul/pydensecrf/
You are using pip version 9.0.1, however version 19.2.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
            
          

解决方法:

            
              pip install pydensecrf
            
          

之前加上sudo,即:

            
              (venv) dorothy@dorothy-MS-7A94:~/project/venv/bin$ sudo pip install pydensecrf
sudo: /etc/sudoers.d 可被任何人写
The directory '/home/dorothy/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/dorothy/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting pydensecrf
  Downloading https://files.pythonhosted.org/packages/31/5a/1c2ab48e8019d282c128bc5c621332267bb954d32eecdda3ba57306b1551/pydensecrf-1.0rc3.tar.gz (1.0MB)
    100% |████████████████████████████████| 1.0MB 173kB/s 
Installing collected packages: pydensecrf
  Running setup.py install for pydensecrf ... done
Successfully installed pydensecrf-1.0rc3
You are using pip version 8.1.1, however version 19.2.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

            
          

 


更多文章、技术交流、商务合作、联系博主

微信扫码或搜索:z360901061

微信扫一扫加我为好友

QQ号联系: 360901061

您的支持是博主写作最大的动力,如果您喜欢我的文章,感觉我的文章对您有帮助,请用微信扫描下面二维码支持博主2元、5元、10元、20元等您想捐的金额吧,狠狠点击下面给点支持吧,站长非常感激您!手机微信长按不能支付解决办法:请将微信支付二维码保存到相册,切换到微信,然后点击微信右上角扫一扫功能,选择支付二维码完成支付。

【本文对您有帮助就好】

您的支持是博主写作最大的动力,如果您喜欢我的文章,感觉我的文章对您有帮助,请用微信扫描上面二维码支持博主2元、5元、10元、自定义金额等您想捐的金额吧,站长会非常 感谢您的哦!!!

发表我的评论
最新评论 总共0条评论