Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running "python setup.py install" returns an error. [PYFB23] #47

Closed
firebird-automations opened this issue Oct 11, 2012 · 3 comments
Closed

Comments

@firebird-automations
Copy link

Submitted by: Baskin Tapkan (baskint)

Have tried running the "python http://setup.py install" command on two different systems. I am getting the below error on both. Would you please help? Thanks.

c:\src\python\fdb-0.9.1>python http://setup.py install
Traceback (most recent call last):
File "http://setup.py", line 7, in <module>
from fdb import __version__
File "c:\src\python\fdb-0.9.1\fdb\__init__.py", line 23, in <module>
from fdb.fbcore import *
File "c:\src\python\fdb-0.9.1\fdb\http://fbcore.py", line 26, in <module>
from . import ibase
File "c:\src\python\fdb-0.9.1\fdb\http://ibase.py", line 39, in <module>
fb_library = WinDLL(fb_library_name)
File "C:\Python27\lib\ctypes\__init__.py", line 353, in __init__
self._handle = _dlopen(self._name, mode)
TypeError: expected string or Unicode object, NoneType found

@firebird-automations
Copy link
Author

Commented by: @pmakowski

you should post this kind of question on the support list mailto:firebird-python@yahoogroups.com

I guess that you don't have Firebird client library on your system
fdb need the Firebird client lib

@firebird-automations
Copy link
Author

Commented by: Baskin Tapkan (baskint)

sent the below email (awaiting moderator's approval). Thanks for the tip.

Hello,

Hope everyone is doing well. Having this problem of not being able to connect to an existing embedded Firebird database using Python.

I work regularly on a Windows 7 x64-bit, Python 2.7 (switched to 2.6 for kinterbasdb w/o success, then switch back). I also have a licensed copy of Firebird Maestro. Tried three different library packages:

firebirdsql (relatively new, but does not seem to have support for embedded) (http://pypi.python.org/pypi/firebirdsql)

kinterbasdb (last update was in 2010, seemed to install) (

fdb (could not install either on Windows or MacOS).(http://pypi.python.org/pypi/fdb)

have the bellow code (basically trying to invoke the sample code on the documentation:

#⁠ import firebirdsql
import kinterbasdb

#⁠ the server is named test.fsdb
#⁠ con = firebirdsql.connect(dsn='TEST.FDB', user='SYSDBA', password='masterkey')
con = kinterbasdb.connect(host='', database=r'C:\src\python\pyfirebirdsql\TEST.FDB',user='sysdba', password='masterkey')

cur = con.cursor()

#⁠ execute the select statement
cur.execute("select * from languages order by year_released")

#⁠ retrieve all rows in a sequence and print the sequence
print cur.fetchall()

TEST.FDB file is in the same directory as I am running the script. With firebirdsql package, I receive below:

c:\src\python\pyfirebirdsql>python fsdb_test.py
Traceback (most recent call last):
File "fsdb_test.py", line 5, in <module>
con = firebirdsql.connect(dsn='TEST.FDB', user='SYSDBA', password='masterkey')
File "c:\src\python\pyfirebirdsql\firebirdsql\__init__.py", line 64, in connect
database=database, charset=charset, port=port)
File "c:\src\python\pyfirebirdsql\firebirdsql\http://fbcore.py", line 759, in __init__
self.sock.connect((self.hostname, self.port))
File "C:\Python27\lib\http://socket.py", line 224, in meth
return getattr(self._sock,name)(*args)
socket.error: [Errno 10061] No connection could be made because the target machine actively refused it

Looks like support for embedded is missing for firebirdsql.

With kinterbasdb, I get this:

c:\src\python\pyfirebirdsql>python fsdb_test.py
Traceback (most recent call last):
File "fsdb_test.py", line 2, in <module>
import kinterbasdb
File "C:\Python27\lib\site-packages\kinterbasdb\__init__.py", line 119, in <module>
import _kinterbasdb as _k
ImportError: DLL load failed: %1 is not a valid Win32 application.

This is 32 bit vs 64-bit issue looks like. I made sure I used both 64-bit editions of Python 2.7 and kinterbasdb-3.3.0. Still getting this message. Created an embedded folder as described here in the Python27\Lib\site-packages\kinterbasdb\embedded and copied the three DLLS (unblocked on Windows).

Could not even install fdb using below command:

c:\src\python\fdb-0.9.1>python http://setup.py build
Traceback (most recent call last):
File "http://setup.py", line 7, in <module>
from fdb import __version__
File "c:\src\python\fdb-0.9.1\fdb\__init__.py", line 23, in <module>
from fdb.fbcore import *
File "c:\src\python\fdb-0.9.1\fdb\http://fbcore.py", line 26, in <module>
from . import ibase
File "c:\src\python\fdb-0.9.1\fdb\http://ibase.py", line 39, in <module>
fb_library = WinDLL(fb_library_name)
File "C:\Python27\lib\ctypes\__init__.py", line 353, in __init__
self._handle = _dlopen(self._name, mode)
TypeError: expected string or Unicode object, NoneType found

Just to see if embedded works, I switched to .NET (sigh) and able to connect to the same database using the below:

class Program
{
static void Main(string[] args)
{
string ConnectionString = "Database=E:\\TEST.FDB;User=SYSDBA;Password=masterkey;Dialect=3;ServerType=1";
FbConnection addDetailsConnection = new FbConnection(ConnectionString);
addDetailsConnection.Open();

        Console\.WriteLine\("connection open"\);
        Console\.ReadLine\(\);
        addDetailsConnection\.Close\(\);
        Console\.WriteLine\("connection closed"\);
        Console\.ReadLine\(\);
    \}

}

For .NET, I followed the detailed and easy-to-follow instructions found here. http://nazmialtun.blogspot.com/2012/01/using-embedded-firebird-database-in-net.html

Any help, expertise with the above would be appreciated. Thanks!

Baskin Tapkan

@firebird-automations
Copy link
Author

Modified by: @pcisar

status: Open [ 1 ] => Closed [ 6 ]

resolution: Won't Fix [ 2 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants