Windows / 2.14.5 / Cannot import module

71 views
Skip to first unread message

Kiran Subbaraman

unread,
Apr 20, 2016, 12:51:23 PM4/20/16
to web2py-users
Downloaded Web2py for Windows: http://www.web2py.com/examples/static/web2py_win.zip.
2.14.5-stable+timestamp.2016.04.14.03.26.16
(Running on Rocket 1.2.6, Python 2.7.9)
Windows 10

Unable to use the redis client library (https://github.com/andymccurdy/redis-py) from within the application.
This works in the web2py_src edition (http://www.web2py.com/examples/static/web2py_src.zip). 2.14.5-stable+timestamp.2016.04.14.03.26.16, (Running on Rocket 1.2.6, Python 2.7.10)

To view the issue, do the following:

The trace:
web2pyVersion 2.14.5-stable+timestamp.2016.04.14.03.26.16
PythonPython 2.7.9: c:\Users\subbaraman\Downloads\web2py_win\web2py\web2py.exe (prefix: D:\programs\open\python27)


Traceback


1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
Traceback (most recent call last):
 
File "c:\Users\subbaraman\Downloads\web2py_win\web2py\gluon\restricted.py", line 227, in restricted
   
exec ccode in environment
 
File "c:/Users/subbaraman/Downloads/web2py_win/web2py/applications/module_redis/controllers/default.py", line 11, in <module>
   
import redis_mod as rm
 
File "c:\Users\subbaraman\Downloads\web2py_win\web2py\gluon\custom_import.py", line 85, in custom_importer
    modules_prefix
, globals, locals, [itemname], level)
 
File "applications\module_redis\modules\redis_mod.py", line 5, in <module>
   
import redis
 
File "c:\Users\subbaraman\Downloads\web2py_win\web2py\gluon\custom_import.py", line 89, in custom_importer
   
raise ImportError, 'Cannot import module %s' % str(e)
ImportError: Cannot import module 'applications.module_redis.modules.redis'



web2py.app.module_redis.w2p

Dave S

unread,
Apr 20, 2016, 2:15:02 PM4/20/16
to web2py-users


On Wednesday, April 20, 2016 at 9:51:23 AM UTC-7, Kiran Subbaraman wrote:
Downloaded Web2py for Windows: http://www.web2py.com/examples/static/web2py_win.zip.
2.14.5-stable+timestamp.2016.04.14.03.26.16
(Running on Rocket 1.2.6, Python 2.7.9)
Windows 10

Unable to use the redis client library (https://github.com/andymccurdy/redis-py) from within the application.
This works in the web2py_src edition (http://www.web2py.com/examples/static/web2py_src.zip). 2.14.5-stable+timestamp.2016.04.14.03.26.16, (Running on Rocket 1.2.6, Python 2.7.10)

To view the issue, do the following:

The trace:
web2pyVersion 2.14.5-stable+timestamp.2016.04.14.03.26.16
PythonPython 2.7.9: c:\Users\subbaraman\Downloads\web2py_win\web2py\web2py.exe (prefix: D:\programs\open\python27)


Do you have redis in your site-packages?

/dps

Kiran Subbaraman

unread,
Apr 20, 2016, 3:01:09 PM4/20/16
to web2py-users
Yes, I do. Had installed the redis-client: `pip install redis`
Also, please note that this works with the web2py_src version, but not the web2py-windows binary.

Dave S

unread,
Apr 20, 2016, 3:16:05 PM4/20/16
to web2py-users


On Wednesday, April 20, 2016 at 12:01:09 PM UTC-7, Kiran Subbaraman wrote:
Yes, I do. Had installed the redis-client: `pip install redis`
Also, please note that this works with the web2py_src version, but not the web2py-windows binary.

You may need to have it in the web2py/site-packages directory; the windows binary has it's own python dll.

/dps

Anthony

unread,
Apr 20, 2016, 3:34:24 PM4/20/16
to web2py-users
On Wednesday, April 20, 2016 at 3:01:09 PM UTC-4, Kiran Subbaraman wrote:
Yes, I do. Had installed the redis-client: `pip install redis`
Also, please note that this works with the web2py_src version, but not the web2py-windows binary.

The Windows and OSX binaries include their own Python interpreters, so they do not use your system's installation of Python (or any of its modules). As long as you already have Python on your system, just run the source version of web2py -- there is no benefit to using the Windows binary (it is intended to make it easier to run web2py because it doesn't require Python to be installed).

Anthony

Kiran Subbaraman

unread,
Apr 21, 2016, 12:15:49 AM4/21/16
to web...@googlegroups.com
Anthony, thanks for the details. Yes, my preferred runtime is the source version of web2py.
________________________________________
Kiran Subbaraman
http://subbaraman.wordpress.com/about/
--
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+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kiran Subbaraman

unread,
Apr 21, 2016, 12:16:50 AM4/21/16
to web...@googlegroups.com
Dave, thanks for this tip. I wasn't aware of this. In any case, going back to my preferred runtime - source version of web2py.

________________________________________
Kiran Subbaraman
http://subbaraman.wordpress.com/about/
-- 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+un...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages