on 2016 Feb 16 6:22 AM
I'm developing an html scraper and I want to write and rewrite the data obtained to a .db file using sqlanydb. I'm using Python3 and I've already downloaded SQL Anywhere 12. Importing sqlanydb library seems to work properly, but as soon as I implement the .connect(...) method the following error arises always, no matter on which path I specify the database:
File "example.py", line 30, in
databasefile="/blabla/data.db",
File "/usr/local/lib/python3.5/site-packages/sqlanydb.py", line 512, in connect
return Connection(args, kwargs)
File "/usr/local/lib/python3.5/site-packages/sqlanydb.py", line 528, in init
parent = Connection.cls_parent = Root("PYTHON")
File "/usr/local/lib/python3.5/site-packages/sqlanydb.py", line 454, in init
'libdbcapi_r.dylib')
File "/usr/local/lib/python3.5/site-packages/sqlanydb.py", line 446, in load_library
raise InterfaceError("Could not load dbcapi. Tried: " + ','.join(names))
TypeError: sequence item 0: expected str instance, NoneType found
Could please anyone help me out with this?
Thank you.
Request clarification before answering.
Volker is correct. Graeme's answer was the final answer but it was a little hard to find (without showing all responses) ... so I promoted it to an answer.
The gist of this is that various BDS/Unix/Linux/OSX shells have their own way to "source" (yes, the word 'source' is a verb and a command in Unix/Posix/BSD shells) so that cmd has to be supplied as a separate token.
For Bash and Bourne sh the source cmd is a single '.' so one must type the 'dot' followed by a space and then your path ('./' for example) and then the file to execute as in:
`. ./sa_config.sh`
and for some other shells related to the 'C'-shell (csh) the source cmd is the word source as in
`source ./sa_config.csh`
I beleive the default for Mac OSX is the Bash shell so I would start by trying the first example; with a space.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Okay guys, I solved it. The problem finally was that the sa_config.csh script was left to execute. Once you execute both {.sh.csh} scripts, your environment is settled up properly and thus able to find every library on the SQLAnywhere platform.
Thank you Nick and Volker for your answers!
| User | Count |
|---|---|
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.