3

I have developed some software using Python under Windows 7.

I have given it to a colleague to run on a Mac (OS X 10.9.2). I have never used a Mac and am having trouble helping them to get started. I have downloaded and installed Anaconda 1.9.2 on the Mac. According to the continuum documentation, libtiff is included, but when I run my python file using the Spyder IDE I get the following error when it tries to import libtiff:

ImportError: No module named libtiff.

Following one of the answers on Stack Ooverflow, I tried:

conda install libtiff

This runs and returns:

All requested packages already installed.

However on Windows 7 I can see a libtiff folder under \python27\lib\site-packages. On the Mac there is no libtiff folder under /lib/python2.7/site-packages.

Can anyone tell me what I am missing?

Giacomo1968
  • 25,759
  • 11
  • 71
  • 103
user3674400
  • 31
  • 1
  • 2
  • It looks like there's an issue with libtiff 4.0.10, I'm trying to install 4.0.9 but it's been at it for a while now and still hasn't been able to resolve. See more here: https://github.com/ContinuumIO/anaconda-issues/issues/10553 – Amir Bernat Dec 31 '19 at 08:02

2 Answers2

1

This question is answered here:

Installing Python modules with Anaconda or Canopy

If pip install libtiff does not work, you can download the source for PyLibTiff as directed at https://code.google.com/p/pylibtiff/source/checkout and run setup.py with whichever interpreter you would like for PyLibTiff to be installed to.

Also, you do not have to have the the C libraries that Anaconda installs installed for PyLibTiff to work if you have libtiff libraries installed elsewhere.

Community
  • 1
  • 1
forty_two
  • 454
  • 3
  • 11
0

Unclear on this. But what you can do to begin with is to type echo $PATH from the terminal and see what paths are set. Unclear on how Anaconda interacts with the system, but a good hunch is that if the library file is not in a path then that would cause this.

Also, looking at this thread on Google Groups it seems that Anaconda installs it’s own libraries that might need to be symbolically linked into the main /usr/local/lib directory. The user Denis Engemann—who made the post—posts this bash script in the last response in the thread:

for lib in ~/anaconda/lib/*;
do
  ln -s $lib /usr/local/lib/$(basename $lib);
done

I would recommend checking those two directories first before linking to make sure all is as expected.

Giacomo1968
  • 25,759
  • 11
  • 71
  • 103
  • Thank you for your answer. I have checked $PATH and added the ~/anaconda/lib to it. However the problem seems to be that the libtiff python wrapper is missing from the installation. If I try the import after copying libtiff.py from Windows 7 into my working directory, then the import gets a bit further, but the libtiff library cannot be found so I may need to do what you suggest once I have found the libtiff python wrapper. First I would like to establish what is wrong with the anaconda installation. I am reluctant to do too much to my colleague's machine because I know so little about MACs. – user3674400 May 26 '14 at 16:06
  • @user3674400 Well, I helped as much as I could. But while you say you are reluctant to do much, it seems like the symbolic linking is the solution. If you found this answer to be helpful, please be sure to up vote it. – Giacomo1968 May 26 '14 at 16:11