Re: [web2py] Re: Loading modules fails - web2py 2.1.1(and earlier) / python 2.7.1 / Mac OS X

2014-12-08 Thread 黄祥
i face the same problem on mac with web2py source 2.9.11-stable :

MacBook:web2py MacBookPro$ python web2py.py -S welcome

web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2014
Version 2.9.11-stable+timestamp.2014.09.15.23.35.11
Database drivers available: SQLite(sqlite3), MySQL(pymysql), 
PostgreSQL(pg8000), MSSQL(pyodbc), DB2(pyodbc), Teradata(pyodbc), 
Ingres(pyodbc), IMAP(imaplib)
WARNING:web2py:import IPython error; use default python shell
Python 2.7.6 (default, Sep  9 2014, 15:04:36) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type help, copyright, credits or license for more information.
(InteractiveConsole)
 import simplejson
Traceback (most recent call last):
  File console, line 1, in module
  File /Users/MacBookPro/web2py/gluon/custom_import.py, line 86, in 
custom_importer
raise ImportError, 'Cannot import module %s' % str(e)
ImportError: Cannot import module 'simplejson'

is there a way to solve this?

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Loading modules fails - web2py 2.1.1(and earlier) / python 2.7.1 / Mac OS X

2014-12-08 Thread Anthony
It's not clear this is the same problem. What happens if you open a 
standard Python shell (not a web2py shell) and try to import simplejson?

