jaydebeapi connection terminates without any exception or error | unable to investigate further - python-3.x

I followed the usage steps as per the example, after the second step of defining "conn" the script terminates and comes back to the command line without raising any errors o warnings or exception.
I am not able to identify what went wrong, has anyone faced this issue with jaydebeapi?
Sharing the libraries/environment details I am using and screenshot.
Example:
import jaydebeapi
conn = jaydebeapi.connect("org.hsqldb.jdbcDriver",
... "jdbc:hsqldb:mem:.",
... ["SA", ""],
... "/path/to/hsqldb.jar",) --------my script terminates at this step
curs = conn.cursor()
Environment:
Windows 10 64bit
Python 3.7.4
JayDeBeApi==1.1.1
JPype1==0.6.3
sasl==0.2.1
thrift==0.10.0
thrift-sasl==0.3.0
Jar = hive-jdbc-1.2.1-standalone.jar
Resolution is appreciated.

Are you using same (i.e. 64 bit) versions of programms? Reinstallation from python 32 to python 64 helped me with the same problem.

Related

.exe has stopped working when use thread module

I just copy the code from the example on nim's offical documentation:
import std/locks
var
thr: array[0..4, Thread[tuple[a,b: int]]]
L: Lock
proc threadFunc(interval: tuple[a,b: int]) {.thread.} =
for i in interval.a..interval.b:
acquire(L) # lock stdout
echo i
release(L)
initLock(L)
for i in 0..high(thr):
createThread(thr[i], threadFunc, (i*10, i*10+5))
joinThreads(thr)
deinitLock(L)
$ nimble build --threads:on
Verifying dependencies for thread#0.1.0
Building thread/thread.exe using c backend
$ .\thread
then thread.exe crashed...
thread.exe
0.0.0.0
630c5e83
libwinpthread-1.dll
6.3.9600.20512
62cdfc6e
c0000135
00000000000ed1b0
1fc8
01d8bb71e28918ba
F:\MyProjects\Nim\thread\thread.exe
libwinpthread-1.dll
2044d161-2765-11ed-827a-6c86063c07b4
I have no ideas about it...Can anybody help me? Thanks a lot.
Gave it a try in Windows 8.1, it does fail.
Apparently is a recent regression in nim you can make it work if you compile it with --threads:on --tlsEmulation:on (or make sure mingw binaries is on your PATH).

How to check if the environment variable "PROJ_LIB" is defined and how to unset it ? (PyQGIS Standalone Script Executer)

I just tried the standalone PyQGIS application by running the custom script "Proximity.py"* in a VS Code project without the need of a GUI (such as QGIS).
But, when I run the python-program I get the following message:
proj_create_from_database: C:\Program Files\PostgreSQL\14\share\contrib\postgis-3.2\proj\proj.db contains DATABASE.LAYOUT.VERSION.MINOR = 0 whereas a number >= 2 is expected. It comes from another PROJ installation. (see also: Error Message after launching the configuration (launch.json) from VS Code (when pressing F5))
I'm trying this online example with the following installations:
PostgreSQL 14
Python39
.vscode\extensions\ms-python.python-2022.4.1\pythonFiles\lib\python\debugpy\launcher
osgeo4w-setup.exe (including QGIS LTR)
I read that there is a solution by undefining [PROJ_LIB] before importing pyproj or osgeo: del os.environ ['PROJ_LIB'] as described under this link. If this is also supposed to be the correct solution in this case, can someone help me with step-by-step instructions (for dummies)?
. * The "Proximity.py" script is a pyqgis standalone example from "https://github.com/MarByteBeep/pyqgis-standalone"
Finally, I got a solution to be able to run the "standalone PyQGIS"* example "Proximity" (provided by MarByteBeep).
This solution was possible without needing to launch the configuration file "launch.json" as above described. And so, avoiding the need to make any configuration to the environment variable "PROJ_LIB" by trying to circumvent the above issue.
I just first added the following two code-lines (see here line 2 and 3) in the python file "main.py" so as to be able to use the plugin "PROCESSING" (initially line 8 of the "main.py" file), then I store it and finally I ran it.
Line 1: from qgis.core import
Line 2: import sys
Line 3: sys.path.append('C:\Program Files\QGIS 3.24.1\apps\qgis\python\plugins')
Line 4: qgs = QgsApplication([], False)
Line 5: ...
The Proximity example is based on the answer of "Mar Tjin" to the following Question: "Looking for manual on how to properly setup standalone PyQGIS without GUI"
. * By "Standalone PyQGIS" I refer to code/scripts that can be run outside the QGIS-GUI (=> QGIS-Desktop/Server Application). In my case under the external Editor VS Code

Python Windows 10 64bit - FFMPEG for trackpy

