Installing Python modules with Anaconda or Canopy

家住魔仙堡 提交于 2020-01-04 14:06:33

问题


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!


回答1:


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




回答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.



来源:https://stackoverflow.com/questions/28175349/installing-python-modules-with-anaconda-or-canopy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!