On Monday, December 8, 2014 8:37:42 AM UTC-5, 黄祥 wrote:

 i face the same problem on mac with web2py source 2.9.11-stable :

 MacBook:web2py MacBookPro$ python web2py.py -S welcome

 web2py Web Framework
 Created by Massimo Di Pierro, Copyright 2007-2014
 Version 2.9.11-stable+timestamp.2014.09.15.23.35.11
 Database drivers available: SQLite(sqlite3), MySQL(pymysql), 
 PostgreSQL(pg8000), MSSQL(pyodbc), DB2(pyodbc), Teradata(pyodbc), 
 Ingres(pyodbc), IMAP(imaplib)
 WARNING:web2py:import IPython error; use default python shell
 Python 2.7.6 (default, Sep  9 2014, 15:04:36) 
 [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
 Type help, copyright, credits or license for more information.
 (InteractiveConsole)
  import simplejson
 Traceback (most recent call last):
   File console, line 1, in module
   File /Users/MacBookPro/web2py/gluon/custom_import.py, line 86, in 
 custom_importer
 raise ImportError, 'Cannot import module %s' % str(e)
 ImportError: Cannot import module 'simplejson'

 is there a way to solve this?


-- 
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.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Loading modules fails - web2py 2.1.1(and earlier) / python 2.7.1 / Mac OS X

2014-12-08 Thread Andy Pardue
Massimo,
This has happened to me a few times it seems that an error in the module 
just proclaims it is not there instead of raising the error through the 
custom_import. I have not tried to fix it in web2py because I am under 
deadlines, I just know that there is a import error or something like that 
in the module and fix the module then all is good.

Andy

On Saturday, October 20, 2012 7:43:43 AM UTC-7, Massimo Di Pierro wrote:

 I am very puzzled but this. It should not be necessary. Does the code 
 below work for you?

 $ python web2py.py -S welcome 
 (InteractiveConsole)
  import simplejson

 Do you have a module called simplejson in yourapp/modules/? 

 From a normal python shell, shat happens if you do?

  import simplejson

 On Thursday, 18 October 2012 14:17:38 UTC-5, Luciano Laporta Podazza wrote:

 Well it seems that after a lot of research and specially after posting 
 this question that I found the solution.

 I've tried facebook-sdk module and had to modify just one line to make it 
 work:

 facebook.py, line 49:
 # Find a JSON parser
 try:
 import simplejson as json


 To

 # Find a JSON parser
 try:
 import gluon.contrib.simplejson as json

 And that's all. Hope it helps anybody!

 On Thursday, October 18, 2012 1:43:29 PM UTC-3, Luciano Laporta Podazza 
 wrote:

 Hello, first of all thank you Massimo and you people for this awesome 
 framework! I'm in love with it! :D

 I've tried to load some facebook modules and none of them works, at 
 least on Mac OS.

 This is what I did:

 1. Get facebook api from one of these repos:
 https://github.com/sciyoshi/pyfacebook/
 https://github.com/jgorset/facepy
 https://github.com/pythonforfacebook/facebook-sdk

 2. Copy them on modules/ like this:
 modules/facebook-api-folder/files.py

 3. Load it from the controller, e.g. facepy module:
 def index():
 from facepy import graph_api

 It doesn't matter what I try, I always get some errors:
 - type 'exceptions.ImportError' No module named facepy (or other 
 module's name)
 - With facebook-sdk it says that simplejson can't be loaded 'cause it 
 doesn't exists(and it exists and works!)
 - it doesn't matter the way I put the module folder under modules/, for 
 example modules/facebookmodule/sub-dir/module.py and then from 
 facebookmodule.subdir import module. I always get the error that the module 
 does not exists.
 - I even tried copying the module under site-packages and it seems to 
 load the module(I get no errors about it) but then I get the error that 
 simplejson doesn't exists(and this is not true).

 A friend of mine tried this on GNU/Linux and modules works perfectly, so 
 it seems the issue is related with Mac OS.

 Any ideas?. please note that I'm a newbie with python and web2py.

 LOT of thanks in advance :)



-- 
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.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Loading modules fails - web2py 2.1.1(and earlier) / python 2.7.1 / Mac OS X

2012-10-20 Thread Massimo Di Pierro
I am very puzzled but this. It should not be necessary. Does the code below 
work for you?

$ python web2py.py -S welcome 
(InteractiveConsole)
 import simplejson

Do you have a module called simplejson in yourapp/modules/? 

From a normal python shell, shat happens if you do?

 import simplejson

On Thursday, 18 October 2012 14:17:38 UTC-5, Luciano Laporta Podazza wrote:

 Well it seems that after a lot of research and specially after posting 
 this question that I found the solution.

 I've tried facebook-sdk module and had to modify just one line to make it 
 work:

 facebook.py, line 49:
 # Find a JSON parser
 try:
 import simplejson as json


 To

 # Find a JSON parser
 try:
 import gluon.contrib.simplejson as json

 And that's all. Hope it helps anybody!

 On Thursday, October 18, 2012 1:43:29 PM UTC-3, Luciano Laporta Podazza 
 wrote:

 Hello, first of all thank you Massimo and you people for this awesome 
 framework! I'm in love with it! :D

 I've tried to load some facebook modules and none of them works, at least 
 on Mac OS.

 This is what I did:

 1. Get facebook api from one of these repos:
 https://github.com/sciyoshi/pyfacebook/
 https://github.com/jgorset/facepy
 https://github.com/pythonforfacebook/facebook-sdk

 2. Copy them on modules/ like this:
 modules/facebook-api-folder/files.py

 3. Load it from the controller, e.g. facepy module:
 def index():
 from facepy import graph_api

 It doesn't matter what I try, I always get some errors:
 - type 'exceptions.ImportError' No module named facepy (or other 
 module's name)
 - With facebook-sdk it says that simplejson can't be loaded 'cause it 
 doesn't exists(and it exists and works!)
 - it doesn't matter the way I put the module folder under modules/, for 
 example modules/facebookmodule/sub-dir/module.py and then from 
 facebookmodule.subdir import module. I always get the error that the module 
 does not exists.
 - I even tried copying the module under site-packages and it seems to 
 load the module(I get no errors about it) but then I get the error that 
 simplejson doesn't exists(and this is not true).

 A friend of mine tried this on GNU/Linux and modules works perfectly, so 
 it seems the issue is related with Mac OS.

 Any ideas?. please note that I'm a newbie with python and web2py.

 LOT of thanks in advance :)



-- 





[web2py] Re: Loading modules fails - web2py 2.1.1(and earlier) / python 2.7.1 / Mac OS X

2012-10-20 Thread Luciano Laporta Podazza
Hello Massimo!, comments inline.

On Saturday, October 20, 2012 11:43:43 AM UTC-3, Massimo Di Pierro wrote:

 I am very puzzled but this. It should not be necessary. Does the code 
 below work for you?

 $ python web2py.py -S welcome 
 (InteractiveConsole)
  import simplejson


If I use web2py.app(Mac OS) it doesn't work:

Silver-2:Resources keniobats$ pwd
/Users/keniobats/Downloads/web2py/web2py.app/Contents/Resources
Silver-2:Resources keniobats$ python web2py.py -S welcome
Traceback (most recent call last):
  File web2py.py, line 16, in module
import gluon.widget
ImportError: No module named gluon.widget
Silver-2:Resources keniobats$ 

If I use the source version it works well:

Silver-2:web2py 2 keniobats$ python web2py.py -S welcome
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2012
Version 2.0.9 (2012-09-13 23:51:30) stable
Database drivers available: SQLite(sqlite3), MySQL(pymysql), 
PostgreSQL(pg8000), IMAP(imaplib)
WARNING:web2py:import IPython error; use default python shell
Python 2.7.1 (r271:86832, Jun 25 2011, 05:09:01) 
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on 
darwin
Type help, copyright, credits or license for more information.
(InteractiveConsole)
 import simplejson
 



 


 Do you have a module called simplejson in yourapp/modules/? 


I have nothing but my facebook.py module there.
 


 From a normal python shell, shat happens if you do?

  import simplejson


Silver-2:~ keniobats$ pwd
/Users/keniobats
Silver-2:~ keniobats$ python
Python 2.7.1 (r271:86832, Jun 25 2011, 05:09:01) 
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on 
darwin
Type help, copyright, credits or license for more information.
 import simplejson
 

It works as usual :)

