Problems getting SQLPython to run

13 views
Skip to first unread message

Andy Todd

unread,
Oct 1, 2009, 7:17:23 AM10/1/09
to SQL Python, Catherine Devlin
All,

I'm trying to run SQLPython from a Mercurial checkout on my Ubuntu
virtual machine. I've followed the instructions on
http://packages.python.org/sqlpython/intro.html#installation to install
from the development and everything seems to install and set up
correctly. But when I try and run SQLPython I get an exception;

"""
andy47@ubuntu-db:~/Work/src/sqlpython$ sqlpython andy47/********
/bin/sh: xclip: not found
/usr/bin/vim
/var/lib/python-support/python2.6/sqlalchemy/util.py:7:
DeprecationWarning: the sets module is deprecated
import inspect, itertools, new, operator, sets, sys, warnings, weakref

MySqlPy V1.6.3 - 'sqlplus in python'
Author: Luca....@cern.ch
Rev: 1.6.3, 30-Mar-09

Companion of SqlPython, a python module that reproduces Oracle's command
line within python
and sqlpyPlus. Major contributions by Catherine Devlin,
http://catherinedevlin.blogspot.com

Usage: sqlpython [connect string] [single-word command] ["multi-word
command"]...

Quick start command list:

- top -> executes a query to list all active sessions in (Oracle 10g
and RAC)
(use: instance activity monitoring, a DBA tool)
- tselect -> prints the result set in trasposed form, useful to print
result sets with
many columns such as dba_ or v$ views (ex: dba_tables or
v$instance)
- py -> execute a python command (C.D.)
- db -> quick connect using credentials in pass.txt file
(Ex: write username and pass in pass.txt and then "db
db_alias" to connect)
- sql -> prints the sql text from the cache. parameter: sql_id of
the statement
(Ex: sql fzqa1qj65nagki)
- explain -> prints the execution plan from the cache. parameter: sql_id
of the statement
- sessinfo-> prints session information. 1 parameter sid (Ex: sql 101
print info for sid 101)
- longops -> prints from gv$session_longops (running full scans, etc)
- load -> prints the OS load on all cluster nodes (10g RAC)
- sleect,slect -> alias for select (I mistyped select this way too many
times...)
- top9i -> 9i (and single instance) version of top
- describe, @, !, spool, show, set, list, get, write -> sql*plus-like,
from sqlpyPlus (C.D.)
- shortcuts: \c (connect), \d (describe), etc, from sqlpyPlus (C.D.)
- :myvarname = xx, set autobind 1, print -> bind variables management
extension, to sqlplus (C.D.)

Example:
SQL> connect username@dbalias or username/pass@dbalias
SQL> select sysdate from dual;
SQL> exit

Traceback (most recent call last):
File "/usr/local/bin/sqlpython", line 8, in <module>
load_entry_point('sqlpython==1.7.0', 'console_scripts', 'sqlpython')()
File "/mnt/hgfs/andy47_mac/Work/src/sqlpython/sqlpython/mysqlpy.py",
line 196, in run
my.do_connect(connectstring)
File
"/usr/local/lib/python2.6/dist-packages/cmd2-0.5.5-py2.6.egg/cmd2.py",
line 93, in newFunc
File
"/mnt/hgfs/andy47_mac/Work/src/sqlpython/sqlpython/sqlpython.py", line
148, in do_connect
except sqlalchemy.exc.ArgumentError, e:
AttributeError: 'module' object has no attribute 'exc'
"""

Any ideas what I am doing wrong?

Regards,
Andy
--
From the desk of Andrew J Todd esq - http://www.halfcooked.com/

Reply all
Reply to author
Forward
0 new messages