can you try "pip install pillow" instead of putting it in 
C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\site-packages 
Not all packages like to be there and it can create problems.


On Wednesday, 20 April 2022 at 00:26:48 UTC-7 snide...@gmail.com wrote:

> I want to do some simple image manipulation using Pillow.  I've been using 
> Pillow in a standalone Python27 setup, and now I want to use it within my 
> w2p app.
>
> Since I had done the PIP into the standalone, I copied the files from that 
> site-packages to the web2py/site-packages.  The function that needed to use 
> the package did 
>
>     from PIL import Image
>
> which resulted in the stacktrace:
>
> Traceback (most recent call last):
> File 
> "C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\gluon\restricted.py", 
> line 219, in restricted
> exec(ccode, environment)
> File 
> "C:/Users/Dave/web2py_win/web2py_win_2.21.1_py27/web2py/applications/badlist/controllers/default.py"
>  
> <http://192.168.4.21:8008/admin/edit/badlist/controllers/default.py>, line 
> 2691, in <module>
> File 
> "C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\gluon\globals.py", 
> line 430, in <lambda>
> self._caller = lambda f: f()
> File 
> "C:/Users/Dave/web2py_win/web2py_win_2.21.1_py27/web2py/applications/badlist/controllers/default.py"
>  
> <http://192.168.4.21:8008/admin/edit/badlist/controllers/default.py>, line 
> 1059, in display
> img = Image.open(deep_path)
> File 
> "C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\site-packages\PIL\Image.py",
>  
> line 2807, in open
> if init():
> File 
> "C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\site-packages\PIL\Image.py",
>  
> line 427, in init
> __import__("PIL.%s" % plugin, globals(), locals(), [])
> File 
> "C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\gluon\custom_import.py",
>  
> line 59, in custom_importer
> return NATIVE_IMPORTER(name, globals, locals, fromlist, level)
> File 
> "C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\site-packages\PIL\EpsImagePlugin.py",
>  
> line 51, in <module>
> which = distutils.spawn.find_executable
> AttributeError: 'module' object has no attribute 'spawn'
>
> What are my options here, and what is the simplest way to get past this?  
> Should I
>
> * try to get the appropriate distutils?
> * try to run web2py from source on the standalone 2.7?
> * try to run web2py-win's 3.x and switch to the matching Pillow?
>
> (I think I have a standalone 3.10 already, but I haven't run Pillow on 
> that)
>
> Thanks for the sage advice.
>
> /dps
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/b35e69b6-9151-43d3-895a-faf05c03607fn%40googlegroups.com.

Reply via email to