DIAGNijmegen / rse-panimg

Conversion of medical images to MHA and TIFF.
Apache License 2.0
13 stars 5 forks source link

install openslide on ubuntu 18.04 #37

Closed hihunjin closed 3 years ago

hihunjin commented 3 years ago

Hi.

I want to install your package with this usage :

pip install panimg

This gets me an error while installing openslide-python.

Is there a way to overcome this?

Error :

root@08fb6f42b3c8:/workspace# pip install openslide-python
Collecting openslide-python
  Using cached openslide-python-1.1.2.tar.gz (316 kB)
Requirement already satisfied: Pillow in /opt/conda/lib/python3.8/site-packages (from openslide-python) (8.1.0)
Building wheels for collected packages: openslide-python
  Building wheel for openslide-python (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /opt/conda/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-_51k9nyq/openslide-python/setup.py'"'"'; __file__='"'"'/tmp/pip-install-_51k9nyq/openslide-python/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/pip-wheel-9sos8urx
       cwd: /tmp/pip-install-_51k9nyq/openslide-python/
  Complete output (17 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.8
  creating build/lib.linux-x86_64-3.8/openslide
  copying openslide/__init__.py -> build/lib.linux-x86_64-3.8/openslide
  copying openslide/_version.py -> build/lib.linux-x86_64-3.8/openslide
  copying openslide/deepzoom.py -> build/lib.linux-x86_64-3.8/openslide
  copying openslide/lowlevel.py -> build/lib.linux-x86_64-3.8/openslide
  running build_ext
  building 'openslide._convert' extension
  creating build/temp.linux-x86_64-3.8
  creating build/temp.linux-x86_64-3.8/openslide
  gcc -pthread -B /opt/conda/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/opt/conda/include/python3.8 -c openslide/_convert.c -o build/temp.linux-x86_64-3.8/openslide/_convert.o
  unable to execute 'gcc': No such file or directory
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for openslide-python
  Running setup.py clean for openslide-python
Failed to build openslide-python
Installing collected packages: openslide-python
    Running setup.py install for openslide-python ... error
    ERROR: Command errored out with exit status 1:
     command: /opt/conda/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-_51k9nyq/openslide-python/setup.py'"'"'; __file__='"'"'/tmp/pip-install-_51k9nyq/openslide-python/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-record-zl_tqq6l/install-record.txt --single-version-externally-managed --compile --install-headers /opt/conda/include/python3.8/openslide-python
         cwd: /tmp/pip-install-_51k9nyq/openslide-python/
    Complete output (17 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.8
    creating build/lib.linux-x86_64-3.8/openslide
    copying openslide/__init__.py -> build/lib.linux-x86_64-3.8/openslide
    copying openslide/_version.py -> build/lib.linux-x86_64-3.8/openslide
    copying openslide/deepzoom.py -> build/lib.linux-x86_64-3.8/openslide
    copying openslide/lowlevel.py -> build/lib.linux-x86_64-3.8/openslide
    running build_ext
    building 'openslide._convert' extension
    creating build/temp.linux-x86_64-3.8
    creating build/temp.linux-x86_64-3.8/openslide
    gcc -pthread -B /opt/conda/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/opt/conda/include/python3.8 -c openslide/_convert.c -o build/temp.linux-x86_64-3.8/openslide/_convert.o
    unable to execute 'gcc': No such file or directory
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /opt/conda/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-_51k9nyq/openslide-python/setup.py'"'"'; __file__='"'"'/tmp/pip-install-_51k9nyq/openslide-python/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-record-zl_tqq6l/install-record.txt --single-version-externally-managed --compile --install-headers /opt/conda/include/python3.8/openslide-python Check the logs for full command output.
jmsmkn commented 3 years ago

Please see the openslide-python documentation. This links to how to install openslide.

In CI we install it with apt-get install libopenslide-dev which is documented in our readme.