Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Importing Wand in Python Ubuntu 14.04

I'm fairly new to Ubuntu, Python and have never used imported anything in Python before. My Ubuntu system has Python2.7, 3 and 3.4 installed. I'm trying to start working with Wand for an assignment. Using this documentation from Wand website I installed MagickWand and Wand using (sudo)

$ apt-get install libmagickwand-dev
$ pip install Wand

Now when I try to run the Python script, error-

Traceback (most recent call): 
File "PTI.PY", line 2, in <module>
    from wand.image import Image
ImportError: No module named wand.image

This looks a path or some other configuration error to me, how do I fix this? I looked another similar question in which there was one answer (not marked as solution though) which suggested using virtualenv butI'm not sure if I should try that method. Any help is appreciated.

Edit- Since I cant post a comment yet, I did not use sudo with "pip install Wand" and "pip3 install Wand" says "The program 'pip3' is currently not installed. You can install it by typing: sudo apt-get install python3-pip"

Edit 2- So I tried installing using pip3 and pip again, failed with the error, "could not create '/usr/local/lib/python2.7/dist-packages/wand': Permission denied" and realized that Wand was never configured.

So my question now is, how to provide correct permissions? Or should I look into the virtualenv method.

like image 817
chautob0t Avatar asked Oct 30 '25 20:10

chautob0t


2 Answers

The issue will be resolved with the below installation:

$ apt-get install libmagickwand-dev
$ pip install Wand

Also, please refer the updated version of wand: wand installation

like image 155
Vijesh Venugopal Avatar answered Nov 02 '25 08:11

Vijesh Venugopal


sudo apt-get install python-wand
like image 25
KillerKiwi Avatar answered Nov 02 '25 10:11

KillerKiwi