Thanks, Massimo.
I've replaced the lines that you cited in your email in encoder.py.
In decoder.py there were only these lines:
from scanner import make_scanner
try:
from simplejson._speedups import scanstring as c_scanstring
except ImportError:
c_scanstring = None
I replaced the try: ... except ... with
c_scanstring = None
But it didn't help. I'm still getting the same traceback.
On Thu, Apr 8, 2010 at 12:38 PM, mdipierro <[email protected]> wrote:
> The problem is that I only packages the pure c version of simplejson
> for portability. You installed the full one so web2py finds it and it
> is incompatible. You may fix it (temporarily) by editing
>
> gluon/contrib/simplejson/encode.py and decoder.py
>
> at the top they have try:... except: like
>
>
> try:
> from simplejson._speedups import encode_basestring_ascii as
> c_encode_basestring_ascii
> except ImportError:
> c_encode_basestring_ascii = None
> try:
> from simplejson._speedups import make_encoder as c_make_encoder
> except ImportError:
> c_make_encoder = None
>
> replace them with
>
> c_encode_basestring_ascii = None
> c_make_encoder = None
>
> On Apr 7, 9:44 pm, Alexei Vinidiktov <[email protected]>
> wrote:
>> I'm not sure I used the right way to obtain the path. I just stuck
>> these lines in the welcome app's default/index.html view to get the
>> sys.path:
>>
>> {{import sys}}
>> {{=sys.path}}
>>
>> The simplejson library is located at:
>> C:\Python25\Lib\site-packages\simplejson-2.1.1-py2.5-win32.egg
>>
>> I installed it via easy_install.
>>
>> ['C:\\Users\\Alexei\\Documents\\web2py\\web2py-1.76.5',
>> 'C:\\Python25\\lib\\site-packages\\setuptools-0.6c11-py2.5.egg',
>> 'C:\\Python25\\lib\\site-packages\\peppy-0.13.1-py2.5.egg',
>> 'C:\\Python25\\lib\\site-packages\\yql-0.3-py2.5.egg',
>> 'C:\\Python25\\lib\\site-packages\\httplib2-0.5.0-py2.5.egg',
>> 'C:\\Python25\\lib\\site-packages\\lxml-2.2.4-py2.5-win32.egg',
>> 'C:\\Python25\\lib\\site-packages\\pyttsx-1.0.egg',
>> 'C:\\Windows\\system32\\python25.zip', 'C:\\Python25\\DLLs',
>> 'C:\\Python25\\lib', 'C:\\Python25\\lib\\plat-win',
>> 'C:\\Python25\\lib\\lib-tk', 'C:\\Python25',
>> 'C:\\Python25\\lib\\site-packages',
>> 'C:\\Python25\\lib\\site-packages\\win32',
>> 'C:\\Python25\\lib\\site-packages\\win32\\lib',
>> 'C:\\Python25\\lib\\site-packages\\Pythonwin',
>> 'C:\\Python25\\lib\\site-packages\\wx-2.8-msw-unicode', '../gluon',
>> 'C:\\Users\\Alexei\\Documents\\web2py\\web2py-1.76.5\\site-packages']
>>
>>
>>
>> On Thu, Apr 8, 2010 at 10:30 AM, mdipierro <[email protected]> wrote:
>> > Can you as web2py to print the sys.path?
>>
>> > On Apr 7, 8:26 pm, Alexei Vinidiktov <[email protected]>
>> > wrote:
>> >> Hello,
>>
>> >> I'm having trouble starting web2py.py on my local machine.
>>
>> >> I'm using web2py 1.76.5, Python 2.5.4 on Windows 7.
>>
>> >> I have simplejson 2.1.1 installed in site-packages. If I remove it,
>> >> web2py.py launches fine.
>>
>> >> Here's the traceback:
>>
>> >> Traceback (most recent call last):
>> >> File "C:\Users\Alexei\Documents\web2py\web2py-1.76.5\web2py.py", line
>> >> 17, in <
>> >> module>
>> >> import gluon.widget
>> >> File "C:\Users\Alexei\Documents\web2py\web2py-1.76.5\gluon\widget.py",
>> >> line 29
>> >> , in <module>
>> >> from main import HttpServer
>> >> File "gluon\main.py", line 35, in <module>
>> >> from globals import Request, Response, Session
>> >> File "gluon\globals.py", line 18, in <module>
>> >> from compileapp import run_view_in
>> >> File "gluon\compileapp.py", line 28, in <module>
>> >> from sql import SQLDB, SQLField, DAL, Field
>> >> File "C:\Users\Alexei\Documents\web2py\web2py-1.76.5\gluon\sql.py",
>> >> line 43, i
>> >> n <module>
>> >> from serializers import json
>> >> File
>> >> "C:\Users\Alexei\Documents\web2py\web2py-1.76.5\gluon\serializers.py", li
>> >> ne 9, in <module>
>> >> import contrib.simplejson as simplejson
>> >> File
>> >> "C:\Users\Alexei\Documents\web2py\web2py-1.76.5\gluon\contrib\simplejson\
>> >> __init__.py", line 238, in <module>
>> >> _default_decoder = JSONDecoder(encoding=None, object_hook=None)
>> >> File
>> >> "C:\Users\Alexei\Documents\web2py\web2py-1.76.5\gluon\contrib\simplejson\
>> >> decoder.py", line 322, in __init__
>> >> self.scan_once = make_scanner(self)
>> >> AttributeError: 'JSONDecoder' object has no attribute 'object_pairs_hook'
>>
>> >> --
>> >> Alexei Vinidiktov
>>
>> > --
>> > You received this message because you are subscribed to the Google Groups
>> > "web2py-users" group.
>> > To post to this group, send email to [email protected].
>> > To unsubscribe from this group, send email to
>> > [email protected].
>> > For more options, visit this group
>> > athttp://groups.google.com/group/web2py?hl=en.
>>
>> --
>> Alexei Vinidiktov
>
> --
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/web2py?hl=en.
>
>
--
Alexei Vinidiktov
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en.