<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Error loading dbcapi while connecting to sqlanydb in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/error-loading-dbcapi-while-connecting-to-sqlanydb/qaa-p/13825050#M4855893</link>
    <description>&lt;P&gt;Of course, sorry. I'm running on a Mac OS X. I installed python3 along with the sqlanydb library, and downloaded SQL Anywhere 12.&lt;/P&gt;
&lt;P&gt;I read somewhere about to run the sa_config.sh script by running ./Applications/SQLAnywhere12/System/bin32/sa_config.sh, or, anternatively, add SQLAnywhere/System/lib32 to the DYLD_LIBRARY_PATH which make the environment able to locate the libraries. I tried both but it still doesn't work, or perhaps I did it incorrectly....&lt;/P&gt;
&lt;P&gt;What do you mean by setting up my environment before launching Python? Do you mean running the sa_config script before running my py file? I'm a bit lost so I will really appreciate a tutorial or at least a key guideline which could help me out fixing this.&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Tue, 16 Feb 2016 10:22:56 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2016-02-16T10:22:56Z</dc:date>
    <item>
      <title>Error loading dbcapi while connecting to sqlanydb</title>
      <link>https://community.sap.com/t5/technology-q-a/error-loading-dbcapi-while-connecting-to-sqlanydb/qaq-p/13825047</link>
      <description>&lt;P&gt;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:&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;File "example.py", line 30, in&lt;/P&gt;
&lt;LI-CODE lang="sql"&gt;databasefile="/blabla/data.db",&lt;/LI-CODE&gt;


&lt;P&gt;File "/usr/local/lib/python3.5/site-packages/sqlanydb.py", line 512, in connect&lt;/P&gt;
&lt;LI-CODE lang="sql"&gt;return Connection(args, kwargs)&lt;/LI-CODE&gt;


&lt;P&gt;File "/usr/local/lib/python3.5/site-packages/sqlanydb.py", line 528, in &lt;STRONG&gt;init&lt;/STRONG&gt;&lt;/P&gt;
&lt;LI-CODE lang="sql"&gt;parent = Connection.cls_parent = Root("PYTHON")&lt;/LI-CODE&gt;


&lt;P&gt;File "/usr/local/lib/python3.5/site-packages/sqlanydb.py", line 454, in &lt;STRONG&gt;init&lt;/STRONG&gt;&lt;/P&gt;
&lt;LI-CODE lang="sql"&gt;'libdbcapi_r.dylib')&lt;/LI-CODE&gt;


&lt;P&gt;File "/usr/local/lib/python3.5/site-packages/sqlanydb.py", line 446, in load_library&lt;/P&gt;
&lt;LI-CODE lang="sql"&gt;raise InterfaceError("Could not load dbcapi.  Tried: " + ','.join(names))&lt;/LI-CODE&gt;


&lt;P&gt;TypeError: sequence item 0: expected str instance, NoneType found&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;Could please anyone help me out with this? &lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Feb 2016 06:22:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-loading-dbcapi-while-connecting-to-sqlanydb/qaq-p/13825047</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-02-16T06:22:58Z</dc:date>
    </item>
    <item>
      <title>Re: Error loading dbcapi while connecting to sqlanydb</title>
      <link>https://community.sap.com/t5/technology-q-a/error-loading-dbcapi-while-connecting-to-sqlanydb/qaa-p/13825049#M4855892</link>
      <description>&lt;P&gt;Knowing which platform you are running this on will help.
