Mariusz,

Did you use pip?  See:
https://github.com/Pylons/pyramid/issues/1857#issuecomment-121414912

If you used easy_install, as the Quick Tutorial instructions say early on and why[1], and the problem still exists, then please submit a pull request.

[1] 
http://docs.pylonsproject.org/projects/pyramid/en/latest/quick_tutorial/requirements.html#install-pyramid

    Why easy_install and not pip? Pyramid encourages use of namespace
packages, for which pip's support is less-than-optimal. Also, Pyramid's dependencies use some optional C extensions for performance: with easy_install, Windows users can get these extensions without needing a C
    compiler (pip does not support installing binary Windows distributions,
    except for wheels, which are not yet available for all dependencies).

--steve


On 8/22/15 at 8:39 AM, [email protected] (Eric Hanchrow) pronounced:

I think Mariusz is trying to say: using a directory named "json" fools
Python into trying to load _that_ directory, rather than the stdlib "json"
module.

This is more or less the same problem that I described here:

http://stackoverflow.com/questions/28730964/why-does-my-import-requests-fail-with-
importerror-no-module-named-requests-p

On Sat, Aug 22, 2015 at 4:44 AM, Mariusz Szot <[email protected]> wrote:

Hi,

Please,
Change your directory name json, for example json_renderer,
json name, causes the python looking json dumps in the directory and not
site-packages.



http://docs.pylonsproject.org/projects/pyramid/en/latest/quick_tutorial/json.html


exc:
E
======================================================================
ERROR: Failure: AttributeError ('module' object has no attribute 'dumps')
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/ms/env/local/lib/python2.7/site-packages/nose/loader.py",
line 414, in loadTestsFromName
addr.filename, addr.module)
File "/home/ms/env/local/lib/python2.7/site-packages/nose/importer.py",
line 47, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/home/ms/env/local/lib/python2.7/site-packages/nose/importer.py",
line 94, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "/home/ms/PycharmProjects/test_pyramid/json/tutorial/__init__.py",
line 1, in <module>
from pyramid.config import Configurator
File

"/home/ms/env/local/lib/python2.7/site-packages/pyramid-1.5.1-py2.7.egg/pyramid/config/
__init__.py",
line 65, in <module>
from pyramid.config.rendering import RenderingConfiguratorMixin
File

"/home/ms/env/local/lib/python2.7/site-packages/pyramid-1.5.1-py2.7.egg/pyramid/config/
rendering.py",
line 7, in <module>
from pyramid import renderers
File

"/home/ms/env/local/lib/python2.7/site-packages/pyramid-1.5.1-py2.7.egg/pyramid/renderers.
py",
line 173, in <module>
class JSON(object):
File

"/home/ms/env/local/lib/python2.7/site-packages/pyramid-1.5.1-py2.7.egg/pyramid/renderers.
py",
line 221, in JSON
def __init__(self, serializer=json.dumps, adapters=(), **kw):
AttributeError: 'module' object has no attribute 'dumps'


Mariusz Szot

--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.



------------------------
Steve Piercy, Soquel, CA

--
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.

Reply via email to