pip에서 pywfdb 설치 실패 문제를 해결하는 방법은 무엇입니까?

pip에서 pywfdb 설치 실패 문제를 해결하는 방법은 무엇입니까?

조건: diff pywfdb에서 라이브러리/모듈 설치를 제외하지 못했습니다. 조건: 제외된 종속성 실패: / Ubuntu의 디자인 버그pip
pywfdb
upstartsystemdrunit여기Ubuntu >=14.10 이후
설정

  • /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
  • PYTHONPATH에서 공백$HOME/.bashrc

과도하게 기록된 종속성과 더티 설치가 있는 워크플로

  • Edwin Kessell의 조언:sudo apt-get install python-pyrex

    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following NEW packages will be installed:
    python-pyrex
    0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.         2 not fully installed or removed.
    Need to get 181 kB of archives.
    After this operation, 996 kB of additional disk space will be used.
    Get:1 http://archive.ubuntu.com/ubuntu xenial/main amd64 python-pyrex all 0.9.8.5-2.1ubuntu1 [181 kB]
    Fetched 181 kB in 0s (356 kB/s)      
    Selecting previously unselected package python-pyrex.
    (Reading database ... 434011 files and directories currently installed.)
    Preparing to unpack .../python-pyrex_0.9.8.5-2.1ubuntu1_all.deb ...
    Unpacking python-pyrex (0.9.8.5-2.1ubuntu1) ...
    Processing triggers for doc-base (0.10.7) ...
    Processing 1 added doc-base file...
    Registering documents with scrollkeeper...
    Processing triggers for man-db (2.7.5-1) ...
    Setting up runit (2.1.2-3ubuntu1) ...
    - -
    Setting up python-pyrex (0.9.8.5-2.1ubuntu1) ...
    - -
    
  • 지저분한 설치 작업 흐름, 설치 후 청소 없음, pip수행할 작업 확인sudo -H pip install --no-clean pywfdb

    Collecting pywfdb
      Using cached pywfdb-0.1.1.zip
    Building wheels for collected packages: pywfdb
      Running setup.py bdist_wheel for pywfdb ... error
      Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-_Tu9q1/pywfdb/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpemnpLdpip-wheel- --python-tag cp27:
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-2.7
      creating build/lib.linux-x86_64-2.7/pywfdb
      copying pywfdb/__init__.py -> build/lib.linux-x86_64-2.7/pywfdb
      copying pywfdb/ecgcodes.py -> build/lib.linux-x86_64-2.7/pywfdb
      package init file 'example/__init__.py' not found (or not a regular file)
      creating build/lib.linux-x86_64-2.7/pywfdb/example
      copying example/readinfo.py -> build/lib.linux-x86_64-2.7/pywfdb/example
      copying example/plot.py -> build/lib.linux-x86_64-2.7/pywfdb/example
      running build_ext
      building 'pywfdb._pywfdb' extension
      creating build/temp.linux-x86_64-2.7
      creating build/temp.linux-x86_64-2.7/pywfdb
      creating build/temp.linux-x86_64-2.7/wfdb-10.4.4
      creating build/temp.linux-x86_64-2.7/wfdb-10.4.4/lib
      x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I./wfdb-10.4.4/lib -I/usr/include/python2.7 -c pywfdb/_pywfdb.c -o build/temp.linux-x86_64-2.7/pywfdb/_pywfdb.o -Wno-uninitialized -Wno-unused
      pywfdb/_pywfdb.c:15:22: fatal error: ecgcodes.h: No such file or directory
      #include "ecgcodes.h"
                            ^
      compilation terminated.
      error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    
      ----------------------------------------
      Failed building wheel for pywfdb
      Running setup.py clean for pywfdb
      Failed to build pywfdb
     Installing collected packages: pywfdb
     Running setup.py install for pywfdb ... error
        Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-_Tu9q1/pywfdb/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-gdKcwF-record/install-record.txt --single-version-externally-managed --compile:
        running install
        running build
        running build_py
        creating build
        creating build/lib.linux-x86_64-2.7
        creating build/lib.linux-x86_64-2.7/pywfdb
        copying pywfdb/__init__.py -> build/lib.linux-x86_64-2.7/pywfdb
        copying pywfdb/ecgcodes.py -> build/lib.linux-x86_64-2.7/pywfdb
        package init file 'example/__init__.py' not found (or not a regular file)
        creating build/lib.linux-x86_64-2.7/pywfdb/example
        copying example/readinfo.py -> build/lib.linux-x86_64-2.7/pywfdb/example
        copying example/plot.py -> build/lib.linux-x86_64-2.7/pywfdb/example
        running build_ext
        building 'pywfdb._pywfdb' extension
        creating build/temp.linux-x86_64-2.7
        creating build/temp.linux-x86_64-2.7/pywfdb
        creating build/temp.linux-x86_64-2.7/wfdb-10.4.4
        creating build/temp.linux-x86_64-2.7/wfdb-10.4.4/lib
        x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I./wfdb-10.4.4/lib -I/usr/include/python2.7 -c pywfdb/_pywfdb.c -o build/temp.linux-x86_64-2.7/pywfdb/_pywfdb.o -Wno-uninitialized -Wno-unused
        pywfdb/_pywfdb.c:15:22: fatal error: ecgcodes.h: No such file or directory
        #include "ecgcodes.h"
                             ^
        compilation terminated.
        error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    
        ----------------------------------------
        Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-_Tu9q1/pywfdb/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-gdKcwF-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-_Tu9q1/pywfdb/
    

