pihentagy
pihentagy

Reputation: 6285

Pyramid install under Python 3.3 gives pkg_resources.DistributionNotFound: <myproject> under Windows

I have freshly installed Python 3.3 (x64) and PyWin32, and then did the following (mindeningyen-env is the directory of the virtualenv, mindeningyen is the name of the app):

distribute_setup.py
easy_install virtualenv
virtualenv --no-site-packages mindeningyen-env
cd mindeningyen-env
Scripts\activate
easy_install pyramid
pcreate -s alchemy mindeningyen
cd mindeningyen
setup.py develop
pip install waitress

And then I get the following trace:

(mindeningyen-env) D:\prg\mindeningyen-env\mindeningyen>pserve development.ini
Traceback (most recent call last):
  File "d:\prg\mindeningyen-env\Scripts\pserve-script.py", line 9, in <module>
    load_entry_point('pyramid==1.4', 'console_scripts', 'pserve')()
  File "d:\prg\mindeningyen-env\lib\site-packages\pyramid-1.4-py3.3.egg\pyramid\scripts\pserve.py", line 50, in main
    return command.run()
  File "d:\prg\mindeningyen-env\lib\site-packages\pyramid-1.4-py3.3.egg\pyramid\scripts\pserve.py", line 304, in run
    global_conf=vars)
  File "d:\prg\mindeningyen-env\lib\site-packages\pyramid-1.4-py3.3.egg\pyramid\scripts\pserve.py", line 328, in loadapp
    return loadapp(app_spec, name=name, relative_to=relative_to, **kw)
  File "d:\prg\mindeningyen-env\lib\site-packages\pastedeploy-1.5.0-py3.3.egg\paste\deploy\loadwsgi.py", line 247, in loadapp
    return loadobj(APP, uri, name=name, **kw)
  File "d:\prg\mindeningyen-env\lib\site-packages\pastedeploy-1.5.0-py3.3.egg\paste\deploy\loadwsgi.py", line 271, in loadobj
    global_conf=global_conf)
  File "d:\prg\mindeningyen-env\lib\site-packages\pastedeploy-1.5.0-py3.3.egg\paste\deploy\loadwsgi.py", line 296, in loadcontext
    global_conf=global_conf)
  File "d:\prg\mindeningyen-env\lib\site-packages\pastedeploy-1.5.0-py3.3.egg\paste\deploy\loadwsgi.py", line 320, in _loadconfig
    return loader.get_context(object_type, name, global_conf)
  File "d:\prg\mindeningyen-env\lib\site-packages\pastedeploy-1.5.0-py3.3.egg\paste\deploy\loadwsgi.py", line 454, in get_context
    section)
  File "d:\prg\mindeningyen-env\lib\site-packages\pastedeploy-1.5.0-py3.3.egg\paste\deploy\loadwsgi.py", line 476, in _context_from_use
    object_type, name=use, global_conf=global_conf)
  File "d:\prg\mindeningyen-env\lib\site-packages\pastedeploy-1.5.0-py3.3.egg\paste\deploy\loadwsgi.py", line 406, in get_context
    global_conf=global_conf)
  File "d:\prg\mindeningyen-env\lib\site-packages\pastedeploy-1.5.0-py3.3.egg\paste\deploy\loadwsgi.py", line 296, in loadcontext
    global_conf=global_conf)
  File "d:\prg\mindeningyen-env\lib\site-packages\pastedeploy-1.5.0-py3.3.egg\paste\deploy\loadwsgi.py", line 328, in _loadegg
    return loader.get_context(object_type, name, global_conf)
  File "d:\prg\mindeningyen-env\lib\site-packages\pastedeploy-1.5.0-py3.3.egg\paste\deploy\loadwsgi.py", line 620, in get_context
    object_type, name=name)
  File "d:\prg\mindeningyen-env\lib\site-packages\pastedeploy-1.5.0-py3.3.egg\paste\deploy\loadwsgi.py", line 640, in find_egg_entry_point
    pkg_resources.require(self.spec)
  File "d:\prg\mindeningyen-env\lib\site-packages\distribute-0.6.31-py3.3.egg\pkg_resources.py", line 706, in require
    needed = self.resolve(parse_requirements(requirements))
  File "d:\prg\mindeningyen-env\lib\site-packages\distribute-0.6.31-py3.3.egg\pkg_resources.py", line 604, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: mindeningyen

Any ideas why it doesn't find the project?

Upvotes: 2

Views: 1938

Answers (2)

pihentagy
pihentagy

Reputation: 6285

If using virtualenv (either installed, or python builtin), one shouldn't say things like setup.py develop, because that will use the python interpreter, which is found in registry. One should ensure the virtualenv is activated Scripts\activate, and after that every python run should use python, so, the correct form is:

python setup.py develop

Upvotes: 2

Martijn Pieters
Martijn Pieters

Reputation: 1121594

Using the new Python 3.3 native virtual env implementation, I can use Pyramid on Python 3.3 just fine:

python3.3 -m venv mindeningyen-env
cd mindeningyen-env/
source bin/activate 
curl -O http://python-distribute.org/distribute_setup.py
python distribute_setup.py 
bin/easy_install pyramid
bin/pcreate -s alchemy mindeningyen
cd mindeningyen
python setup.py develop
cd ..
bin/pserve mindeningyen/development.ini

Upvotes: 3

Related Questions