Installing Python modules with Anaconda or Canopy

2019-07-22 01:51发布

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!

2条回答
Rolldiameter
2楼-- · 2019-07-22 02:08

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

查看更多
Viruses.
3楼-- · 2019-07-22 02:08

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.

查看更多
登录 后发表回答