Re: Jenkins Python Job

2023-08-11 Thread Mahryama issifu
Thank you Mark. 
That was very helpful

BW
Mari

> On 10 Aug 2023, at 22:50, Mark Waite  wrote:
> 
> 
> 
> On Thursday, August 10, 2023 at 3:35:54 PM UTC-6 Mari wrote:
> 
> Hi Mark
> I have checked the Jenkins build agent I am using, and it as python3.6.8 
> installed. I don’t understand why the program is choosing python 2 packages. 
> Do I have to check which python version or path is being used by the build 
> agent. 
> 
> I made some changes to my codes: before importing ‘matplotlib.pyplot’ I set 
> the ‘marplotlib’ backend to non interractive one, such as ‘Agg’.
> Like this: 
> import matplotlib
> matplotlib.use('Agg')  # This line should be before importing pyplot
> import matplotlib.pyplot as plt
> 
> I then proceeded to build on jenkins and that worked out. 
> 
> However, there is a new error code on Jenkins again.
> 
> 
> 
> That's not a Jenkins error.  That's a configuration error on your agent.  If 
> you login on that agent as the same user that is running the Jenkins agent, 
> you'll see the same message.
> 
> The operating system on that agent is configured to provide Python 2 
> libraries from the system directories (/usr/lib64/python2.7) but is executing 
> Python 3 code.  You'll need to fix the operating system configuration on the 
> agent.
> 
> Talk to your local experts that understand how your chosen operating system 
> is configured.  Remote debugging of an operating system configuration error 
> will be too painful and slow for you.
> 
> Mark Waite
>  
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to jenkinsci-users+unsubscr...@googlegroups.com 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jenkinsci-users/c317ee85-81db-4bcf-9805-90f993da71f6n%40googlegroups.com
>  
> .
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/828DA088-444C-43BE-9E56-EA0ACDFA1B6C%40gmail.com.


Jenkins Python Job

2023-08-10 Thread Mahryama issifu
Hi All,

I have a job running on Jenkins server, which builds python script. The script 
has to display a bar chart as final output.
The build agent I am using on Jenkins appears to have python installed. I 
confirmed this by adding a build step as python3 —version and the result was: 
Python 3.6.8.

Why then do I have this error showing. Do I need to install a plugin? 

Kind regards 
Mari





Traceback (most recent call last)
File "newjenkins.py", line 7, in 
import matplotlib.pyplot as plt
File "/usr/lib64/python2.7/site-packages/matplotlib/pyplot.py", line 97, in 

  _backend_mod, new_figure_manager, draw_if_interactive, _show = 
pylab_setup()
File "/usr/lib64/python2.7/site-packages/matplotlib/backends/__init__.py", 
line 25, in pylab_setup
  globals(),locals(),[backend_name])
File 
"/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_gtkagg.py", 
line 10, in 
  from matplotlib.backends.backend_gtk import gtk, FigureManagerGTK, 
FigureCAnvasGTK, \
File 
"/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_gtk.py", line 
13, in 
  import gtk, gdk = gtk.gdk
File "/usr/lib64/python2.7/site-packages/gtk-2.0/gtk/__init__.py", line 64, 
in 
  _init()
File "/usr/lib64/python2.7/site-packages/gtk-2.0/gtk/__init__.py", line 52, 
in _init
_gtk.init_check()
RuntimeError: could not open display

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/C172989F-137A-459F-9697-1AF213A08142%40gmail.com.