using windows 2.0 version with python36

steve
Posts: 4
Joined: Fri Aug 18, 2017 6:10 am

using windows 2.0 version with python36

Postby steve » Fri Aug 18, 2017 6:14 am

I replaced the default sqlite3.dll with the version in the litereplica2.0 version. Then ran my program and it said sqlite3.dll is not a valid win32 dll.

Thoughts?
Bernardo
Site Admin
Posts: 14
Joined: Tue Oct 27, 2015 1:14 am

Re: using windows 2.0 version with python36

Postby Bernardo » Fri Aug 18, 2017 7:54 pm

Hi!

Try downloading again. The file can be corrupted.

Are you using the dependencies? (binn and nanomsg)

You can use the Dependency Walker to check for missing files.
steve
Posts: 4
Joined: Fri Aug 18, 2017 6:10 am

Re: using windows 2.0 version with python36

Postby steve » Sat Aug 19, 2017 5:42 am

Dependency walker did not show any missing items other than the same ones it shows for depend.dll

I do not believe I am using binn nor nanomsg.

BTW, tried to download tonight, but downloads gave 404 code.
Thanks
Bernardo
Site Admin
Posts: 14
Joined: Tue Oct 27, 2015 1:14 am

Re: using windows 2.0 version with python36

Postby Bernardo » Sat Aug 19, 2017 4:10 pm

Dependency Walker must show these 2 dependencies for the modified sqlite3.dll:

binn-1.0.dll
nanomsg.dll

You must save them on the Windows System folder:

\Windows\System32 (for 32 bits Windows)
\Windows\SysWOW64 (for 64 bits Windows)

They are in the file you downloaded.
steve
Posts: 4
Joined: Fri Aug 18, 2017 6:10 am

Re: using windows 2.0 version with python36

Postby steve » Sat Aug 19, 2017 7:59 pm

I put the two dll's in to the sysWOW64 . Reran my code and still get the Message: ImportError: DLL load failed: %1 is not a valid Win32 application. after the "from _sqlite3 import * " statement.

Thoughts?
Bernardo
Site Admin
Posts: 14
Joined: Tue Oct 27, 2015 1:14 am

Re: using windows 2.0 version with python36

Postby Bernardo » Sat Aug 19, 2017 8:25 pm

The SQLite+litereplica, binn and nanomsg DLLs are 32 bit.

Is your Python 32 bit?

Check also:

https://stackoverflow.com/questions/190 ... t-the-dlls
https://stackoverflow.com/questions/467 ... for-pygame
Bernardo
Site Admin
Posts: 14
Joined: Tue Oct 27, 2015 1:14 am

Re: using windows 2.0 version with python36

Postby Bernardo » Sat Aug 19, 2017 8:56 pm

Notice also that the module to use is named "sqlite3", without an underscore:

Code: Select all

import sqlite3

conn = sqlite3.conn('file:/path/to/main.db?replica=master&slave=tcp://127.0.0.1:1234')
steve
Posts: 4
Joined: Fri Aug 18, 2017 6:10 am

Re: using windows 2.0 version with python36

Postby steve » Sun Aug 20, 2017 5:11 am

Thanks. I did not know that it was only 32 bit. I changed to a 32 bit version of python (3.6.1). It now loads and with my original db name it connects.

When I change the file name by adding ?replica=master to the name, I get the message:
c_pers = sqlite3.connect(r"\\Stevetab\users\steve\documents\python\personell.db?replica=master")
sqlite3.OperationalError: unable to open database file

I also had the full statement having a &bind=tcp..., with the same message
Bernardo
Site Admin
Posts: 14
Joined: Tue Oct 27, 2015 1:14 am

Re: using windows 2.0 version with python36

Postby Bernardo » Sun Aug 20, 2017 5:37 am

Have you used the "file:" at the beginning?
BuckG
Posts: 1
Joined: Thu Sep 14, 2017 2:37 pm

Re: using windows 2.0 version with python36

Postby BuckG » Fri Sep 22, 2017 3:00 pm

Bernardo wrote:Have you used the "file:" at the beginning?


Thanks. That worked!

Who is online

Users browsing this forum: No registered users and 1 guest