SOLVED !
use:
sudo pip install pytz

and not
pip install pytz


if you install pytz using pip without sudo , it will be installed for the 
login user and will be inaccessible from uwsgi/nginx
Example:
yourname@yourserver:~$pip install pytz

will install it in

 /home/yourname/.local/lib/python2.7/site-packages/pytz/

you can check it by starting python, importing pytz and then typing pytz. 
This will show the complete path of the library.

>>>import pytz
>>> pytz
<module 'pytz' from 
'/home/yourname/.local/lib/python2.7/site-packages/pytz/__init__.pyc'>
>>>
while installing it with
sudo pip install pytz

will install it in :
<module 'pytz' from 
'/usr/local/lib/python2.7/dist-packages/pytz/__init__.pyc'>




On Thursday, November 30, 2017 at 8:18:35 PM UTC+1, icodk wrote:
>
> What I did:
>
> added
> import pytz
>
> in db.py in the welcome application 
>
> The error:
> <type 'exceptions.ImportError'> (ImportError("Cannot import module 
> 'applications.welcome.modules.pytz'",), <traceback object at 0
> x7fc194275bd8>)
>
> Environment:
> 2.16.1-stable+timestamp.2017.11.14.05.54.25
> (Running on nginx/1.12.1, Python 2.7.14)
>
> fresh web2py installation on Ubuntu 17.10 using the 
> script: setup-web2py-nginx-uwsgi-ubuntu.sh
>
> python version in terminal:
>
> Python 2.7.14 (default, Sep 23 2017, 22:06:14)
> [GCC 7.2.0] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>>
>
>
> Any idea ?
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to