See below:

On Sunday, January 5, 2014 12:32:26 PM UTC-8, mweissen wrote:
>
>
> I want to change from sqlite to postgresql.
>
> At first I have installed postgresql and prepared everything as described 
> in the book. Next I have built a sample application
>  with a line like
>
> db1 = DAL("postgres://web2py:web2py123@localhost:5432/securedb")
>
> Works fine!
>
> Now I have tried cpdb ( I have broken the lines for better readablity):
>
> root@test:/home/www-data/web2py# python scripts/cpdb.py  
>     -f applications/postgesql_test/databases 
>     -y sqlite://storage.sqlite 
>     -Y postgres://web2py:web2py123@localhost:5432/securedb 
>     -d gluon/ 
>     -t False
>
> The result is an error message:
>
> EXCEPTION: could not make a copy of the database
> Failure to connect, tried 5 times:
> Traceback (most recent call last):
>   File "gluon/dal.py", line 7766, in __init__
>     self._adapter = ADAPTERS[self._dbname](**kwargs)
>   File "gluon/dal.py", line 2756, in __init__
>     if do_connect: self.find_driver(adapter_args,uri)
>   File "gluon/dal.py", line 795, in find_driver
>     raise RuntimeError("no driver available %s" % str(self.drivers))
> RuntimeError: no driver available ('psycopg2', 'pg8000')
>
> Next try - a copy from sqlite to sqlite
>
> root@test:/home/www-data/web2py# python scripts/cpdb.py
>    -f applications/postgresql_test/databases 
>    -y sqlite://storage.sqlite 
>    -Y sqlite://storage2.sqlite 
>    -F applications/postgresql_test/databases 
>    -d gluon/ -t False
>
> creating tables...
> exporting data...
> importing data...
> done!
>
> Ok, no problem - cpdb works.
> And now the interactive version:
>
> root@test:/home/www-data/web2py# python scripts/cpdb.py  
>    -f applications/postgresql_test/databases 
>    -y sqlite://storage.sqlite 
>    -Y postgres://web2py:web2py123@localhost:5432/securedb 
>    -d gluon/ -t False -i
>
> >>> t=DAL("postgres://web2yp:web2py123@localhost:5432/securedb", 
> folder=None)
> sorry, can not do that!
> Failure to connect, tried 5 times:
> Traceback (most recent call last):
>   File "gluon/dal.py", line 7766, in __init__
>     self._adapter = ADAPTERS[self._dbname](**kwargs)
>   File "gluon/dal.py", line 2756, in __init__
>     if do_connect: self.find_driver(adapter_args,uri)
>   File "gluon/dal.py", line 795, in find_driver
>     raise RuntimeError("no driver available %s" % str(self.drivers))
> RuntimeError: no driver available ('psycopg2', 'pg8000')
>
>
> I have tried DAL calls like DAL("postgres:psycopg2:") and 
> DAL("postgres:pg8000:") - similar results.
>
>
Did you copy the driver  into the working directory?  Recent versions of 
web2py ship with the handlers in a subdirectory (web2py/handlers), so they 
don't clobber any changes you made the last time you set them up.

/dps

 

-- 
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/groups/opt_out.

Reply via email to