简体   繁体   中英

Installing Python modules with Anaconda or Canopy

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!

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 ).

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM