scrapy hub - exceptions.ImportError: No module named pymodm - mongodb

I can run my scrapy locally without any issues, however, when i try to run job from scrapinghub i get the following error (connecting to mongo atlas cloud):
exceptions.ImportError: No module named pymodm
I import using:
import pymodm
Any help is much appreciated.
Cheers

Create a file named scrapinghub.yml in your project's main folder with following contents.
projects:
default: 111149
requirements:
file: requirements.txt
Where 111149 is my proejct ID on scrapinghub.
Create another file named requirements.txt in same directory.
and put your required modules along with the version number you are using in that file like so,
MySQL-python==1.2.5
PS: I was using MySQLDB module so I put that.

Related

Deno import modules from private repo

I tried to import a module from my private repository (GitHub). Following the Deno documentation, I put DENO_AUTH_TOKENS env with my dev key xxxxxx#raw.githubusercontent.com.
I can load the main file module on my repo but all relative paths from this module fail to download (404, path is correct just not authorized I suppose).
Do you know how to fix load relative file from a module in a private repository?
I ran my process with the debug mode:
deno run -L debug main.ts
Output:
DEBUG RS - deno::auth_tokens:69 - Parsed 1 auth token(s).
so my auth is correctly parsed and I can load the first file but all relative files can't be loaded.
----- Edit
Ok my bad, i wanted to use my node module to deno but i forgot to rename all import with .ts at the end... i'm so stupid, sorry ;) .

cannot import name 'AuthorityMatchInfo' from 'pyproj._crs'

I am trying to use the calc module in metpy. I have installed it both via pip and 'conda forge' option. When i run my script in spyder, i get the following error
ImportError: cannot import name 'AuthorityMatchInfo' from 'pyproj._crs' eg Example file path : (~anaconda3/lib/python3.7/site-packages/pyproj/_crs.cpython-37m-x86_64-linux-gnu.so)
Had the same issue two times and solved it by following advice I found on github.
Basically one needs to uninstall pyproj and reinstall.

How to reference yaml variable file present in github in robot framework test case file in github

I ran Robot framework test cases(present in github) through azure pipeline. Test cases executed fine. Next I modified robot framework test case file to import yaml variable file (variable yaml file also present in same github repo folder) which has variables to be used by test cases file.
yaml variable file looks like this
login:
url: xxx.com
email: abc#y.com
password: xyz
And my test cases file look like this
*** Settings ***
Library SeleniumLibrary
Variables variablesfile.yaml
*** Test Cases ***
Dev_TC01_AddProcess
Open Browser ${login.url} chrome
Input Text id=email ${login.email}
Input Password id=password ${login.password}
And my yaml pipeline to trigger test scenarios looks like this
- script: |
pip install pytest pytest-azurepipelines
pytest
robot --pythonpath . -x outputxunit.xml TestScenarios.robot
displayName: 'Run Robot Scripts'
but on running the pipeline I get error, because test scenarios file is unable to reference variablesfile.yaml. got error message - Resolving variable '${login.url}' failed:
Can you please suggest how to reference variable file
Above error seems to be caused by the variables yaml file not being found.
If you defined Variables file in the Settings section like what you defined in above example. You should put the variables yaml files in the same directory of the test robot file TestScenarios.robot.
If the variables files are not under the same directory. You can define the correct relative path in the Settings section like below example: See here.
Variables ../data/variables.yaml
Note:
Using YAML files with Robot Framework requires PyYAML module to be installed. If you have pip_ installed, you can install it simply by running pip install pyyaml.
Variables file is in the same directory of TestScenarios.robot. I also tried entering the full path still it didnt work. Finally i got a solution, I need to run pip install pyyaml script then it worked

No name 'xxx' in module 'ansible.module_utils', pylint(no-name-in-module) in VScode

What cause this issue
Ansible supports user-defined module_utils folder, we can add following line in ansible.cfg:
module_utils = /xxx/lib/module_utils
Then, when the playbook running, ansible will combine both /usr/local/lib/python3.6/dist-packages/ansible/module_utils and /xxx/lib/module_utils together.
So, we can import module utilities in user-defined ansible module, like:
import ansible.module_utils.my_utils
But, pylint doesn't read the ansibe.cfg file and combine the user-defined utility folder with system one. So, it can't find my_utils in /usr/local/lib/python3.6/dist-packages/ansible/module_utils, and cause this issue.
My question
Is there any way to make the pylint 'see' the modules in user-defined folder?
BTW, add additional search path in pylint configuration like below won't fix this issue.
init-hook='import sys; sys.path.append("/xxx/lib/module_utils")'
because in ansible module, we used ansible.module_utils namespace
import ansible.module_utils.my_utils
not
import my_utils

How can we run Robot Framework files and Test cases using command line?

Please can anyone suggest and help how can we execute the Robot Framework Test Cases and Files via command line ?
My Robot Framework Directory Location is as follows :
/Users/tanyagrover/Desktop/Robot Files/Charcoal PreProd
I've tried :
robot -L debug Charcoal preprod.robot
and got error as :
File "/usr/local/bin/robot", line 6, in <module>
from robot.run import run_cli
ModuleNotFoundError: No module named 'robot'
I'am using ride.py to create my test cases and the test cases are running fine when i'm using RIDE UI. But I want to run my test cases using Robot CLI. Whenever I'am executing my .robot file using robot command I'am getting following error
robot Login.robot
Traceback (most recent call last):
File "/usr/local/bin/robot", line 6, in
from robot.run import run_cli
ModuleNotFoundError: No module named 'robot'
Thank You
The reason you are getting the below error is , you need to go to the same virtualenv/interpreter where you have installed robotframework,as you have configured your eclipse to run on. Otherwise, you will get the below error.
File "/usr/local/bin/robot", line 6, in <module>
from robot.run import run_cli
ModuleNotFoundError: No module named 'robot'
Steps to remedy
You need to use the same virtualenv/interpreter and
then make sure you have robotframework installed and
then you need to invoke robot, only then it is going to work.
APPROACH#0
Assuming that you have created a virtualenv/interpreter with robotframework installed successfully, then you need to just
cd to that specific directory and
then execute robot as mentioned below.
If you want to run all the testcases from all the files and folders under Prepod
cd /Users/tanyagrover/Desktop/Robot\ Files/Charcoal\ PreProd
robot *.robot
NOTE: few users are confused regarding "cd" when dir name contains
space i have created a simple folder name "sample sd"(there is a space
in the folder name)
On mac this works,
cd sample\ sd/
06:30 PM##~/sample sd::>
First, make sure you have robot framework installed and it is found in PYTHONPATH environment variable.
For executing the tests, there are many ways to do this.
Option #1:
Go to Charcoal PreProd folder and just robot Suites
Option #2:
Go to Suites folder and just robot .
Option #3:
If you wanna run only Login test suite, in Charcoal PreProd folder: robot Login.robot (assuming the file extension for Login file is robot).
Also note that the last argument cannot have spaces as you have in Charcoal preprod.robot. In this case, you should use quotes: 'Charcoal preprod.robot'.
Setting default python version to 3.6 worked for me