열려 있는

  • pywfdb 빌드 휠이 실패했습니다.?
  • 전체 로그에서 다음 오류를 재현하는 이유는 무엇입니까?

    Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-_Tu9q1/pywfdb/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-gdKcwF-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-_Tu9q1/pywfdb/
    

문제 해결

wfdbPip 로컬 모듈, Adam의 첫 번째 명령 세트가 발견한 내용이 표시되지 않습니다 .

" https://stackoverflow.com/a/23885252/54964 "
['adium-theme-ubuntu==0.3.4', 'alabaster==0.7.8', 'auxlib==0.0.37', 'babel==2.3.4', 'backports-abc==0.4', 'backports.shutil-get-terminal-size==1.0.0', 'backports.ssl-match-hostname==3.5.0.1', 'beautifulsoup4==4.4.1', 'ccsm==0.9.12.2', 'certifi==2016.2.28', 'chardet==2.3.0', 'compizconfig-python==0.9.12.2', 'configparser==3.5.0', 'cycler==0.10.0', 'decorator==4.0.9', 'docutils==0.12', 'duplicity==0.7.6', 'entrypoints==0.2.2', 'enum34==1.1.6', 'functools32==3.2.3.post2', 'futures==3.0.5', 'html5lib==0.999', 'httplib2==0.9.1', 'imagesize==0.7.1', 'ipykernel==4.3.1', 'ipyparallel==5.0.1', 'ipython-genutils==0.1.0', 'ipython==4.2.0', 'ipywidgets==5.1.5', 'jinja2==2.8', 'jsonschema==2.5.1', 'jupyter-client==4.2.2', 'jupyter-core==4.1.0', 'lockfile==0.12.2', 'lxml==3.5.0', 'markupsafe==0.23', 'matlab-kernel==0.9.6', 'matplotlib==1.5.1', 'metakernel==0.13.0', 'mistune==0.7.2', 'nbconvert==4.2.0', 'nbformat==4.0.1', 'nose==1.3.7', 'notebook==4.2.1', 'numpy==1.11.0', 'pandas==0.18.1', 'path.py==8.2.1', 'pathlib2==2.1.0', 'pdfshuffler==0.6.0', 'pexpect==4.1.0', 'pickleshare==0.7.2', 'pillow==3.1.2', 'pip==8.1.2', 'ptyprocess==0.5.1', 'pycosat==0.6.1', 'pycurl==7.43.0', 'pygments==2.1.3', 'pygobject==3.20.0', 'pyicu==1.9.2', 'pymatbridge==0.5.2', 'pymysql==0.7.2', 'pyparsing==2.1.4', 'pypdf==1.13', 'python-dateutil==2.5.3', 'python-djvulibre==0.7', 'pytz==2016.4', 'pyxdg==0.25', 'pyyaml==3.11', 'pyzmq==15.2.0', 'qtconsole==4.2.1', 'requests==2.10.0', 'scour==0.32', 'setuptools==22.0.5', 'simplegeneric==0.8.1', 'singledispatch==3.4.0.3', 'six==1.10.0', 'snowballstemmer==1.2.1', 'sphinx==1.4.3', 'subprocess32==3.2.6', 'terminado==0.6', 'testpath==0.3', 'tornado==4.3', 'traitlets==4.2.1', 'unity-lens-photos==1.0', 'wheel==0.29.0', 'widgetsnbextension==1.2.3']

패키지/모듈/라이브러리 정보에 대한 테스트 명령이 실패했습니다.

  • pip search wfdb주어졌으므로 pywfdb (0.1.1) - Python interface to WFDB library사용할 수 있는 모듈도 포함되어 있기를 바랍니다 import.
  • find /usr/local/lib/python2.7/dist-packages -name '*wfdb*'공백을 반환합니다.
  • pip list |grep wfdb공백을 반환합니다.
  • pip show pywfdb공백을 반환합니다.

