I am trying to run my python automation on Jenkins. The scripts can be started on local PC. I already pip install 'request'. But when I try to start the scripts on Jenkins, it shows:
Building in workspace C:\Users\Desktop\Automation\CGN_automation
[CGN_automation] $ cmd /c call C:\Windows\TEMP\jenkins401971882258893188.bat
C:\Users\Desktop\Automation\CGN_automation>python testCase_100_856451.py
Traceback (most recent call last):
File "testCase_100_856451.py", line 9, in <module>
from cgnTestLib import *
File "C:\Users\Desktop\Automation\CGN_automation\cgnTestLib.py", line 2,
in <module>
import requests
ModuleNotFoundError: No module named 'requests'
C:\Users\Desktop\Automation\CGN_automation>exit 1
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE
Related
So I'm trying to use the IB API wrapper from here and I try running the first line
from ib_insync import *
but am getting the following error:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/ib_insync/__init__.py", line 10, in <module>
import ibapi
ModuleNotFoundError: No module named 'ibapi'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.7/site-packages/ib_insync/__init__.py", line 13, in <module>
'IB API from http://interactivebrokers.github.io is required')
RuntimeError: IB API from http://interactivebrokers.github.io is required
but I've downloaded the IB API from the IB github (had to use The Unarchiver to unzip) and saved it on my desktop. As far as I can tell there's no pip3 command I can use to install it so I'm not sure what else I can do to install the IB API. I've allowed ticked all the boxes for the API in TWS. I'm not sure why it's not installing properly?
It seems to be the same issue found here but mine is for macosx. I've tried running the commands from README.md and they don't work. It just says no such directory exists.
Installing the a python module as a wheel is optional- its also possible to just include the path to the module in the PYTHONPATH environment variable. But if you're using the commands from the READ.ME to build and install a wheel, make sure you're in the pythonclient folder and then run:
python3 setup.py bdist_wheel
python3 -m pip install --user --upgrade dist/ibapi-9.75.1-py3-none-any.whl
Thats for the current API Latest version as of March 2019 which is 975.1
[![][1]][1]
the module 'pyicloud' is listed in requirements.txt
I have checked using the 'ls' command- I checked the directory in which the package should be - and the package does exist on the heroku server.
The app gives no such issues on my local machine, even though there is no difference in the code
I also tried the suggestions given here : https://help.heroku.com/BWJ7QYTF/why-am-i-seeing-importerror-no-module-named-site-when-deploying-a-python-app
but it didnt work.
(venv)dhcp-10-4-0-197:mes-amis mananhora$ heroku run python manage.py db upgrade -a mesamis
▸ heroku-cli: update available from 6.16.18-62346b1 to 6.99.0-ec9edad
Running python manage.py db upgrade on ⬢ mesamis... up, run.1121 (Free)
Traceback (most recent call last):
File "manage.py", line 5, in <module>
from project import app, db
File "/app/project/__init__.py", line 40, in <module>
from project.import_data.functions import import_data_blueprint
File "/app/project/import_data/functions.py", line 6, in <module>
from pyicloud import PyiCloudService
ModuleNotFoundError: No module named 'pyicloud'
import naoqi
Traceback (most recent call last):
File "", line 1, in
File "/home/pi/Downloads/pynaoqi-python2.7-2.1.4.13-linux32/naoqi.py", line 7, in
import qi
File "/home/pi/Downloads/pynaoqi-python2.7-2.1.4.13-linux32/qi/init.py", line 72, in
from _qi import Application as _Application
ImportError: /home/pi/Downloads/pynaoqi-python2.7-2.1.4.13-linux32/_qi.so: cannot open shared object file: No such file or directory
I tried all the things below
export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:/home/pi/Downloads/pynaoqi-python2.7-2.1.4.13-linux32/
export PYTHONPATH=${PYTHONPATH}:/home/pi/Downloads/pynaoqi-python2.7-2.1.4.13-linux32/
sudo ldconfig -v too
nothing works
the problem because pynaoqi was build for x64/x86 architechture; Raspi's processor is ARM architechture. So it can not work on rasp.
Qt c++ project build under Qt Creator 3.4.1 successfully. But when I just can't launch the debugger. Output in the application Output:
Debuging starts
Debuging has failed
Debuging has finished
The debugger never really starts.
output in the terminal :
QProcess: Destroyed while process ("/usr/local/bin/gdb") is still running.
Unexpected GDB stderr: "Python Exception <type 'exceptions.ImportError'> No module named gdb:
/usr/local/bin/gdb: warning:
Could not load the Python gdb module from `/usr/local/share/gdb/python'.
Limited Python support is available from the _gdb module.
Suggest passing --data-directory=/path/to/gdb/data-directory.
"
Warning: HANDLE RUNCONTROL START FAILED (no active run control)
Warning: State changed from EngineSetupFailed(2) to DebuggerFinished(23) [master] (no active run control)
Warning: (gdb) (no active run control)
Warning: 48^done (no active run control)
Warning: (gdb) (no active run control)
Warning: UNEXPECTED GDB STDERR: Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/opt/Qt5.4.2/Tools/QtCreator/share/qtcreator/debugger/gdbbridge.py", line 20, in <module>
from dumper import *
File "/opt/Qt5.4.2/Tools/QtCreator/share/qtcreator/debugger/dumper.py", line 37, in <module>
import importlib
ImportError: No module named importlib
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'theDumper' is not defined
(no active run control)
Unexpected GDB stderr: "Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/opt/Qt5.4.2/Tools/QtCreator/share/qtcreator/debugger/gdbbridge.py", line 20, in <module>
from dumper import *
File "/opt/Qt5.4.2/Tools/QtCreator/share/qtcreator/debugger/dumper.py", line 37, in <module>
import importlib
ImportError: No module named importlib
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'theDumper' is not defined
"
Warning: QUIT DEBUGGER REQUESTED IN STATE 23 (no active run control)
More information:
gcc used by qt creator : version 5.0.1
gdb used by qt creator : version 7.9
python 2.6.6 installed on my CentOS 6.5 ,and is in PATH .
when I install gdb wiht source code I did not append --with-python option. I googled out that someone did build with that option but nothing happens.
The outputs in terminal exposed two issues:
the ImportError: No module named importlib leads to unsupported library in Python. So install new version of Python (greater than 2.7) as #Amartel said.But the in my situation the gdb needs to be rebuild with --with-python configuration option to make gdb use newer version of Python.
Python Exception <type 'exceptions.ImportError'> No module named gdb:
/usr/local/bin/gdb' can been solved by copy files in the directory: gdb_src_dir/gdb/data-directory/python/gdb to /usr/local/share/gdb. NOTE: my gdb is installed under/usr/local/bin.
Finally, the debugger works all fine.
However, I did not get the reason for issues 2. Any one can explain that?
I installed tweepy by first cloning it:
git clone git://github.com/tweepy/tweepy.git
Copying tweepy-2.2-py2.7.egg into C:\Python27\Lib\site-packages.
Then installing it from the tweepy directory with:
python setup.py install
The final line of the installation process states:
Installed c:\users\linus\appdata\local\enthought\canopy32\user\lib\site-packages\tweepy-2.2-py2.7.egg
Processing dependencies for tweepy==2.2
Finished processing dependencies for tweepy==2.2
However, I still receive the error:
Traceback (most recent call last):
File "C:\Users\Linus\Documents\GitHub\Toxic\src\main.py", line 3, in <module>
from api.Twitter import Twitter
File "C:\Users\Linus\Documents\GitHub\Toxic\src\api\Twitter.py", line 1, in <module>
import time,tweepy,sys,json
ImportError: No module named tweepy