Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python

Installing simplejson issues

 

 

Python python RSS feed   Index | Next | Previous | View Threaded


blwatson at gmail

Mar 28, 2008, 12:14 PM

Post #1 of 12 (13765 views)
Permalink
Installing simplejson issues

I am trying to install the twitter python wrapper...I got that
installed just fine, but am having serious troubles getting the
simplejson package to install. I need help diagnosing where this is
failing. I am trying to use:

http://pypi.python.org/pypi/simplejson

and I run "python setup.py build" and then "python setup.py install",
which both seem to work just fine.

I tried running with easy_install, but that too is not working. I end
up with:

simplejson-1.8.1-py2.5-macosx-10.3-fat.egg

in my:

/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-
packages/

I am on Mac OS X 10.5. Any help would be greatly appreciated.
--
http://mail.python.org/mailman/listinfo/python-list


gagsl-py2 at yahoo

Mar 28, 2008, 1:57 PM

Post #2 of 12 (13690 views)
Permalink
Re: Installing simplejson issues [In reply to]

En Fri, 28 Mar 2008 16:14:07 -0300, <blwatson [at] gmail> escribió:

> I am trying to install the twitter python wrapper...I got that
> installed just fine, but am having serious troubles getting the
> simplejson package to install. I need help diagnosing where this is
> failing. I am trying to use:
>
> http://pypi.python.org/pypi/simplejson
>
> and I run "python setup.py build" and then "python setup.py install",
> which both seem to work just fine.

I don't understand - if it worked fine, what's the problem?

> I tried running with easy_install, but that too is not working. I end
> up with:
>
> simplejson-1.8.1-py2.5-macosx-10.3-fat.egg
>
> in my:
>
> /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-
> packages/
>
> I am on Mac OS X 10.5. Any help would be greatly appreciated.

And then you import simplejson and it fails? Or what?

--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list


blwatson at gmail

Mar 28, 2008, 7:23 PM

Post #3 of 12 (13686 views)
Permalink
Re: Installing simplejson issues [In reply to]

On Mar 28, 1:57 pm, "Gabriel Genellina" <gagsl-...@yahoo.com.ar>
wrote:
> En Fri, 28 Mar 2008 16:14:07 -0300, <blwat...@gmail.com> escribió:
>
> > I am trying to install the twitter python wrapper...I got that
> > installed just fine, but am having serious troubles getting the
> > simplejson package to install.  I need help diagnosing where this is
> > failing.  I am trying to use:
>
> >http://pypi.python.org/pypi/simplejson
>
> > and I run "python setup.py build" and then "python setup.py install",
> > which both seem to work just fine.
>
> I don't understand - if it worked fine, what's the problem?
>
> > I tried running with easy_install, but that too is not working.  I end
> > up with:
>
> > simplejson-1.8.1-py2.5-macosx-10.3-fat.egg
>
> > in my:
>
> > /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-
> > packages/
>
> > I am on Mac OS X 10.5.  Any help would be greatly appreciated.
>
> And then you import simplejson and it fails? Or what?
>
> --
> Gabriel Genellina

Yes, when I try to import simplejson, it fails

>>> import simplejson

Traceback (most recent call last):
File "<pyshell#284>", line 1, in <module>
import simplejson
ImportError: No module named simplejson

there is not simplejson.py anywhere on my machine. I understand that
I am new to python and trying to make heads or tails of what has
happened with this install process. Any help is appreciated.
--
http://mail.python.org/mailman/listinfo/python-list


gagsl-py2 at yahoo

Mar 28, 2008, 9:24 PM

Post #4 of 12 (13682 views)
Permalink
Re: Installing simplejson issues [In reply to]

En Fri, 28 Mar 2008 23:23:01 -0300, <blwatson [at] gmail> escribió:

> On Mar 28, 1:57 pm, "Gabriel Genellina" <gagsl-...@yahoo.com.ar>
> wrote:
>> En Fri, 28 Mar 2008 16:14:07 -0300, <blwat...@gmail.com> escribió:
>>
>> > I am trying to install the twitter python wrapper...I got that
>> > installed just fine, but am having serious troubles getting the
>> > simplejson package to install.  I need help diagnosing where this is
>> > failing.  I am trying to use:
>>
>> >http://pypi.python.org/pypi/simplejson
>>
>> > and I run "python setup.py build" and then "python setup.py install",
>> > which both seem to work just fine.

