Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why am I getting DistributionNotFound error when I try to run Pyramid project?

Tags:

python

pyramid

I installed in my new Windows 8 (x64):

  • python-2.7
  • pywin32-218.win32-py2.7
  • setuptools-0.6c11.win32-py2.7
  • and pyramid (via easy_install)

I tried to run my pyramid project:

pserve I:\Projects\PyramidProject\development.ini

and pkg_resources.DistributionNotFound(req) was raised:

traceback

 I:\Projects\MyProject>pserve development.ini Traceback (most recent
 call last):   File "C:\Python27\Scripts\pserve-script.py", line 9, in
 <module>
     load_entry_point('pyramid==1.4b1', 'console_scripts', 'pserve')()   File
 "C:\Python27\lib\site-packages\pyramid-1.4b1-py2.7.egg\pyramid\scripts\ps
 erve.py", line 50, in main
     return command.run()   File "C:\Python27\lib\site-packages\pyramid-1.4b1-py2.7.egg\pyramid\scripts\ps
 erve.py", line 301, in run
     relative_to=base, global_conf=vars)   File "C:\Python27\lib\site-packages\pyramid-1.4b1-py2.7.egg\pyramid\scripts\ps
 erve.py", line 332, in loadserver
     server_spec, name=name, relative_to=relative_to, **kw)   File "C:\Python27\lib\site-packages\pastedeploy-1.5.0-py2.7.egg\paste\deploy\l
 oadwsgi.py", line 255, in loadserver
     return loadobj(SERVER, uri, name=name, **kw)   File "C:\Python27\lib\site-packages\pastedeploy-1.5.0-py2.7.egg\paste\deploy\l
 oadwsgi.py", line 271, in loadobj
     global_conf=global_conf)   File "C:\Python27\lib\site-packages\pastedeploy-1.5.0-py2.7.egg\paste\deploy\l
 oadwsgi.py", line 296, in loadcontext
     global_conf=global_conf)   File "C:\Python27\lib\site-packages\pastedeploy-1.5.0-py2.7.egg\paste\deploy\l
 oadwsgi.py", line 320, in _loadconfig
     return loader.get_context(object_type, name, global_conf)   File "C:\Python27\lib\site-packages\pastedeploy-1.5.0-py2.7.egg\paste\deploy\l
 oadwsgi.py", line 454, in get_context
     section)   File "C:\Python27\lib\site-packages\pastedeploy-1.5.0-py2.7.egg\paste\deploy\l
 oadwsgi.py", line 476, in _context_from_use
     object_type, name=use, global_conf=global_conf)   File "C:\Python27\lib\site-packages\pastedeploy-1.5.0-py2.7.egg\paste\deploy\l
 oadwsgi.py", line 406, in get_context
     global_conf=global_conf)   File "C:\Python27\lib\site-packages\pastedeploy-1.5.0-py2.7.egg\paste\deploy\l
 oadwsgi.py", line 296, in loadcontext
     global_conf=global_conf)   File "C:\Python27\lib\site-packages\pastedeploy-1.5.0-py2.7.egg\paste\deploy\l
 oadwsgi.py", line 328, in _loadegg
     return loader.get_context(object_type, name, global_conf)   File "C:\Python27\lib\site-packages\pastedeploy-1.5.0-py2.7.egg\paste\deploy\l
 oadwsgi.py", line 620, in get_context
     object_type, name=name)   File "C:\Python27\lib\site-packages\pastedeploy-1.5.0-py2.7.egg\paste\deploy\l
 oadwsgi.py", line 640, in find_egg_entry_point
     pkg_resources.require(self.spec)   File "C:\Python27\lib\site-packages\distribute-0.6.32-py2.7.egg\pkg_resources.
 py", line 690, in require
     needed = self.resolve(parse_requirements(requirements))   File "C:\Python27\lib\site-packages\distribute-0.6.32-py2.7.egg\pkg_resources.
 py", line 588, in resolve
     raise DistributionNotFound(req) pkg_resources.DistributionNotFound: Paste

my development.ini:

[app:MyProject]
use = egg:MyProject
pyramid.reload_all = true
pyramid.reload_templates = true
pyramid.reload_assets = true
pyramid.debug_all = false
pyramid.debug_authorization = false
pyramid.debug_notfound = false
pyramid.debug_routematch = false
pyramid.debug_templates = true
mako.directories = app:view
mako.module_directory = %(here)s/cache/templates/
#mako.cache_type = file
#mako.cache_enabled = False
#mako.cache_dir = %(here)s/cache/view/
#mako.cache_impl = beaker
#mako.cache_timeout = 60
mako.input_encoding = utf-8
mako.imports = from markupsafe import escape_silent
mako.default_filters = escape_silent
#mako.error_handler =
sqlalchemy.url = mysql://user:[email protected]/MyProject_dev?charset=utf8
sqlalchemy.pool_recycle = 3600
beaker.session.type = file
beaker.session.cookie_expires = True
beaker.session.cookie_domain = MyProject.pl
beaker.session.data_dir = %(here)s/data/sessions/data
beaker.session.lock_dir = %(here)s/data/sessions/lock
beaker.session.key = MyProject.pl
beaker.session.secret = 57b0d7ff4c665d87e3c3745c2abf519ca7d4082a
beaker.session.validate_key = 57b0d7ff
beaker.cache.enabled = True
beaker.cache.type = memory
beaker.cache.data_dir = %(here)s/cache/data
beaker.cache.lock_dir = %(here)s/cache/lock 
beaker.cache.regions = default_term, second_term, minute_term, hour_term, day_term, month_term, short_term, middle_term, long_term, 
beaker.cache.second_term.expire = 1
beaker.cache.minute_term.expire = 60
beaker.cache.hour_term.expire = 3600
beaker.cache.day_term.expire = 86400
beaker.cache.month_term.expire = 2678400
beaker.cache.default_term.expire = 60
beaker.cache.short_term.expire = 30
beaker.cache.middle_term.expire = 300
beaker.cache.long_term.expire = 86400
site.front.default_skin = MyProject
site.front.available_skins = default mobile MyProject
default_skin = MyProject
available_skins = default mobile MyProject

[filter:tm]
use = egg:repoze.tm2#tm
commit_veto = repoze.tm:default_commit_veto

[pipeline:main]
pipeline =
    egg:WebError#evalerror
    tm
    MyProject

[server:main]
use = egg:Paste#http
host = 127.0.0.1
port = 5000

# Begin logging configuration

[loggers]
keys = root, MyProject, sqlalchemy

[handlers]
keys = console

[formatters]
keys = generic

[logger_root]
level = INFO
handlers = console

[logger_MyProject]
level = DEBUG
handlers =
qualname = MyProject

[logger_sqlalchemy]
level = INFO
handlers =
qualname = sqlalchemy.engine
# "level = INFO" logs SQL queries.
# "level = DEBUG" logs SQL queries and results.
# "level = WARN" logs neither.  (Recommended for production systems.)

[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic

[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s

# End logging configuration

Have you any idea, what did I wrong?

like image 517
David Silva Avatar asked Dec 01 '12 11:12

David Silva


1 Answers

You need to run easy_install paste and python setup.py develop in your virtualenv.

On a side note, you are using a very old version of pyramid. I know this because your project uses weberror, repoze.tm2 and paste. If you have the time, I'd suggest you look into upgrading to some best practices.

like image 158
Michael Merickel Avatar answered Nov 09 '22 23:11

Michael Merickel