Also knowing what exactly you downloaded (and installed) may be important too.&lt;/P&gt;
&lt;P&gt;If running on Linux or one of the Unix platforms, you'll need to set up your environment before launching Python. On those platforms you will need to source the sa_config{.sh|.csh} script so your Python application can locate the required libraries (including libdbcapi12.dll).&lt;/P&gt;</description>
      <pubDate>Tue, 16 Feb 2016 08:59:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-loading-dbcapi-while-connecting-to-sqlanydb/qaa-p/13825049#M4855892</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-02-16T08:59:12Z</dc:date>
    </item>
    <item>
      <title>Re: Error loading dbcapi while connecting to sqlanydb</title>
      <link>https://community.sap.com/t5/technology-q-a/error-loading-dbcapi-while-connecting-to-sqlanydb/qaa-p/13825050#M4855893</link>
      <description>&lt;P&gt;Of course, sorry. I'm running on a Mac OS X. I installed python3 along with the sqlanydb library, and downloaded SQL Anywhere 12.&lt;/P&gt;
&lt;P&gt;I read somewhere about to run the sa_config.sh script by running ./Applications/SQLAnywhere12/System/bin32/sa_config.sh, or, anternatively, add SQLAnywhere/System/lib32 to the DYLD_LIBRARY_PATH which make the environment able to locate the libraries. I tried both but it still doesn't work, or perhaps I did it incorrectly....&lt;/P&gt;
&lt;P&gt;What do you mean by setting up my environment before launching Python? Do you mean running the sa_config script before running my py file? I'm a bit lost so I will really appreciate a tutorial or at least a key guideline which could help me out fixing this.&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Feb 2016 10:22:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-loading-dbcapi-while-connecting-to-sqlanydb/qaa-p/13825050#M4855893</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-02-16T10:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: Error loading dbcapi while connecting to sqlanydb</title>
      <link>https://community.sap.com/t5/technology-q-a/error-loading-dbcapi-while-connecting-to-sqlanydb/qaa-p/13825051#M4855894</link>
      <description>&lt;P&gt;I don't use Mac OS X, so I can't tell. But hopefully the following FAQ (or another one of those tagged with "macosx") is of help:&lt;/P&gt;
&lt;P&gt;[&lt;A href="http://sqlanywhere-forum.sap.com/questions/23704/python3-cannot-import-sqlanydb]"&gt;http://sqlanywhere-forum.sap.com/questions/23704/python3-cannot-import-sqlanydb]&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Feb 2016 10:41:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-loading-dbcapi-while-connecting-to-sqlanydb/qaa-p/13825051#M4855894</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2016-02-16T10:41:16Z</dc:date>
    </item>
    <item>
      <title>Re: Error loading dbcapi while connecting to sqlanydb</title>
      <link>https://community.sap.com/t5/technology-q-a/error-loading-dbcapi-while-connecting-to-sqlanydb/qaa-p/13825048#M4855891</link>
      <description>&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;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. &lt;/P&gt;
&lt;P&gt;For Bash and Bourne &lt;CODE&gt;sh&lt;/CODE&gt; 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:&lt;/P&gt;
&lt;LI-CODE lang="sql"&gt;`. ./sa_config.sh`&lt;/LI-CODE&gt;


&lt;P&gt;and for some other shells related to the 'C'-shell (csh) the source cmd is the word &lt;CODE&gt;source&lt;/CODE&gt; as in&lt;/P&gt;
&lt;LI-CODE lang="sql"&gt;`source ./sa_config.csh`&lt;/LI-CODE&gt;


&lt;P&gt;I beleive the default for Mac OSX is the Bash shell so I would start by trying the first example; with a space.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Feb 2016 15:36:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-loading-dbcapi-while-connecting-to-sqlanydb/qaa-p/13825048#M4855891</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-02-16T15:36:12Z</dc:date>
    </item>
    <item>
      <title>Re: Error loading dbcapi while connecting to sqlanydb</title>
      <link>https://community.sap.com/t5/technology-q-a/error-loading-dbcapi-while-connecting-to-sqlanydb/qaa-p/13825052#M4855895</link>
      <description>&lt;P&gt;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. &lt;/P&gt;
&lt;P&gt;Thank you Nick and Volker for your answers!&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 06:49:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-loading-dbcapi-while-connecting-to-sqlanydb/qaa-p/13825052#M4855895</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-02-17T06:49:07Z</dc:date>
    </item>
  </channel>
</rss>