테스트 코드는 모듈을 찾을 수 없다고 표시합니다.

" http://www.pybytes.com/pywfdb/ "
import pywfdb

검색 모듈을 사용해 보세요

  • /usr/lib/python<version>/site-packages설명대로 설치 되지 않아서 일반 Python 패키지처럼 설치되지 않습니다.여기/usr/local/lib/python2.7/;모든 디렉토리( 및 )를 검색했습니다 /usr/local/lib/python3.5/.

  • dist-packages기반이 아닌답변. 명령이 ls /usr/local/lib/python2.7/dist-packages/ | grep wfdb공백을 반환합니다.

  • >>> import site; site.getsitepackages()출력을 제공합니다

    ['/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages']
    

    ls /usr/local/lib/python2.7/dist-packages | grep wfdb그리고 빈 출력 ls /usr/lib/python2.7/dist-packages | grep wfdb.

시스템: Linux Ubuntu 16.04 64비트
Linux 커널: 4.6
Linux 커널 옵션: wl
하드웨어: Macbook Air 2013-mid
Python: 2.7.11+
Pip: 최신(8.1.2) 최신 pip pip install --upgrade pip반환Requirement already up-to-date: pip in /home/masi/.local/lib/python2.7/site-packages
기준 치수: Bash pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U이전에 완료됨
:4.3.46(1)-release (x86_64-pc-linux-gnu)

답변1

위의 답변을 확장하여 올바른 방향을 제시했지만 몇 가지 주요 단계를 건너뛰었습니다.

면책 조항: 저는 숙련된 Linux 사용자는 아니지만 이것은 DigitalOcean Ubuntu를 새로 설치한 경우 작동합니다.

  1. 종속성(아직 없는 경우):

    • $ sudo apt-get install python-dev python-pip python-pyrex unzip
  2. WFDB 소스 코드를 다음에서 다운로드하세요.www.physionet.org/physiotools/wfdb.tar.gz

    • 압축을 푼다~/
  3. WFDB C 라이브러리 컴파일 및 설치

    • @~/wfdb-10.5.24/wfdb$ ./configure --without-netfiles --static --static_only
    • (튜토리얼은 다음 위치에 있습니다.http://www.pybytes.com/pywfdb/--without-netfiles스위치를 사용해야 한다고 하는데 아무런 문제가 없었습니다.아니요그것을 사용하지만 phyonet 에서 Python 래퍼를 가져올 수 없으므로 사용해야 합니다)
    • @~/wfdb-10.5.24/wfdb$ sudo make install
    • @~/wfdb-10.5.24/wfdb$ make check
  4. 소스에서 pywfdb 다운로드pypi.python.org/packages/source/p/pywfdb/pywfdb-0.1.1.zip

    • 압축을 푼다~/
  5. 편집하다~/pywfdb-0.1.1/pywfdb/_pywfdb.c

    • 15, 16, 17행 \*.h으로 교체<wfdb/*.h>
  6. 편집하다~/pywfdb-0.1.1/setup.py

    • 14, 15번째 줄에서 다음 ./wfdb-10.4.4/으로 대체합니다(또는 추출할 때마다 별칭이 작동하지 않음)./home/username/wfdb-10.5.24/~/
  7. @/usr/include$ ln -s /usr/local/include/wfdb wfdb

  8. @~/pywfdb$ sudo python setup.py install

  9. (위의 답변은 여기서 끝나지만 실제로 Python으로 라이브러리를 가져오려면 이 추가 단계가 필요합니다)@/usr/lib/python2.7/dist-packages$ ln -s /usr/local/lib/python2.7/dist-packages/pywfdb pywfdb

답변2

마시,

드디어 도서관을 운영할 수 있게 됐어요. 내 단계는 다음과 같습니다.

  1. wfdb-10.5.24phyonet 웹사이트에서 다운로드
  2. 컴파일 및 설치
  3. cd /usr/include
    sudo ln -s /usr/local/include/wfdb wfdb
    
  4. sudo apt-get install python-pyrex
  5. 텍스트 편집기를 사용하여 이 파일을 열고 pywfdb/_pywfdb.c다음 줄을 다음으로 바꿉니다.

    #include <wfdb/ecgcodes.h>
    #include <wfdb/ecgmap.h>
    #include <wfdb/wfdb.h>
    
  6. 파일의 14, 15번째 줄에 디렉터리 setup.py경로를 입력하세요.wfdb-10.5.24/lib

  7. python setup.py install

리눅스: 우분투 16.04

관련 정보