[web2py] Re: pymongo is installed but I get this error: no driver available ('pymongo',)
Should I create a sudoer user = www-data with all root priveleges in my Ubuntu machine? Would that fix the pymongo not found and the permission problems when running web2py with nginx server? Thanks On Tuesday, May 20, 2014 11:11:07 PM UTC-6, Cynthia Butler wrote: Finally - It works if I run web2py's python shell as sudo: I thought my nginx was set up as user = www-data. I am confused by /locations/users/permissions in my nginx server set up and web2py file locations/users/permissions. Can you help me understand? -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: pymongo is installed but I get this error: no driver available ('pymongo',)
Does the sys.path looks right to you? It does if the pymongo driver is installed at one of the folders listed. As you have described in late posts, you seem to have an issue with directory permissions. I belive that running web2py with root permissions can solve it. -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: pymongo is installed but I get this error: no driver available ('pymongo',)
Solved - it depends on how I start/restart web2py with the nginx server (on ubuntu machine) Wrong - Don't do this:sudo /etc/init.d/nginx start Correct - DO THIS WAY:touch/etc/uwsgi/web2py.ini I had forgotten this. I found it by looking at the last 4 lines of the /scripts/setup-web2py-nginx-uwsgi-ubuntu.sh file: ## you can reload uwsgi with # restart uwsgi-emperor ## and stop it with # stop uwsgi-emperor ## to reload web2py only (without restarting uwsgi) # touch /etc/uwsgi/web2py.ini I will never forget it now I am happily running web2py with mongodb, ngninx and uwsgi (so far). It's tough to be a noob on so many things at the same time Thanks Massimo and Alan for giving enough hints to keep me going - I have learned so much -- THANK YOU! Cindy On Wednesday, May 21, 2014 5:10:02 AM UTC-6, Alan Etkin wrote: Does the sys.path looks right to you? It does if the pymongo driver is installed at one of the folders listed. As you have described in late posts, you seem to have an issue with directory permissions. I belive that running web2py with root permissions can solve it. -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: pymongo is installed but I get this error: no driver available ('pymongo',)
If you open a python shell can you do import pymongo does it work? If python can find it web2py can find it, unless you have two python versions installed. On Sunday, 18 May 2014 12:58:22 UTC-5, Cynthia Butler wrote: By the way I tried installing pymongo two ways: 1) easy_install which put the pymongo .so files in my home/cindy/ folder which I assumed web2py couldn't find (since web2py is in home/www-data/ ). So I uninstalled that. 2) sudo pip which put all the unzipped pymongo files in the /usr/local/lib/python2.7/dist-packages/ folder with root:staff ownership and everyone r privileges. There is a /usr/local/lib/python2.7/site-packages/ folder but nothing is in it. Should I move the pymongo files from the /dist-packages folder into the /site-pckages folder? Would that help web2py to find pymongo? Thanks very much! On Saturday, May 17, 2014 7:43:51 PM UTC-6, Cynthia Butler wrote: I am trying to use MongoDB 2.6.1 and pymongo 2.7 with the DAL on my local ubuntu 14.04 machine. I have followed instructions in Alan's slice but web2py is not able to find the pymongo driver. It works ok from the python shell and the mongo shell also works. My guess is that I don't have something configured correctly or don't have the correct permissions/location. I have spent 2 days researching/trying to fix but cannot figure it out and now the web2py internal python shell is broken. How do I get mongodb and pymongo working? (I'm a noobie). Thanks! [web2py 2.9.5-stable+timestamp.2014.03.16.02.35.39, (Running on nginx/1.6.0, Python 2.7.6)] Traceback (most recent call last): File /home/www-data/web2py/gluon/restricted.py, line 220, in restricted exec ccode in environment File /home/www-data/web2py/applications/seagull/models/db.py https://localhost/admin/default/edit/seagull/models/db.py, line 16, in module datab = DAL(mongodb://127.0.0.1:27017/test_database, check_reserved=[mongodb_nonreserved], adapter_args={safe:False}) File /home/www-data/web2py/gluon/dal.py, line 7867, in __init__ raise RuntimeError(Failure to connect, tried %d times:\n%s % (attempts, tb)) RuntimeError: Failure to connect, tried 5 times: Traceback (most recent call last): File /home/www-data/web2py/gluon/dal.py, line 7845, in __init__ self._adapter = ADAPTERS[self._dbname](**kwargs) File /home/www-data/web2py/gluon/dal.py, line 688, in __call__ obj = super(AdapterMeta, cls).__call__(*args, **kwargs) File /home/www-data/web2py/gluon/dal.py, line 5584, in __init__ if do_connect: self.find_driver(adapter_args) File /home/www-data/web2py/gluon/dal.py, line 830, in find_driver raise RuntimeError(no driver available %s % str(self.drivers)) RuntimeError: no driver available ('pymongo',) -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: pymongo is installed but I get this error: no driver available ('pymongo',)
2) sudo pip which put all the unzipped pymongo files in the /usr/local/lib/python2.7/dist-packages/ folder with root:staff ownership and everyone r privileges. Odd, this should make the driver available for web2py. For debugging, perhaps you can check that the driver folder is included in sys.path when web2py runs. Make a simple controller to output sys.path (or else use the logging package): def showpath(): import sys return str(sys.path) -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: pymongo is installed but I get this error: no driver available ('pymongo',)
Does the sys.path looks right to you? In [10] : showpath() ['', '/home/www-data/web2py/gluon', '/home/www-data/web2py/site-packages', '/home/www-data/web2py', '.', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PILcompat', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/python2.7/dist-packages/ubuntu-sso-client'] On Tuesday, May 20, 2014 4:28:17 AM UTC-6, Alan Etkin wrote: 2) sudo pip which put all the unzipped pymongo files in the /usr/local/lib/python2.7/dist-packages/ folder with root:staff ownership and everyone r privileges. Odd, this should make the driver available for web2py. For debugging, perhaps you can check that the driver folder is included in sys.path when web2py runs. Make a simple controller to output sys.path (or else use the logging package): def showpath(): import sys return str(sys.path) -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: pymongo is installed but I get this error: no driver available ('pymongo',)
Can you try the web2py shell? $ python web2py.py -S welcome -P import pymongo On Tuesday, 20 May 2014 06:01:16 UTC-5, Cynthia Butler wrote: Does the sys.path looks right to you? In [10] : showpath() ['', '/home/www-data/web2py/gluon', '/home/www-data/web2py/site-packages', '/home/www-data/web2py', '.', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PILcompat', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/python2.7/dist-packages/ubuntu-sso-client'] On Tuesday, May 20, 2014 4:28:17 AM UTC-6, Alan Etkin wrote: 2) sudo pip which put all the unzipped pymongo files in the /usr/local/lib/python2.7/dist-packages/ folder with root:staff ownership and everyone r privileges. Odd, this should make the driver available for web2py. For debugging, perhaps you can check that the driver folder is included in sys.path when web2py runs. Make a simple controller to output sys.path (or else use the logging package): def showpath(): import sys return str(sys.path) -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: pymongo is installed but I get this error: no driver available ('pymongo',)
I already did try the web2py shell and copied the output in my previous reply. You might need to scroll down to see it or click to see the 'trimmed output. I can import pymongo, but I can't connect to the database. Thanks On Tuesday, May 20, 2014 7:29:41 AM UTC-6, Massimo Di Pierro wrote: Can you try the web2py shell? $ python web2py.py -S welcome -P import pymongo -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: pymongo is installed but I get this error: no driver available ('pymongo',)
oops, I didn't see the command you wanted me to try-- here it is: looks like there is a problem with my permissions. How to fix this? cindy@cindy-HP64bit:/home/www-data/web2py$ python web2py.py -S welcome -P web2py Web Framework Created by Massimo Di Pierro, Copyright 2007-2014 Version 2.9.5-stable+timestamp.2014.03.16.02.35.39 Database drivers available: SQLite(sqlite3), MySQL(pymysql), PostgreSQL( pg8000), MongoDB(pymongo), IMAP(imaplib) Traceback (most recent call last): File web2py.py, line 33, in module gluon.widget.start(cron=True) File /home/www-data/web2py/gluon/widget.py, line 1105, in start cronjob=options.cronjob) File /home/www-data/web2py/gluon/shell.py, line 320, in run enable_autocomplete_and_history(adir,_env) File /home/www-data/web2py/gluon/shell.py, line 48, inenable_autocomplete_and_history open(history_file, 'a').close() IOError: [Errno 13] Permission denied: 'applications/welcome/.pythonhistory' On Tuesday, May 20, 2014 7:29:41 AM UTC-6, Massimo Di Pierro wrote: Can you try the web2py shell? $ python web2py.py -S welcome -P import pymongo -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: pymongo is installed but I get this error: no driver available ('pymongo',)
Here is the owners/permissions for the web2py dir. How to fix? cindy@cindy-HP64bit:/home/www-data/web2py$ ls -la total 536 drwxr-xr-x 11 www-data www-data 4096 May 7 15:12 . drwxr-xr-x 3 root root 4096 May 7 14:51 .. -rw-rw-r-- 1 www-data www-data 12802 Mar 16 02:35 anyserver.py drwxr-xr-x 6 www-data www-data 4096 May 7 15:12 applications -rw-rw-r-- 1 www-data www-data 59151 Mar 16 02:35 CHANGELOG drwxr-xr-x 2 www-data www-data 4096 Apr 24 20:53 deposit drwxr-xr-x 2 www-data www-data 4096 Apr 26 00:25 examples drwxr-xr-x 5 www-data www-data 4096 Apr 24 17:55 extras drwxr-xr-x 4 www-data www-data 4096 May 7 15:13 gluon drwxr-xr-x 2 www-data www-data 4096 Apr 26 00:25 handlers -rw-r--r-- 1 www-data www-data 149335 May 17 19:33 httpserver.log -rw-rw-r-- 1 www-data www-data 6826 Mar 16 02:35 LICENSE drwxr-xr-x 2 www-data www-data 4096 Apr 24 20:53 logs -rw-rw-r-- 1 www-data www-data 24 Mar 16 02:35 MANIFEST.in -rw-r--r-- 1 root root 92 May 1 15:58 parameters_443.py -rw-r--r-- 1 www-data www-data 92 May 7 14:55 parameters_8000.py -rw-r--r-- 1 www-data www-data 14 May 1 16:06 parameters_8001.py -rw-r--r-- 1 www-data www-data 92 May 7 14:56 parameters_8333.py -rw-rw-r-- 1 www-data www-data 2322 Mar 16 02:35 README.markdown drwxr-xr-x 2 www-data www-data 4096 Apr 26 03:14 scripts drwxr-xr-x 2 www-data www-data 4096 Apr 26 00:25 site-packages -rw-rw-r-- 1 www-data www-data 51 Mar 16 02:35 VERSION -rwxrwxr-x 1 www-data www-data914 Mar 16 02:35 web2py.py -rw-r--r-- 1 www-data www-data 221006 Apr 26 04:04 welcome.w2p -rw-rw-r-- 1 www-data www-data 1128 Mar 16 02:35 wsgihandler.py -rw-r--r-- 1 www-data www-data 1264 Apr 26 00:25 wsgihandler.pyc -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: pymongo is installed but I get this error: no driver available ('pymongo',)
Finally - It works if I run web2py's python shell as sudo: I thought my nginx was set up as user = www-data. I am confused by /locations/users/permissions in my nginx server set up and web2py file locations/users/permissions. Can you help me understand? cindy@cindy-HP64bit:/home/www-data/web2py$ sudo python web2py.py -S welcome -P web2py Web Framework Created by Massimo Di Pierro, Copyright 2007-2014 Version 2.9.5-stable+timestamp.2014.03.16.02.35.39 Database drivers available: SQLite(sqlite3), MySQL(pymysql), PostgreSQL( pg8000), MongoDB(pymongo), IMAP(imaplib) Python 2.7.6 (default, Mar 22 2014, 22:59:56) [GCC 4.8.2] on linux2 Type help, copyright, credits or license for more information. (InteractiveConsole) dba = DAL('mongodb://web2pyUser:web2pyPwd@localhost:27017/mydb') print dba._uri mongodb://web2pyUser:web2pyPwd@localhost:27017/mydb print dba._dbname mongodb -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: pymongo is installed but I get this error: no driver available ('pymongo',)
I restarted the nginx webserver and got the internal web2py python shell working again. Still don't know how to get web2py to find pymongo. Any hints? On Saturday, May 17, 2014 7:43:51 PM UTC-6, Cynthia Butler wrote: I am trying to use MongoDB 2.6.1 and pymongo 2.7 with the DAL on my local ubuntu 14.04 machine. I have followed instructions in Alan's slice but web2py is not able to find the pymongo driver. It works ok from the python shell and the mongo shell also works. My guess is that I don't have something configured correctly or don't have the correct permissions/location. I have spent 2 days researching/trying to fix but cannot figure it out and now the web2py internal python shell is broken. How do I get mongodb and pymongo working? (I'm a noobie). Thanks! [web2py 2.9.5-stable+timestamp.2014.03.16.02.35.39, (Running on nginx/1.6.0, Python 2.7.6)] Traceback (most recent call last): File /home/www-data/web2py/gluon/restricted.py, line 220, in restricted exec ccode in environment File /home/www-data/web2py/applications/seagull/models/db.py https://localhost/admin/default/edit/seagull/models/db.py, line 16, in module datab = DAL(mongodb://127.0.0.1:27017/test_database, check_reserved=[mongodb_nonreserved], adapter_args={safe:False}) File /home/www-data/web2py/gluon/dal.py, line 7867, in __init__ raise RuntimeError(Failure to connect, tried %d times:\n%s % (attempts, tb)) RuntimeError: Failure to connect, tried 5 times: Traceback (most recent call last): File /home/www-data/web2py/gluon/dal.py, line 7845, in __init__ self._adapter = ADAPTERS[self._dbname](**kwargs) File /home/www-data/web2py/gluon/dal.py, line 688, in __call__ obj = super(AdapterMeta, cls).__call__(*args, **kwargs) File /home/www-data/web2py/gluon/dal.py, line 5584, in __init__ if do_connect: self.find_driver(adapter_args) File /home/www-data/web2py/gluon/dal.py, line 830, in find_driver raise RuntimeError(no driver available %s % str(self.drivers)) RuntimeError: no driver available ('pymongo',) -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: pymongo is installed but I get this error: no driver available ('pymongo',)
By the way I tried installing pymongo two ways: 1) easy_install which put the pymongo .so files in my home/cindy/ folder which I assumed web2py couldn't find (since web2py is in home/www-data/ ). So I uninstalled that. 2) sudo pip which put all the unzipped pymongo files in the /usr/local/lib/python2.7/dist-packages/ folder with root:staff ownership and everyone r privileges. There is a /usr/local/lib/python2.7/site-packages/ folder but nothing is in it. Should I move the pymongo files from the /dist-packages folder into the /site-pckages folder? Would that help web2py to find pymongo? Thanks very much! On Saturday, May 17, 2014 7:43:51 PM UTC-6, Cynthia Butler wrote: I am trying to use MongoDB 2.6.1 and pymongo 2.7 with the DAL on my local ubuntu 14.04 machine. I have followed instructions in Alan's slice but web2py is not able to find the pymongo driver. It works ok from the python shell and the mongo shell also works. My guess is that I don't have something configured correctly or don't have the correct permissions/location. I have spent 2 days researching/trying to fix but cannot figure it out and now the web2py internal python shell is broken. How do I get mongodb and pymongo working? (I'm a noobie). Thanks! [web2py 2.9.5-stable+timestamp.2014.03.16.02.35.39, (Running on nginx/1.6.0, Python 2.7.6)] Traceback (most recent call last): File /home/www-data/web2py/gluon/restricted.py, line 220, in restricted exec ccode in environment File /home/www-data/web2py/applications/seagull/models/db.py https://localhost/admin/default/edit/seagull/models/db.py, line 16, in module datab = DAL(mongodb://127.0.0.1:27017/test_database, check_reserved=[mongodb_nonreserved], adapter_args={safe:False}) File /home/www-data/web2py/gluon/dal.py, line 7867, in __init__ raise RuntimeError(Failure to connect, tried %d times:\n%s % (attempts, tb)) RuntimeError: Failure to connect, tried 5 times: Traceback (most recent call last): File /home/www-data/web2py/gluon/dal.py, line 7845, in __init__ self._adapter = ADAPTERS[self._dbname](**kwargs) File /home/www-data/web2py/gluon/dal.py, line 688, in __call__ obj = super(AdapterMeta, cls).__call__(*args, **kwargs) File /home/www-data/web2py/gluon/dal.py, line 5584, in __init__ if do_connect: self.find_driver(adapter_args) File /home/www-data/web2py/gluon/dal.py, line 830, in find_driver raise RuntimeError(no driver available %s % str(self.drivers)) RuntimeError: no driver available ('pymongo',) -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.