informix DB with RobotFramework - python-3.x

I am trying to connect to informix DB from Robotframework script running on Mac. I have installed Robotframework-Database-Library[1.0.1] from http://franz-see.github.io/Robotframework-Database-Library/.
tried to install Informix DB per https://wiki.python.org/moin/Informix. Ran into issue
error: Can't find esql. Please set INFORMIXDIR correctly.
tried to install mxODBC using python. still running into error
I have installed egenix-mx-base-3.2.9-py2.7_ucs2-macosx-10.5-x86_64-prebuilt as this is precondition. Tried to verify the mx-base using.
$ pip install egenix-mx-base
Requirement already satisfied: egenix-mx-base in /Library/Python/2.7/site-packages.
Then tried to install egenix-mxodbc-3.3.6-py2.7_ucs2-macosx-10.4-fat-prebuilt.
msuresh$ python setup.py install
running install
found usable build data file 'build/build-py2.7_ucs2.pck'
prebuilt archive found: skipping the build process and loading the prebuilt archive
setting platform to 'macosx-10.4-fat'
adjusting distutils platform string from 'macosx-10.13-x86_64' to 'macosx-10.4-fat'
restoring build data from a previous build run
loaded build data for platform 'macosx-10.4-fat'
running install_lib
writing byte-compilation script '/var/folders/dc/nwlkjl0129d3qm1j8m5czmgsnkqkf_/T/tmpRNEu3H.py'
/usr/local/opt/python#2/bin/python2.7 -O /var/folders/dc/nwlkjl0129d3qm1j8m5czmgsnkqkf_/T/tmpRNEu3H.py
removing /var/folders/dc/nwlkjl0129d3qm1j8m5czmgsnkqkf_/T/tmpRNEu3H.py
running install_data
running install_egg_info
Removing /usr/local/lib/python2.7/site-packages/egenix_mxodbc-3.3.6-py2.7.egg-info
Writing /usr/local/lib/python2.7/site-packages/egenix_mxodbc-3.3.6-py2.7.egg-info
But on trying to verify mxodbc --> does through me error.
>>> import mx.ODBC.Manager
Traceback (most recent call last):
File "", line 1, in
File "mx/ODBC/Manager/__init__.py", line 48, in
ImportError: None of the supported ODBC managers unixODBC, iODBC or DataDirect could be imported: dlopen(/usr/local/lib/python2.7/site-packages/mx/ODBC/unixODBC/mxODBC.so, 2): no suitable image found. Did find:
/usr/local/lib/python2.7/site-packages/mx/ODBC/unixODBC/mxODBC.so: no matching architecture in universal wrapper
/usr/local/lib/python2.7/site-packages/mx/ODBC/unixODBC/mxODBC.so: no matching architecture in universal wrapper, dlopen(/usr/local/lib/python2.7/site-packages/mx/ODBC/iODBC/mxODBC.so, 2): no suitable image found. Did find:
/usr/local/lib/python2.7/site-packages/mx/ODBC/iODBC/mxODBC.so: no matching architecture in universal wrapper
/usr/local/lib/python2.7/site-packages/mx/ODBC/iODBC/mxODBC.so: no matching architecture in universal wrapper, No module named DataDirect
.. Any help to get informix connection via Robotframework would be appreciated.

It sounds like you need to download and install the Informix Client SDK from here

Related

Dlib ImportError in Windows 10 on line _dlib_pybind11 import *, DLL Load Failed

