Модуль libtiff не найден в 64-битном Ubuntu 14.04 python 3.5.1 (или 3.4)

Моя проблема в значительной степени идентична здесь, за исключением того, что ни одно из решений там не работает для меня. Я предполагаю, что проблема была для Python 2.7, потому что моя проблема специфична для Python 3.5.1

TL; DR: все следующие команды не работают, подробности ниже

  • sudo apt-get установить libtiff5
  • sudo dpkg -i libtiff5_4.0.3-7ubuntu0.3_amd64.deb
  • python setup.py install ( pylibtiff, оболочка для libtiff)
  • Конда установить libtiff
  • pip install libtiff

Что я пробовал:

Метод Карела

cornelis@Bob:~$ sudo apt-get install libtiff5
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libtiff5 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 342 not upgraded.
cornelis@Bob:~$ python
Python 3.5.1 |Anaconda 2.4.1 (64-bit)| (default, Dec  7 2015, 11:16:01) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from libtiff import TIFF
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'libtiff'

Метод ShubhamGG (модифицированный для libtiff5)

cornelis@Bob:~/Downloads$ sudo dpkg -i libtiff5_4.0.3-7ubuntu0.3_amd64.deb
(Reading database ... 228352 files and directories currently installed.)
Preparing to unpack libtiff5_4.0.3-7ubuntu0.3_amd64.deb ...
Unpacking libtiff5:amd64 (4.0.3-7ubuntu0.3) over (4.0.3-7ubuntu0.3) ...
Setting up libtiff5:amd64 (4.0.3-7ubuntu0.3) ...
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...
cornelis@Bob:~/Downloads$ python
Python 3.5.1 |Anaconda 2.4.1 (64-bit)| (default, Dec  7 2015, 11:16:01) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from libtiff import TIFF
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/cornelis/Downloads/libtiff/__init__.py", line 20, in <module>
    from .libtiff_ctypes import libtiff, TIFF, TIFF3D
  File "/home/cornelis/Downloads/libtiff/libtiff_ctypes.py", line 31
    print 'You should add %r to PATH environment variable and reboot.' % (os.path.dirname (lib))
                                                                     ^
SyntaxError: invalid syntax
>>> 

Я не уверен, что %r to PATH environment variable средства. Однако я перезагрузился. Нет эффекта.

Затем я попробовал pylibtiff:

cornelis@Bob:~/Downloads/pylibtiff-svn$ python setup.py install
Appending libtiff.bitarray configuration to libtiff
Ignoring attempt to set 'name' (from 'libtiff' to 'libtiff.bitarray')
Appending libtiff configuration to 
Ignoring attempt to set 'name' (from '' to 'libtiff')
Warning: Assuming default configuration (libtiff/bitarray-0.3.5-numpy/bitarray/{setup_bitarray,setup}.py was not found)Traceback (most recent call last):
  File "setup.py", line 96, in <module>
    configuration = configuration,
  File "/home/cornelis/anaconda3/lib/python3.5/site-packages/numpy/distutils/core.py", line 135, in setup
    config = configuration()
  File "setup.py", line 67, in configuration
    config.get_version('libtiff/version.py')
  File "/home/cornelis/anaconda3/lib/python3.5/site-packages/numpy/distutils/misc_util.py", line 1918, in get_version
    version_module = imp.load_module('_'.join(n.split('.')),*info)
  File "/home/cornelis/anaconda3/lib/python3.5/imp.py", line 234, in load_module
    return load_source(name, filename, file)
  File "/home/cornelis/anaconda3/lib/python3.5/imp.py", line 172, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 693, in _load
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 658, in exec_module
  File "<frozen importlib._bootstrap_external>", line 764, in get_code
  File "<frozen importlib._bootstrap_external>", line 724, in source_to_code
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "libtiff/version.py", line 30
    print version
                ^
SyntaxError: Missing parentheses in call to 'print'

Конда попытка

cornelis@Bob:~/Downloads$ conda install libtiff
Fetching package metadata: ....
Solving package specifications: ....................
# All requested packages already installed.
# packages in environment at /home/cornelis/anaconda3:
#
libtiff                   4.0.6                         1  
cornelis@Bob:~/Downloads$ python
Python 3.5.1 |Anaconda 2.4.1 (64-bit)| (default, Dec  7 2015, 11:16:01) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from libtiff import TIFF
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/cornelis/Downloads/libtiff/__init__.py", line 20, in <module>
    from .libtiff_ctypes import libtiff, TIFF, TIFF3D
  File "/home/cornelis/Downloads/libtiff/libtiff_ctypes.py", line 31
    print 'You should add %r to PATH environment variable and reboot.' % (os.path.dirname (lib))
                                                                     ^
SyntaxError: invalid syntax
>>> 

Попытка Пипа

cornelis@Bob:~/Downloads$ pip install libtiff
Collecting libtiff
  Using cached libtiff-0.4.0.tar.gz
    Complete output from command python setup.py egg_info:
    Warning: Assuming default configuration (libtiff/bitarray-0.3.5-numpy/bitarray/{setup_bitarray,setup}.py was not found)Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-90idcgcx/libtiff/setup.py", line 96, in <module>
        configuration = configuration,
      File "/home/cornelis/anaconda3/lib/python3.5/site-packages/numpy/distutils/core.py", line 135, in setup
        config = configuration()
      File "/tmp/pip-build-90idcgcx/libtiff/setup.py", line 67, in configuration
        config.get_version('libtiff/version.py')
      File "/home/cornelis/anaconda3/lib/python3.5/site-packages/numpy/distutils/misc_util.py", line 1918, in get_version
        version_module = imp.load_module('_'.join(n.split('.')),*info)
      File "/home/cornelis/anaconda3/lib/python3.5/imp.py", line 234, in load_module
        return load_source(name, filename, file)
      File "/home/cornelis/anaconda3/lib/python3.5/imp.py", line 172, in load_source
        module = _load(spec)
      File "<frozen importlib._bootstrap>", line 693, in _load
      File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 658, in exec_module
      File "<frozen importlib._bootstrap_external>", line 764, in get_code
      File "<frozen importlib._bootstrap_external>", line 724, in source_to_code
      File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
      File "libtiff/version.py", line 30
        print version
                    ^
    SyntaxError: Missing parentheses in call to 'print'
    Appending libtiff.bitarray configuration to libtiff
    Ignoring attempt to set 'name' (from 'libtiff' to 'libtiff.bitarray')
    Appending libtiff configuration to
    Ignoring attempt to set 'name' (from '' to 'libtiff')

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-90idcgcx/libtiff

0 ответов

Другие вопросы по тегам