3

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.

Community
  • 1
  • 1
chautob0t
  • 117
  • 1
  • 3
  • 13
  • module didn't install correctly ... for install a package using pip don't use `sudo`. also you can test `pip3 install Wand` – Arash Hatami Jan 15 '16 at 11:22

3 Answers3

4

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

Vijesh Venugopal
  • 1,621
  • 15
  • 26
2
sudo apt-get install python-wand
Abdul Fatir
  • 6,159
  • 5
  • 31
  • 58
KillerKiwi
  • 343
  • 1
  • 4
  • 8
1

So I figured it out myself, basically the error- "could not create '/usr/local/lib/python2.7/dist-packages/wand': Permission denied" was the problem here. I simply reinstalled Wand by using

sudo pip install Wand
chautob0t
  • 117
  • 1
  • 3
  • 13