Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

ImportError: No module named simplejson

I am trying to run the default code with the iPhone simulator, and always get this error:

Traceback (most recent call last):

File "/Library/Application Support/Titanium/mobilesdk/osx/1.8.1/iphone/builder.py", line 10, in <module> from compiler import Compiler, softlink_for_simulator

File "/Library/Application Support/Titanium/mobilesdk/osx/1.8.1/iphone/compiler.py", line 20, in <module> import simplejson as json

ImportError: No module named simplejson

I don't know what to do… Any ideas?

  • Mac OSX 10.6.8
  • Titanium Version: 1.0.8.201201262211
  • Titanium SDK Version: 1.8.1
  • iOS SDK 4.3
— asked February 7th 2012 by Edin Guermas
  • importerror
  • iphone
  • json
  • simplejson
  • simulator
0 Comments

6 Answers

  • EUREKA!!! I did it! Just download simplejson from the link Pomu Takeuchi posted, and then open Terminal and go to the folder you decompressed the .tar, typing this:

    python setup.py build
    

    and then

    python setup.py install
    

    If any problem with the installation, try going here

    Hope this will help!! Thanks for answering ppl!! CODE STRONG!!

    — answered February 8th 2012 by Edin Guermas
    permalink
    1 Comment
    • I had simple JSON installed with easy_install, however it only worked after I installed it manually.

      — commented March 22nd 2012 by Ionut Moraru
  • sounds like your SDK download was corrupt… I recommend re-downloading by deleting your /Library/Application Support/Titanium/mobilesdk/osx/1.8.1/ directory and re-starting studio

    — answered February 7th 2012 by Matt Apperson
    permalink
    1 Comment
    • same issue here, even after re-downloding sdk and re-starting studio.

      — commented February 7th 2012 by Pomu Takeuchi
  • solved after manually installing simplejson.
    http://hidelafoglia.wordpress.com/2008/12/01/jsonpythonsimplejsoninstall/

    — answered February 7th 2012 by Pomu Takeuchi
    permalink
    0 Comments
  • Hi Pomu Takeuchi,

    I am getting the same error.

    how you installed that simpleJson-2.0.5.tar.gz????

    can you please tell me the steps, as i am new in mac so i don't have any idea.

    Thanks in Advance.

    — answered February 8th 2012 by Chetan Jadhav
    permalink
    1 Comment
    • Try to open Terminal and type:

      sudo easy_install simplejson

      That's the way I did:

      orion:~ XukY$ sudo easy_install simplejson
      Password:
      Searching for simplejson
      Reading http://pypi.python.org/simple/simplejson/
      Reading http://undefined.org/python/#simplejson
      Reading http://github.com/simplejson/simplejson
      Best match: simplejson 2.3.2
      Downloading http://pypi.python.org/packages/source/s/simplejson/simplejson-2.3.2.tar.gz#md5=0863e016f682f06ead07dd9efad95194
      Processing simplejson-2.3.2.tar.gz
      Running simplejson-2.3.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-2chBoG/simplejson-2.3.2/egg-dist-tmp-albcIl
      /usr/libexec/gcc/powerpc-apple-darwin10/4.2.1/as: assembler (/usr/bin/../libexec/gcc/darwin/ppc/as or /usr/bin/../local/libexec/gcc/darwin/ppc/as) for architecture ppc not installed
      Installed assemblers are:
      /usr/bin/../libexec/gcc/darwin/x86_64/as for architecture x86_64
      /usr/bin/../libexec/gcc/darwin/i386/as for architecture i386
      simplejson/_speedups.c:2686: fatal error: error writing to -: Broken pipe
      compilation terminated.
      lipo: can't open input file: /var/tmp//ccMlEBFk.out (No such file or directory)
      ***************************************************************************
      WARNING: The C extension could not be compiled, speedups are not enabled.
      Failure information, if any, is above.
      I'm retrying the build without the C extension now.
      ***************************************************************************
      zip_safe flag not set; analyzing archive contents...
      simplejson.tests.__init__: module references __file__
      ***************************************************************************
      WARNING: The C extension could not be compiled, speedups are not enabled.
      Plain-Python installation succeeded.
      ***************************************************************************
      Adding simplejson 2.3.2 to easy-install.pth file
      
      Installed /Library/Python/2.6/site-packages/simplejson-2.3.2-py2.6.egg
      Processing dependencies for simplejson
      Finished processing dependencies for simplejson
      

      — commented February 8th 2012 by Edin Guermas
  • I have installed manually simplejson and have redownloaded the SDK… And still does not work, I get the same error:

    Traceback (most recent call last):
      File "/Library/Application Support/Titanium/mobilesdk/osx/1.8.1/iphone/builder.py", line 10, in <module>
        from compiler import Compiler, softlink_for_simulator
      File "/Library/Application Support/Titanium/mobilesdk/osx/1.8.1/iphone/compiler.py", line 20, in <module>
        import simplejson as json
    ImportError: No module named simplejson
    
    — answered February 8th 2012 by Edin Guermas
    permalink
    0 Comments
  • Thank you

    Thank you

    Thank you

    Thank you Very Much….

    Finally it Worked for me….

    :-)

    — answered February 8th 2012 by Chetan Jadhav
    permalink
    1 Comment
    • You're welcome ;)

      — commented February 9th 2012 by Edin Guermas
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.