How to install MongoDBLibrary for Robot Framework - robotframework

I want to connect to Mongo DB using Robot Framework.
I have read in the following link that we have to pull the source code and install the library. Robot FrameWork - MongoDB-Library
I installed the Library and it is installed in the location
D:\Python27\Lib\site-packages\MongoDBLibrary
When I add 'MongoDBLibrary' library in the RIDE it showing in red (means library is not installed properly),
when i ran the same using eclipse + Maven project i got the following error
[ ERROR ] Error in file 'D:\Robot_WorkSpace\robotFrameWork\src\test\robotframework\acceptance\MongoQuery.txt': Importing test library 'D:\Python27\Lib\site-packages\MongoDBLibrary' failed: ImportError: No module named bson
Traceback (most recent call last):
File "D:\Python27\Lib\site-packages\MongoDBLibrary\__init__.py", line 2, in <module>
from mongoquery import MongoQuery
File "D:\Python27\Lib\site-packages\MongoDBLibrary\mongoquery.py", line 2, in <module>
from bson.objectid import ObjectId
PYTHONPATH:
C:\Users\akurasa\.m2\repository\org\robotframework\robotframework\3.0\Lib
C:\Users\akurasa\.m2\repository\org\robotframework\robotframework\3.0\robotframework-3.0.jar\Lib
__classpath__
__pyclasspath__/
CLASSPATH:
/D:/Sarada/eclipse/configuration/org.eclipse.osgi/bundles/789/1/.cp/jars/plexus-classworlds-2.4.jar
Please any one help me where i did wrong

Make sure you have installed PyMongo (or bson):
pip install pymongo
pip install bson (don't know if still required then)

Related

module not found error whle using librosa keyword

Exception has occurred: ModuleNotFoundError
No module named 'numba.decorators'
File "C:\Users\prasa\OneDrive\Desktop\Python\Untitled-1.py", line 3, in
import librosa
Install a previous version of numba since the newest versions deleted the decorators module.
you can use pip install numba==0.48

Form recogniser - Setup Issues

For the Form recognizer sample code provided in the below link, the Python interpreter cannot recognize Azure core API’s.
link
python —version
-Python 3.9.1
pip3 —version
- ip 21.0 from /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip (python 3.9)
I receive the following error:
Exception has occurred: ModuleNotFoundError
No module named 'azure'
File "/Users/visiothoughts/Documents/Visiothoughts/Work-Project/AI-Moto/com/ai/Bill-Recogniser/RecogniseFormContent.py", line 5, in <module>
from azure.core.exceptions import ResourceNotFoundError
Can I get some guidance on what is missing?
Looks like the module for Azure-Core has not been installed.
Run
pip install azure-core
Since the error you re receiving is below :
from azure.core.exceptions import ResourceNotFoundError

import issue when transferred from py2 to py3

I have following directory structure:
content\ip_low_level\unit_tests\dd\dd.py
each directory has __init__.py
when I'm trying to run dd.py, it is giving following error:
Traceback (most recent call last):
File "content\ip_low_level\unit_tests\dd\dd.py", line 4, in <module>
from content.ip_low_level.unit_tests.dd.dd import dd
ModuleNotFoundError: No module named 'content'
It worked perfectly using python2. But getting issue when trying using
Python3. Why py3 can't find this module which is there? init is
suppose help find the module?
I went inside the directory where content statys and tried following.It seems has fixed the issue:
py3 -m pip install -e .

Raspberry pi No module named 'cx_Oracle'

I want to use the raspberry pi to send values to the Oracle11g database, but when I run import cx_Oracle syntax for that process, I get the following error:
Traceback (most recent call last):
File "/home/pi/20190222ex01.py", line 1, in <module>
import cx_Oracle
File "/usr/lib/python3/dist-packages/thonny/backend.py", line 317, in _custom_import
module = self._original_import(*args, **kw)
ImportError: No module named 'cx_Oracle'
How can I solve this problem?
Update: Oracle has released Oracle Instant Client ARM64: https://www-sites.oracle.com/database/technologies/instant-client/linux-arm-aarch64-downloads.html
It means, that you have not installed module cx_Oracle.
First you must install Oracle driver with PIP:
python -m pip install cx_Oracle --upgrade
Hope it helped you.

Swift authentication when try to connect via API

I am a team member of research group and my current research needs to use Openstack Swift.
We have installed Openstack Juno and it works perfectly. For installation Packstack have used used. The swift service is also installed on the server and it works! We have tried to access it from the console create container, upload a file etc. everything works.
So we went further and tried to access swift using its API. Here we faced a problem on the phase of authentication.
Below you can see the simple python code I am using to check if I can connect to Swift.
import swiftclient
import keystoneclient
conn = swiftclient.Connection(
authurl='http://*[server ip]*:5000/v2.0/',
user='account_name:username',
key='serverpassword',
auth_version="2.0").get_auth()[0]
for container in conn.get_account()[1]:
print container['name']
Before executing the cod on client computer, I have installed the following necessary packages.
sudo aptitude install python-pip
sudo pip install python-swiftclient
sudo pip install python-keystoneclient
Here you can see the error which occurs during execution of the code.
Traceback (most recent call last):
File "new.py", line 15, in <module>
auth_version="2.0").get_auth()[0]
File "/usr/local/lib/python2.7/dist-packages/swiftclient/client.py", line 1332, in get_auth
timeout=self.timeout)
File "/usr/local/lib/python2.7/dist-packages/swiftclient/client.py", line 463, in get_auth
auth_version=auth_version)
File "/usr/local/lib/python2.7/dist-packages/swiftclient/client.py", line 366, in get_auth_keystone
ksclient, exceptions = _import_keystone_client(auth_version)
File "/usr/local/lib/python2.7/dist-packages/swiftclient/client.py", line 351, in _import_keystone_client
variables to be set or overridden with -A, -U, or -K.''')
swiftclient.exceptions.ClientException:
Auth versions 2.0 and 3 require python-keystoneclient, install it or use Auth
version 1.0 which requires ST_AUTH, ST_USER, and ST_KEY environment
variables to be set or overridden with -A, -U, or -K.
I have tried to find the solution searching in the Internet but I have not succeed.

Resources