1

I have installed the requests module in python 2.7 but while importing it Gives me

import-im6.q16: not authorized `requests' @ error/constitute.c/WriteImage/1037

Why is that?

Sid
  • 2,174
  • 1
  • 13
  • 29
SuRaj Das
  • 31
  • 1
  • 6

1 Answers1

5

You are getting this error because your script is not being executed by python, but most likely by bash.

The error you see is probably produced by the import executable (which is part of ImageMagick). If you try to execute, in bash:

$ import requests

You are probably going to get the same output.


To correctly execute your script, you need to use python:

$ python your_script.py

Or

  1. you can make sure the very first line of your script is exactly #!/usr/bin/env python
  2. Make your script executable:
    $ chmod +x your_script.py
    
  3. Execute it without typing python in front:
    $ ./your_script.py
    
tyrion
  • 1,984
  • 1
  • 19
  • 25