I tried to install the package but failed. Looks like the setup.py used by
simplejson is broken - doesn't handle well the case when the C extension
can't be compiled.
When I run `python setup.py install` I got this message:

building 'simplejson._speedups' extension
**********************************************************************
WARNING: The C extension could not be compiled, speedups are not enabled.

Below is the output showing how the compilation failed:

Python was built with Visual Studio version 7.1, and extensions need to be
built
with the same version of the compiler, but it isn't installed.
**********************************************************************

and later:
removing simplejson.egg-info\native_libs.txt
...
error: can't copy 'simplejson.egg-info\native_libs.txt': doesn't exist or
not a regular file

I suggest that you remove the simplejson-xxxxxx.egg file and delete the
simplejson entry in easy-install.pth (both in your site-packages directory)
Then extract the simplejson directory from inside the original .tar.gz
archive into your site-packages directory (so you end up by example with a
.../site-packages/simplejson/decoder.py file, among others)
That appears to be enough; import simplejson worked fine for me.

I hate those f****ng eggs. Ah, and I hate easy_install too.

--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list


deets at nospam

Mar 29, 2008, 3:45 PM

Post #5 of 12 (13682 views)
Permalink
Re: Installing simplejson issues [In reply to]

Gabriel Genellina schrieb:
> En Fri, 28 Mar 2008 23:23:01 -0300, <blwatson [at] gmail> escribió:
>
>> On Mar 28, 1:57 pm, "Gabriel Genellina" <gagsl-...@yahoo.com.ar>
>> wrote:
>>> En Fri, 28 Mar 2008 16:14:07 -0300, <blwat...@gmail.com> escribió:
>>>
>>> > I am trying to install the twitter python wrapper...I got that
>>> > installed just fine, but am having serious troubles getting the
>>> > simplejson package to install. I need help diagnosing where this is
>>> > failing. I am trying to use:
>>>
>>> >http://pypi.python.org/pypi/simplejson
>>>
>>> > and I run "python setup.py build" and then "python setup.py install",
>>> > which both seem to work just fine.
>
> I tried to install the package but failed. Looks like the setup.py used
> by simplejson is broken - doesn't handle well the case when the C
> extension can't be compiled.
> When I run `python setup.py install` I got this message:
>
> building 'simplejson._speedups' extension
> **********************************************************************
> WARNING: The C extension could not be compiled, speedups are not enabled.
>
> Below is the output showing how the compilation failed:
>
> Python was built with Visual Studio version 7.1, and extensions need to
> be built
> with the same version of the compiler, but it isn't installed.
> **********************************************************************
>
> and later:
> removing simplejson.egg-info\native_libs.txt
> ...
> error: can't copy 'simplejson.egg-info\native_libs.txt': doesn't exist
> or not a regular file
>
> I suggest that you remove the simplejson-xxxxxx.egg file and delete the
> simplejson entry in easy-install.pth (both in your site-packages directory)
> Then extract the simplejson directory from inside the original .tar.gz
> archive into your site-packages directory (so you end up by example with
> a .../site-packages/simplejson/decoder.py file, among others)
> That appears to be enough; import simplejson worked fine for me.
>
> I hate those f****ng eggs. Ah, and I hate easy_install too.

This has nothing to do with setuptools or easy_install per se. The
author of simplejson tried to create a library that works with or
without a C-extension. And failed.

As your above approach fails to even *try* and compile the speedups.

Diez
--
http://mail.python.org/mailman/listinfo/python-list


deets at nospam

Mar 29, 2008, 3:48 PM

Post #6 of 12 (13680 views)
Permalink
Re: Installing simplejson issues [In reply to]

blwatson [at] gmail schrieb:
> I am trying to install the twitter python wrapper...I got that
> installed just fine, but am having serious troubles getting the
> simplejson package to install. I need help diagnosing where this is
> failing. I am trying to use:
>
> http://pypi.python.org/pypi/simplejson
>
> and I run "python setup.py build" and then "python setup.py install",
> which both seem to work just fine.
>
> I tried running with easy_install, but that too is not working. I end
> up with:
>
> simplejson-1.8.1-py2.5-macosx-10.3-fat.egg
>
> in my:
>
> /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-
> packages/
>
> I am on Mac OS X 10.5. Any help would be greatly appreciated.