Similar problem to 'Python Moviepy installation problems (windows 7x64)' except the solution provided did not work.
I have windows 10, 64bit. Every time I attempt to run the following line of code:
frames = pims.Video('exp9_short.avi')
I get the blue Windows 10 error: This app can't run on your PC
as well as the Python error:
OSError: Could not load meta information
=== stderr ===
Access is denied.
I have tried multiple versions from 'https://ffmpeg.zeranoe.com/builds/' to no avail.
I don't know if other image processing tools will work with trackpy, or if there are any alternatives to trackpy.
I would really appreciate some advice.
I solved this problem by processing each image with OpenCV2
vid0 = cv2.VideoCapture('exp9_short.avi')
numfr = int(vid0.get(cv2.CAP_PROP_FRAME_COUNT))
for n1 in range(0,numfr-1):
success,img = vid0.read(n1) #read video frame by frame
if n1==0:
h, w, cols = img.shape #image size
fr=np.zeros([h,w,3,numfr-1]) #frames
frgr=np.zeros([h,w,numfr-1]) #grayscale fr
frgrbi=frgr #binarized frgr
fr[:,:,:,n1]=img
frgr[:,:,n1]=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)

Oracle 11gR2 Installation on Oracle linux 7 - Prerequisite condition failed for OS kernel parameter “semmni”

while Installing oracle 11gr2 on oracle Linux 7. The prerequisite condition to test whether the OS kernel parameter "semmni" is failed with below error.
Please find the screenshot of it.
Below is the kernel parameters which are configured in the etc/sysctl.conf file.
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
#semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 256000 100 1024
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048586
Any idea why it is failing?
You are missing the kernel.semmni=128.
Read the requirements here.
https://docs.oracle.com/cd/E11882_01/install.112/e24326/toc.htm#BHCGJCEA
I recommend you to install all requirements at once using the preinstall package. Find the link here:
https://blogs.oracle.com/linux/oracle-rdbms-server-11gr2-pre-install-rpm-for-oracle-linux-6-has-been-released
I just have the same problem. I checked my /proc/sys/kernel/sem and the values are exactly as its been mentioned in the Oracle document.
Plus, despite having all the packages, its still showing me FAILED when it check the packages.
It is fixable, you could just click the Fix button and execute the specified script to fix it.

Python3.6 how to install libtorrent?

Does libtorrent support python3 now? if supported how to install it .
I want to code a DHT Crawler with python3 , i don't know why my code alaways got Connection reset by peer error , so i want to use libtorrent , if there are another lib , i'm happy to use it . My biggest problem is , conversing the infohash to torrent file . Could it be a code problem?
class Crawler(Maga):
async def handler(self, infohash, addr):
fetchMetadata(infohash, addr)
def fetchMetadata(infohash, addr, timeout=5):
tcpServer = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
tcpServer.settimeout(timeout)
if tcpServer.connect_ex(addr) == 0:
try:
# handshake
send_handshake(tcpServer, infohash)
packet = tcpServer.recv(4096)
# handshake error
if not check_handshake(packet, infohash):
return
# ext handshake
send_ext_handshake(tcpServer)
packet = tcpServer.recv(4096)
# get ut_metadata and metadata_size
ut_metadata, metadata_size = get_ut_metadata(packet), get_metadata_size(packet)
# request each piece of metadata
metadata = []
for piece in range(int(math.ceil(metadata_size / (16.0 * 1024)))):
request_metadata(tcpServer, ut_metadata, piece)
packet = recvall(tcpServer, timeout) # the_socket.recv(1024*17) #
metadata.append(packet[packet.index("ee") + 2:])
metadata = "".join(metadata)
logging.info(bencoder.bdecode(metadata))
except ConnectionResetError as e:
logging.error(e)
except Exception as e:
logging.error(e)
finally:
tcpServer.close()
Yes, libtorrent (is supposed to) support python 3.
The basic way to build and install the python binding is by running the setup.py. That requires that all dependencies are properly installed where distutils expects them though. If this works it's probably the simplest way so it's worth a shot. I believe you'll have to invoke this python script using python3, if that's what you're building for.
To build using the main build system (and install the resulting module manually) you can follow the steps in the .travis file (for unix) or the appeyor file for windows.
In your case you want to specify a 3.x version of python, but the essence of it is:
brew install boost-python
echo "using python : 2.7 ;" >> ~/user-config.jam
cd bindings/python
bjam -j3 stage_module libtorrent-link=static boost-link=static
To test:
python test.py
Note, in the actual build step you may want to link shared against boost if you already have that installed, and shared against libtorrent if you have that installed, or will install it too.
On windows:
add the following to $HOMEPATH\user-config.jam:
using msvc : 14.0 ;
using gcc : : : <cxxflags>-std=c++11 ;
using python : 3.5 : c:\\Python35-x64 : c:\\Python35-x64\\include : c:\\Python35-x64\\libs ;
Then run:
b2.exe --hash openssl-version=pre1.1 link=shared libtorrent-link=shared stage_module stage_dependencies
To test:
c:\Python35-x64\python.exe test.py

Resources