I have installed pyramid and successfully created a project, but when I try to add new packages to the setup.py requirements they always give me a pkg_resources.DistributionNotFound error.
The packages are installed, and this only happens if I try to install new packages after I run ../bin/python3.3 setup.py develop It doesn't matter what packages it is.
The only way I have solved (not really), is setting up a new virtual environment and installing the packages before I create the project and run setup.py develop.
Obviously I'm doing something wrong. Is there anything I need to do beside pip install the package? Is this some kind of pathing issue? I'm new to this so your help would be so very appreciated!
*Adding my installation process in case anyone happens to see something wrong with it. Also including my wsgi file.
Created a virtualenv
easy_install-3.3 env
Activated the virtualenv
source env/bin/activate
Installed pyramid
cd env
./bin/easy_install-3.3 pyramid
Created a project
./bin/pcreate -s starter myprojectname
Ran setup.py
cd myprojectname
../bin/python3.3 setup.py develop
At this point I get the following error: pkg_resources.DistributionNotFound: waitress
Installed Waitress
../bin/easy_install-3.3 waitress
Ran setup.py again (not sure if I should be doing this)
../bin/python3.3 setup.py develop
Still see the error
My .wsgi file contains the following (not sure if this is important to this question or not):
activate_this = "/home/account/env/bin/activate_this.py"
execfile(activate_this,dict(__file__=activate_this))
import os
import sys
path = '/home/account/env/lib/python3.3/site-packages'
if path not in sys.path:
sys.path.append(path)
from pyramid.paster import get_app
application = get_app('/home/account/env/myprojectname/production.ini', 'main')
Using Michael's suggestions above, I was able to solve his issue. I didn't even need to install any packages manually. Once everything was working, if I added a requirement to my setup.py file (which is created when you make a pyramid project) and ran pip install -e . again everything was installed perfectly. The problem was caused by how I was installing things. Here is my final process in case it helps any other newbies to pyramid:
Created a virtual environment
virtualenv-3.3 env
Activated the env
source env/bin/activate
Moved to environment directory
cd env
Installed pyramid
pip install pyramid
Created a project
./bin/pcreate -s starter myprojectname
Moved to my project directory
cd megaproject
Ran install
pip install -e .
updated my wsgi file with my env and project settings
reload the app and jumped for joy to see the lovely pyramid starter page
pip and setup.py develop
should not to be mixed. The latter uses easy_install which is not compatible with pip in the case of namespace packages (these are packages that are installed as subpackages of another parent, such as zope.sqlalchemy installing only the .sqlalchemy part of the full zope.* package). Namespace packages will cause problems between pip and easy_install. On the other hand, most other packages will work fine with whatever system you choose but it's better for you to be consistent.
Another thing to double check is that you are actually installing the packages into your virtualenv. You should be able to open the python cli in your virtualenv and import the package. If you can't, then it's probably not installed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With