Go to the turbogears file section and download an appropriate version of
simplejson:

http://www.turbogears.org/download/filelist.html

I presume sj-1.7.4 is sufficient.

Alternatively, be gentle to your unixish OS that OS X is, and install
XCode. Which will install the whole GCC chain, making your OS a
respected member of OS-community - as every system should be able to
compile C-code, in which itself has been written.

Then the install should work as well.

Diez
--
http://mail.python.org/mailman/listinfo/python-list


blwatson at gmail

Mar 29, 2008, 4:54 PM

Post #7 of 12 (13675 views)
Permalink
Re: Installing simplejson issues [In reply to]

On Mar 29, 3:48 pm, "Diez B. Roggisch" <de...@nospam.web.de> wrote:
> blwat...@gmail.com schrieb:
>
>
>
> > I am trying to install the twitter python wrapper...I got that
> > installed just fine, but am having serious troubles getting the
> > simplejson package to install.  I need help diagnosing where this is
> > failing.  I am trying to use:
>
> >http://pypi.python.org/pypi/simplejson
>
> > and I run "python setup.py build" and then "python setup.py install",
> > which both seem to work just fine.
>
> > I tried running with easy_install, but that too is not working.  I end
> > up with:
>
> > simplejson-1.8.1-py2.5-macosx-10.3-fat.egg
>
> > in my:
>
> > /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-
> > packages/
>
> > I am on Mac OS X 10.5.  Any help would be greatly appreciated.
>
> Go to the turbogears file section and download an appropriate version of
> simplejson:
>
> http://www.turbogears.org/download/filelist.html
>
> I presume sj-1.7.4 is sufficient.
>
> Alternatively, be gentle to your unixish OS that OS X is, and install
> XCode. Which will install the whole GCC chain, making your OS a
> respected member of OS-community - as every system should be able to
> compile C-code, in which itself has been written.
>
> Then the install should work as well.
>
> Diez

I have already installed XCode...my compiel did not break the way the
above did.

I have grabbed the .egg file for simplejson 1.7.4 for Mac OS X 10.5 at
the above link you provided - it has a simplejson dir, with the exact
files that are in my simplejson directory for 1.8.1 (except none of
my .py files have been compiled down to bytecode).

I tried to add the directory "/<somepath>/simplejson" to my sys.path
in the interpreter, hoping that the call to import simplejson would
work if the dir was there, even though simplejson.py did not exist is
that dir, but the encoder, decoder, jsonfilter and scanner .py files
were all there.

My problem is that the call "import simplejson" fails. How can I make
that call work?

Thanks in advance.

--
http://mail.python.org/mailman/listinfo/python-list


gagsl-py2 at yahoo

Mar 29, 2008, 6:39 PM

Post #8 of 12 (13682 views)
Permalink
Re: Installing simplejson issues [In reply to]

En Sat, 29 Mar 2008 19:45:09 -0300, Diez B. Roggisch <deets [at] nospam>
escribió:

>> I suggest that you remove the simplejson-xxxxxx.egg file and delete the
>> simplejson entry in easy-install.pth (both in your site-packages
>> directory)
>> Then extract the simplejson directory from inside the original .tar.gz
>> archive into your site-packages directory (so you end up by example with
>> a .../site-packages/simplejson/decoder.py file, among others)
>> That appears to be enough; import simplejson worked fine for me.
>>
>> I hate those f****ng eggs. Ah, and I hate easy_install too.
>
> This has nothing to do with setuptools or easy_install per se. The
> author of simplejson tried to create a library that works with or
> without a C-extension. And failed.

I think that the whole approach is doomed to fail; trying to do things
more complicated that they should be.
The pure-python part of simplejson is just a package. Copying the
directory into site-packages is *ALL* that is required; distutils can do
that perfectly. That's all folks!. A database or registry keeping track of
installed product versions might be useful, too. Anything that does much
more than that is just looking for problems; simple systems work better
than complex ones.
In this case, there is no need to create an egg, no need to play with .pth
files, no need to slow down the package at import time (eggs must be
decompressed), no need to extend sys.path and slow down *all* other
imports. I don't feel that anything is better by using eggs or
easy_install, and at least for me, they always have given more problems
than answers.
So, again, I hate eggs and easy_install. And I hate eggplants too.

