Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install ImageHash on Ubuntu 14.0.4?

I would like to install ImageHash and I did :

pip install pillow==2.6.1 imagehash==0.3

but I get :

ImportError: No module named numpy.distutils.core

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/scipy/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-ZDGKpH-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/scipy
Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
    load_entry_point('pip==1.5.4', 'console_scripts', 'pip')()
  File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 235, in main
    return command.main(cmd_args)
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 161, in main
    text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 72: ordinal not in range(128)

How should I install it?

like image 853
Alex Avatar asked Nov 15 '25 19:11

Alex


2 Answers

The requirements are Pillow, numpy and scipy. so we should follow:

for numpy/scipy:

sudo apt-get install libblas-dev liblapack-dev libatlas-base-dev gfortran
sudo pip install scipy

then:

sudo pip install Pillow
sudo pip install imagehash
like image 84
Alex Avatar answered Nov 18 '25 07:11

Alex


If you have installed python using conda, try this:

 conda install -c scitools imagehash
like image 21
404error Avatar answered Nov 18 '25 08:11

404error