Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python Import Sybase Module returning non explicit error
#1
Hi All.

I need to install ( import ) sybase module in python 3.7 but it has been a fiasco.

The major objective is to be able to query a Sybase Adaptive Server Enterprise with sqlalchemy but it is proven hard to eve make the simple import of the module.

I installed SAP SDK, and i can see, as sybase manuals that they have the module sybpydb.pyd included for python 3.1. Wish it is compatible.

Altough, I tried to add the pyd directory to Windows Path and the result is always the same.

When i do nothing, when importing the module the result is clear:
Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:57:15) [MSC v.1915 64 bit (AMD64)] on win32


>>> import sybpydb
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'sybpydb'


altough, when i add the sybpydb.pyd file into my ...\Lib\site-packages, the result is:

>>> import sybpydb
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: DLL load failed: The specified module could not be found.


Really getting desperate here.. this is blocking for my project... and I've been working in this for the last 2 weeks...

Already tried with Python-sybase module (http://python-sybase.sourceforge.net/) but it needs to be compiled and I had to ajust the setup.py a lot in order to run.

At this point, I'm almost quitting this module and try the pyodbc module ( https://pypi.python.org/pypi/pypyodbc) but would really prefer the sybase module...

Is anyone ever had the same issue?

Thanks in advance.
Quote
#2
This package for SQLAlchemy and Sybase. Can't vouch for it as I have never tried it. https://github.com/sqlanywhere/sqlalchemy-sqlany
Quote
#3
Hello, I had the same problem bu erading the ASE requirements for Python I found:

Version Requirements
Adaptive Server Enterprise Extension Module for Python has these version requirements.
• Adaptive Server Enterprise – version 15.7 or later
• Python installation – version 2.6, 2.7, or 3.1 built-in threaded mod
• Open Client SDK – version 15.7 or later


So as I had Python 3.6.1 installed I had the same problem, then I installed Pythyon 2.7.16 and it worked, I also tested with Python 3.1.4 and it worked.

C:\python
Python 3.1.4 (default, Jun 12 2011, 14:16:16) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sybpydb
>>>

Before importing the sybpydb library you must set the PYTHONPATH variable.

set PYTHONPATH=C:\Sybase\OCS-15_0\python\python31_64\dll :: The path is wjere you installed Sybase ASE


C:\python
Python 3.1.4 (default, Jun 12 2011, 14:16:16) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sybpydb
>>>

Before importing the sybpydb library you must set the PYTHONPATH variable.

set PYTHONPATH=C:\Sybase\OCS-15_0\python\python31_64\dll :: The path is wjere you installed Sybase ASE
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Error: module 'urllib' has no attribute 'urlopen' mitmit293 2 210 Jan-29-2019, 02:32 PM
Last Post: snippsat
  Cant install gtts module Python 3.4 [SOLVED] cygnus_X1 8 816 Jan-05-2019, 12:16 AM
Last Post: cygnus_X1
  Error loading MySQLdb module. pythonsmurf 0 848 Nov-05-2018, 01:23 PM
Last Post: pythonsmurf
  Using a imported module in python via pache results in permission denied error zooitje 1 457 Aug-30-2018, 06:56 PM
Last Post: zooitje
  [Python 3] - Extract specific data from a web page using lxml module Takeshio 9 665 Aug-25-2018, 08:46 AM
Last Post: leotrubach
  Scrapy python import issue basheerkharoti 1 797 Feb-12-2018, 09:55 AM
Last Post: Larz60+
  An Error in Requests Module pratheep 3 2,173 Feb-06-2018, 05:17 PM
Last Post: pratheep
  Using python requests module and BS4 to login on an Wordpress based website apollo 1 2,154 Feb-06-2018, 01:31 AM
Last Post: metulburr
  Is it possible to import / run compiled Python (.pyd) file in web browser? dvid 4 1,975 Jan-08-2018, 09:26 AM
Last Post: SarbjitGrewal
  Web crawler not returning links snakeyes22 3 810 Dec-29-2017, 11:07 PM
Last Post: Larz60+

Forum Jump:


Users browsing this thread: 1 Guest(s)