--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list


gagsl-py2 at yahoo

Mar 29, 2008, 6:42 PM

Post #9 of 12 (13683 views)
Permalink
Re: Installing simplejson issues [In reply to]

En Sat, 29 Mar 2008 20:54:36 -0300, <blwatson [at] gmail> escribió:

> I tried to add the directory "/<somepath>/simplejson" to my sys.path
> in the interpreter, hoping that the call to import simplejson would
> work if the dir was there, even though simplejson.py did not exist is
> that dir, but the encoder, decoder, jsonfilter and scanner .py files
> were all there.
>
> My problem is that the call "import simplejson" fails. How can I make
> that call work?

simplejson is a package (a directory with an __init__.py), not a module;
don't look for simplejson.py
Its *parent* directory must be in sys.path for Python to find it. Try
copying the simplejson directory below site-packages (which should be
already in sys.path)

--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list


blwatson at gmail

Mar 29, 2008, 8:39 PM

Post #10 of 12 (13681 views)
Permalink
Re: Installing simplejson issues [In reply to]

On Mar 29, 6:42 pm, "Gabriel Genellina" <gagsl-...@yahoo.com.ar>
wrote:
> En Sat, 29 Mar 2008 20:54:36 -0300, <blwat...@gmail.com> escribió:
>
> > I tried to add the directory "/<somepath>/simplejson" to my sys.path
> > in the interpreter, hoping that the call to import simplejson would
> > work if the dir was there, even though simplejson.py did not exist is
> > that dir, but the encoder, decoder, jsonfilter and scanner .py files
> > were all there.
>
> > My problem is that the call "import simplejson" fails.  How can I make
> > that call work?
>
> simplejson is a package (a directory with an __init__.py), not a module;  
> don't look for simplejson.py
> Its *parent* directory must be in sys.path for Python to find it. Try  
> copying the simplejson directory below site-packages (which should be  
> already in sys.path)
>
> --
> Gabriel Genellina

Gabriel -

First, thanks for the help. You have solved one problem but created a
new one. Isn't that always how it works?

So I copied over the dir, and now I get this error when trying to
import simplejson:

<being error>
The following error occurred while trying to extract file(s) to the
Python egg
cache:

[Errno 13] Permission denied: '/Users/bwatson/.python-eggs/
simplejson-1.8.1-py2.5-macosx-10.3-fat.egg-tmp/simplejson/tmpJVSqa_.
$extract'

The Python egg cache directory is currently set to:

/Users/bwatson/.python-eggs

Perhaps your account does not have write access to this directory?
You can
change the cache directory by setting the PYTHON_EGG_CACHE environment
variable to point to an accessible directory.
<end error>

So I went looking for that egg...the following exists in my frameworks
dir:

simplejson-1.8.1-py2.5-macosx-10.3-fat.egg

I hate eggs...I am stuck again. Any ideas?
--
http://mail.python.org/mailman/listinfo/python-list


gagsl-py2 at yahoo

Mar 29, 2008, 8:53 PM

Post #11 of 12 (13680 views)
Permalink
Re: Installing simplejson issues [In reply to]

En Sun, 30 Mar 2008 00:39:58 -0300, <blwatson [at] gmail> escribió:

> First, thanks for the help. You have solved one problem but created a
> new one. Isn't that always how it works?

Ouch - yes, sometimes :(

> So I copied over the dir, and now I get this error when trying to
> import simplejson:
>
> <being error>
> The following error occurred while trying to extract file(s) to the
> Python egg
> cache:[error messages snipped]
> So I went looking for that egg...the following exists in my frameworks
> dir:
>
> simplejson-1.8.1-py2.5-macosx-10.3-fat.egg
>
> I hate eggs...I am stuck again. Any ideas?

I'd remove the egg and all references to it from easy_install.pth, and use
the simplejson directory from the source distribution (.tar.gz), as I
suggested on a previous message.


--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list


blwatson at gmail

Mar 29, 2008, 9:48 PM

Post #12 of 12 (13675 views)
Permalink
Re: Installing simplejson issues [In reply to]

Rock and roll baby!!! Thanks so much. It took some doing, but many
thanks!!!!
--
http://mail.python.org/mailman/listinfo/python-list

Python python RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.