1

when I start python interpreter as root, I can import Image:

Python 2.7.13 (default, Sep 26 2018, 18:42:22) 
>>> import Image

however, when I do the same as user (www-data), I get MemoryError:

Python 2.7.13 (default, Sep 26 2018, 18:42:22) 
>>> import Image
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/PILcompat/Image.py", line 1, in <module>
    from PIL.Image import *
  File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 57, in <module>
    __import__("FixTk")
  File "/usr/lib/python2.7/lib-tk/FixTk.py", line 15, in <module>
    import ctypes
  File "/usr/lib/python2.7/ctypes/__init__.py", line 552, in <module>
    _reset_cache()
  File "/usr/lib/python2.7/ctypes/__init__.py", line 276, in _reset_cache
    CFUNCTYPE(c_int)(lambda: None)
MemoryError

Why is this happening ? How can I run a script as user www-data and use import Image ?

Valeriy
  • 1,365
  • 3
  • 18
  • 45
Martin Vegter
  • 136
  • 9
  • 32
  • 56

1 Answers1

0

I guess you installed the Image package by using sudo pip install ... Please try to reinstall it without sudo.