Domanda

I am learning Pyramid and following the Tasks tutorial. When I run the tasks.py, I am getting the following error "ImportError: No module named 'pyramid_mako'"

I have my pyramid installed in the following location also the virtual environment in Users/my_name/env/bin/python also there is pyton2.7 in usr/local/lib/bin/python

I installed the Mako template using pip install Mako and it get installed in the usr/local/lib/bin/python2.7/site-packages.

Now I am not sure from where and how to run the tasks.py. I tried running it usr/local/lib/bin/python and it gives me error that "ImportError: No module named pyramid.config " because my python environment is in /Users/my_name/env/bin/ (Ref: Why am I getting an ImportError when I try to run Pyramid?)

it keeps looking for Mako template in /Users/my_name/env/lib/python2.7/site-packages And i also moved the Mako folders to that location from usr/local/lib/bin/python2.7/site-packages still it wasn't working.

Can you guys help me how to install Mako template on the python environment and run that application.

Thanks

È stato utile?

Soluzione

install Mako template on virtual environment and run that application

Users/my_name/env/bin/easy_install pyramid_mako
Users/my_name/env/bin/python tasks.py

you should try virtualenvwrapper

easy_install virtualenvwrapper
source /usr/local/bin/virtualenvwrapper.sh
mkvirtualenv [env1]
workon [env]
deactivate
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top