I am able to successfully install Dlib with CUDA support in Windows 10 but getting an error during "import dlib" in my python code of computer vision project.
Environment: Windows 10, Python 3.7.6 (Anaconda), CUDA 11, CuDNN 10.2
Error Message:
>>> import dlib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\ProgramData\Anaconda3\lib\site-packages\dlib-19.20.99-py3.7-win-amd64.egg\dlib\__init__.py", line 12, in <module>
from _dlib_pybind11 import *
ImportError: DLL load failed: The specified module could not be found.
This can be solved by copying the cudnn64_7.dll (available here: https://developer.nvidia.com/cudnn)
into the %CUDA_PATH%/bin directory (probably something like this: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin)
I am able to find and fix this issue. CUDA 11 installation wasn't able to add few of the directories into the PATH environment variable (Windows 10). It was truncated due to the max length of 2048 characters. I have removed a few of the unused software paths from PATH value and after reinstallation, dlib 19.20 is working with CUDA 11 now.
I created an issue on DLIB Github under the following link which has more information regarding error logs and snapshots for this issue.
https://github.com/davisking/dlib/issues/2097
In my environment, the problem was due to an error somewhere in the build process that resulted code to load CuDNN dynamic libraries not being included in the generated file dlib/__init__.py despite having no build error. In my case the file always included this strange block of code:
if 'OFF' == 'ON':
add_lib_to_dll_path('cudnn-NOTFOUND')
add_lib_to_dll_path('C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.5/lib/x64/cudart.lib')
The second line's cudnn-NOTFOUND gave a clue of what happened with my build.
As I followed instructions on this page, copying all the binaries and include files to the right places within the CUDA directory, I only needed to modify the code to (similar to what Epic Chen's answer suggests but I got rid of the if clause and the bad code line):
add_lib_to_dll_path('C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.5/lib/x64/cudart.lib')
That workaround fixed the problem for me.
My configuration is CUDA 11.5, CuDNN 8.3.1.22, dlib compiled using Visual Studio 2019. The environment variable CMAKE_PREFIX_PATH to the CuDNN directory to get the compiler to find the include files and libraries.
If you are using Anaconda, uninstall dlib and reinstall dlib.
In anaconda command prompt, type
pip uninstall dlib
After successfully uninstalling, type
pip install dlib
It helped me fix the problem.
Try to check the __init__.py file which the error message indicate as below.
Your path is not the same as me.
In the __init__.py file, the if statement should be 'ON' == 'ON'
Besides, the following library paths must be correct. Your version may not be the same as me.

Python, pymesh install problem on windows10

Hi I'm a Python newbie trying to program python using pymesh library but I cant get it to install properly.
Accordijng to attached image I have installed it, and the package says its for 3.8.x and I have python 3.8.2 installed.
pymesh installation instructions (https://pymesh.readthedocs.io/en/latest/installation.html) say to run a test after installing the package. The test fails.
(work) (base) D:\Downloads\HoleCutter>python -c "import pymesh; pymesh.test()"
Traceback (most recent call last):
File "<string>", line 1, in <module>
AttributeError: module 'pymesh' has no attribute 'test'
I dont have the resources/capability to 'build packages with cmake'
screen snap from command prompt window
The reason is the PyMesh library isn't kept up to date on PIP, instead you have to use Docker or compile it yourself. This problem is covered by the following issue on Github, however no action has been taken for years: https://github.com/PyMesh/PyMesh/issues/94
Have you tried "pip install pymesh" or "pipx.x install pymesh"?
I think the instructions in the link you provided are for Linux and Mac OS. You can look at this link: ImportError: No module named PyMesh

Python 3 Windows install giving package error ModuleNotFoundError

I have recently started using Python and have installed version 3.7.3 on my Windows 10 machine running as administrator. I then ran the following command in a command prompt to install the xmpppy package
python -m pip install xmpppy
Next I created the following base.py file that uses the aforementioned xmpppy package
#!/usr/bin/env python
import xmpp
user="user"
password="pword"
server="server"
jid = xmpp.JID(user)
connection = xmpp.Client(server,debug=[])
connection.connect()
result = connection.auth(jid.getNode(), password,"LFY-client")
connection.sendInitPresence()
while connection.Process(1):
pass
Now when I run the command
python base.py
in the folder that the base.py file exists I get the following error message:
Traceback (most recent call last):
File "base.py", line 3, in <module>
import xmpp
File "C:\Users\AGO109\AppData\Local\Programs\Python\Python37\lib\site-packages\xmpp\__init__.py", line 29, in <module>
import simplexml,protocol,debug,auth,transports,roster,dispatcher,features,browser,filetransfer,commands
ModuleNotFoundError: No module named 'simplexml'
In the folder C:\Users\AGO109\AppData\Local\Programs\Python\Python37\lib\site-packages\xmpp simplexml.py, protocol.py etc. all exist and the windows system variables contain the paths for python and packages, so what's the problem?
I'm facing same issue.
Try installing each of the packages using command like pip install simplexml and then run your code. Mine is stuck at installing transports.
Alternately,you may try switching to using sleekxmpp that comes bundled with your python installation. As sleekxmpp has latest version published in 2017 compared to that of 2006 for xmpppy, i'm planning to stick with using sleekxmpp library. If you update your code to use sleekxmpp as per the boilerplate code at https://pypi.org/project/sleekxmpp/, XMPP connections work.

python-escpos windows giving "bugtrack_url" error

Trying to install python-escpos library. The instructions say the following:
Ensure the library is installed on ${lib_arch}/${python_ver}/site-packages/escpos
On CLi you must run:
python setup.py build
sudo python setup.py install
What does ${lib_arch}/${python_ver}/ mean? Is it the path such as
\Users\RickT\AppData\Local\Programs\Python\Python36-32\Lib\site-packages\escpos?
When I run python setup.py build, I get the following error:
C:\Users\RickT\AppData\Local\Programs\Python\Python36-32\lib\distutils\dist.py:261: UserWarning: Unknown distribution option: 'bugtrack_url' warnings.warn(msg)Traceback (most recent call last):
File "setup.py", line 140, in <module> 'python-escpos = escpos.cli:main'
As I wrote in the comments you should write which version of the documentation you are using and which version of the codebase you are using.
The "error" considering the bugtrack_url is just a warning because setuptools does not know this token. This should not affect your setup in any way. You probably installed it successfully.
Concerning your question about the path: ${lib_arch}/${python_ver}/site-packages/escpos is more or less non-sense in a Windows-context. This just means your location of the site-packages-directory. So, your assumption is right.
All in all the probably easiest solution for you would be installing with pip. This would simply be - considering you have a working pip - a one-liner:
pip install python-escpos

cx_Oracle: distutils.errors.DistutilsSetupError: cannot locate Oracle include files

I need install cx_Oracle for Python 2.5 on Linux (Linux 2.6.18-371.1.2.el5 i686). I have installed Oracle client 10.2.0.4.
I have tried following:
1. Download cx_Oracle tar.gz from http://sourceforge.net/projects/cx-oracle/files/.
I don't know which of listed version are suitable for python 2.5 and Oracle client 10.2.0.4, so try cx_Oracle-5.1.tar.gz. Unpacked tar,
go to unpacked folder and run python setup.py install. I got error:
Traceback (most recent call last):
File "setup.py", line 187, in <module>
raise DistutilsSetupError("cannot locate Oracle include files")
distutils.errors.DistutilsSetupError: cannot locate Oracle include files
In .bash_profile I have setted oracle path:
export ORACLE_HOME=/usr/oracle/10.2.0.4/client
export PATH=$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
How fix such error, maybe I need another version of cx_Oracle tar?
Run pip install cx_Oracle. Got error:
Downloading/unpacking cx-Oracle
Cannot fetch index base URL https://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement cx-Oracle
No distributions at all found for cx-Oracle
Could someone advise me right solution?
Update
After suggestion in response I got following error:
...
cx_Oracle.c:496: warning: passing argument 3 of âPyModule_AddIntConstantâ makes integer from pointer without a cast
cx_Oracle.c:497: error: âOCI_UCBTYPE_EXITâ undeclared (first use in this function)
cx_Oracle.c:497: warning: passing argument 3 of âPyModule_AddIntConstantâ makes integer from pointer without a cast
cx_Oracle.c:498: error: âOCI_UCBTYPE_REPLACEâ undeclared (first use in this function)
cx_Oracle.c:498: warning: passing argument 3 of âPyModule_AddIntConstantâ makes integer from pointer without a cast
error: command 'gcc' failed with exit status 1
When you run setup.py it will check for any of these folders on your ORACLE_HOME.
possibleIncludeDirs = ["rdbms/demo", "rdbms/public", "network/public",
"sdk/include"]
Also the instant client sometimes places the include files, such as oci.h, in /usr/include/oracle//client, if there is no 'include' directory under ORACLE_HOME create a symbolic link to it.
sudo ln -s /usr/include/oracle/11.2/client $ORACLE_HOME/include
Looks like you're missing the Client SDK
Make sure you install the instant client sdk for you OS.
http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html
Install oracle_client_basic
oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm
Using pip install
python -m pip install cx_Oracle
Adding ldconfig
Find your client location, for example: /u01/app/oracle/product/11.2.0/client_1/lib
vi /etc/ld.so.conf.d/oracle.conf
Add this location into it:
/u01/app/oracle/product/11.2.0/client_1/lib
ldconfig
import cx_oracle
Make sure that you've a client sdk present in your path.
Also I had to do add this to my .bash_rc
export DYLD_LIBRARY_PATH=$ORACLE_HOME
In addition to this, Python 2.7 does not come with Python.h which is available by default in Python 3.4. So I would also suggest to install python-devel package
yum install python-devel
That should resolve the issue.

Resources