2

I have played around with Python a little but never have I had to install my own packages. I am currently trying to write a program that reads in 'tiff' files so I'm trying to install the 'libtiff' package and I'm having a nightmare!

First, I was using the Anaconda distribution and the phrase 'conda install libtiff' which would tell me the install was successful. However then I was never able to find libtiff in the Spyder IDE or ipython console.

Having used Canopy in the past, I uninstalled Anaconda and gave Canopy another shot using 'pip install libtiff', however I receive an error saying it failed with error code 1 and I don't know what this is.

I must be missing something fairly crucial but installing this module is proving almost impossible!

spmngr
  • 21
  • 1
  • 2
  • `However then I was never able to find libtiff in the Spyder IDE or ipython` ... well that is because you forgot to set your `PATH` variable properly. It's not a problem with anaconda. – cel Jan 27 '15 at 16:58
  • Were you using the spyder that comes with Anaconda? – asmeurer Jan 28 '15 at 17:04
  • I was using Spyder that came with Anaconda. I used the Anaconda command prompt to load python and ipython, and both of those were unable to find libtiff – spmngr Jan 29 '15 at 17:38

2 Answers2

2

Conda's libtiff package is the C library, not the Python library. The easiest way to get it would be to use conda to install the dependencies (like libtiff, numpy), and then use pip to install libtiff (pip install libtiff).

asmeurer
  • 86,894
  • 26
  • 169
  • 240
  • 1
    I had tried that, however libtiff wouldn't install using PIP! I've abandoned libtiff altogether now as I've found I can do what I want with matplotlib – spmngr Jan 29 '15 at 17:37
2

Using ! on the IPython console within spyder allows you to use pip. So, in the example, you could do:

In [1]: !pip install libtiff

Note, this is also available (though perhaps unreliably) on the Python console for Spyder versions before ~2.3.3.

Lee
  • 29,398
  • 28
  • 117
  • 170