Hope it helps, thanks Massimo!

-- 





[web2py] Re: Loading modules fails - web2py 2.1.1(and earlier) / python 2.7.1 / Mac OS X

2012-10-20 Thread Massimo Di Pierro
I just tried this (using OSX binary distribution -nightly built) and I 
cannot reproduce it. Could you try it?

Massimo

On Saturday, 20 October 2012 11:32:55 UTC-5, Luciano Laporta Podazza wrote:

 Hello Massimo!, comments inline.

 On Saturday, October 20, 2012 11:43:43 AM UTC-3, Massimo Di Pierro wrote:

 I am very puzzled but this. It should not be necessary. Does the code 
 below work for you?

 $ python web2py.py -S welcome 
 (InteractiveConsole)
  import simplejson


 If I use web2py.app(Mac OS) it doesn't work:

 Silver-2:Resources keniobats$ pwd
 /Users/keniobats/Downloads/web2py/web2py.app/Contents/Resources
 Silver-2:Resources keniobats$ python web2py.py -S welcome
 Traceback (most recent call last):
   File web2py.py, line 16, in module
 import gluon.widget
 ImportError: No module named gluon.widget
 Silver-2:Resources keniobats$ 

 If I use the source version it works well:

 Silver-2:web2py 2 keniobats$ python web2py.py -S welcome
 web2py Web Framework
 Created by Massimo Di Pierro, Copyright 2007-2012
 Version 2.0.9 (2012-09-13 23:51:30) stable
 Database drivers available: SQLite(sqlite3), MySQL(pymysql), 
 PostgreSQL(pg8000), IMAP(imaplib)
 WARNING:web2py:import IPython error; use default python shell
 Python 2.7.1 (r271:86832, Jun 25 2011, 05:09:01) 
 [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on 
 darwin
 Type help, copyright, credits or license for more information.
 (InteractiveConsole)
  import simplejson
  



  


 Do you have a module called simplejson in yourapp/modules/? 


 I have nothing but my facebook.py module there.
  


 From a normal python shell, shat happens if you do?

  import simplejson


 Silver-2:~ keniobats$ pwd
 /Users/keniobats
 Silver-2:~ keniobats$ python
 Python 2.7.1 (r271:86832, Jun 25 2011, 05:09:01) 
 [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on 
 darwin
 Type help, copyright, credits or license for more information.
  import simplejson
  

 It works as usual :)

 Hope it helps, thanks Massimo!


-- 





Re: [web2py] Re: Loading modules fails - web2py 2.1.1(and earlier) / python 2.7.1 / Mac OS X

2012-10-20 Thread Luciano Laporta Podazza
On Sat, Oct 20, 2012 at 7:35 PM, Massimo Di Pierro 
massimo.dipie...@gmail.com wrote:

 I just tried this (using OSX binary distribution -nightly built) and I
 cannot reproduce it. Could you try it?


Sure!, I'll do it right now and get back to you.



 Massimo


 On Saturday, 20 October 2012 11:32:55 UTC-5, Luciano Laporta Podazza wrote:

 Hello Massimo!, comments inline.

 On Saturday, October 20, 2012 11:43:43 AM UTC-3, Massimo Di Pierro wrote:

 I am very puzzled but this. It should not be necessary. Does the code
 below work for you?

 $ python web2py.py -S welcome
 (InteractiveConsole)
  import simplejson


 If I use web2py.app(Mac OS) it doesn't work:

 Silver-2:Resources keniobats$ pwd
 /Users/keniobats/Downloads/**web2py/web2py.app/Contents/**Resources
 Silver-2:Resources keniobats$ python web2py.py -S welcome
 Traceback (most recent call last):
   File web2py.py, line 16, in module
 import gluon.widget
 ImportError: No module named gluon.widget
 Silver-2:Resources keniobats$

 If I use the source version it works well:

 Silver-2:web2py 2 keniobats$ python web2py.py -S welcome
 web2py Web Framework
 Created by Massimo Di Pierro, Copyright 2007-2012
 Version 2.0.9 (2012-09-13 23:51:30) stable
 Database drivers available: SQLite(sqlite3), MySQL(pymysql),
 PostgreSQL(pg8000), IMAP(imaplib)
 WARNING:web2py:import IPython error; use default python shell
 Python 2.7.1 (r271:86832, Jun 25 2011, 05:09:01)
 [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on
 darwin
 Type help, copyright, credits or license for more information.
 (InteractiveConsole)
  import simplejson
 






 Do you have a module called simplejson in yourapp/modules/?


 I have nothing but my facebook.py module there.



 From a normal python shell, shat happens if you do?

  import simplejson


 Silver-2:~ keniobats$ pwd
 /Users/keniobats
 Silver-2:~ keniobats$ python
 Python 2.7.1 (r271:86832, Jun 25 2011, 05:09:01)
 [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on
 darwin
 Type help, copyright, credits or license for more information.
  import simplejson
 

 It works as usual :)

 Hope it helps, thanks Massimo!

  --







-- 
Atte
Luciano Laporta Podazza

-- 





[web2py] Re: Loading modules fails - web2py 2.1.1(and earlier) / python 2.7.1 / Mac OS X

2012-10-19 Thread Luciano Laporta Podazza
Well it seems that after a lot of research and specially after posting this 
question that I found the solution.

I've tried facebook-sdk module and had to modify just one line to make it 
work:

facebook.py, line 49:
# Find a JSON parser
try:
import simplejson as json


To

# Find a JSON parser
try:
import gluon.contrib.simplejson as json

And that's all. Hope it helps anybody!

On Thursday, October 18, 2012 1:43:29 PM UTC-3, Luciano Laporta Podazza 
wrote:

 Hello, first of all thank you Massimo and you people for this awesome 
 framework! I'm in love with it! :D

 I've tried to load some facebook modules and none of them works, at least 
 on Mac OS.

 This is what I did:

 1. Get facebook api from one of these repos:
 https://github.com/sciyoshi/pyfacebook/
 https://github.com/jgorset/facepy
 https://github.com/pythonforfacebook/facebook-sdk

 2. Copy them on modules/ like this:
 modules/facebook-api-folder/files.py

 3. Load it from the controller, e.g. facepy module:
 def index():
 from facepy import graph_api

 It doesn't matter what I try, I always get some errors:
 - type 'exceptions.ImportError' No module named facepy (or other 
 module's name)
 - With facebook-sdk it says that simplejson can't be loaded 'cause it 
 doesn't exists(and it exists and works!)
 - it doesn't matter the way I put the module folder under modules/, for 
 example modules/facebookmodule/sub-dir/module.py and then from 
 facebookmodule.subdir import module. I always get the error that the module 
 does not exists.
 - I even tried copying the module under site-packages and it seems to load 
 the module(I get no errors about it) but then I get the error that 
 simplejson doesn't exists(and this is not true).

 A friend of mine tried this on GNU/Linux and modules works perfectly, so 
 it seems the issue is related with Mac OS.

 Any ideas?. please note that I'm a newbie with python and web2py.

 LOT of thanks in advance :)


--