Using Jenkins to run Python script but having issue importing modules on the script - python

I am really new to Jenkins and Python so when I have initially researched for this problem, there has been a limit to my understanding. I am looking to write a Python script and for it to be run on Jenkins as part of some automated testing I wish to do. My script interacts with an API and hence imports the 'requests' module on Python. It works fine using the Python interpreter on my local machine but I have had issues when I have tried using the Jenkins Python script builder and so I am looking for a way around this.
As I mentioned, I have looked around the internet for solutions but as my knowledge on this topic is limited I have found it difficult to understand certain ideas that have been mentioned on the web. One lead I have had is related to the use of virtual environments on Jenkins, but as its something I've never used, I have struggled implementing it. I have installed the ShiningPanda Plugin on Jenkins, but I am unsure how to use it.
Any help given is greatly appreciated :)
Thanks

Related

Program not running using existing python virtual environment in intellij

Since last many months I was using intellij idea comfortably but suddenly something went wrong and all my existing projects are not running now. I have the python virtual environment in SDK section along with all the libraries. see here but then also my programs are not working at all. [](https://i.stack.imgur.com/Ck9Bi.png)
See this
some days back All these programs were working perfectly fine. I need help. This is very frustrating.
unfortunately, there is not enough information to provide a proper solution. Please get in touch with IDE support via Help | Contact support...

How to get libCEC for Python (PyCharm on Windows)?

I am unfortunately an absolute beginner in programming.
First of all, I'm programming with the PyCharm IDE on a Windows computer, but the script will later run on a RaspberryPi.
I want to turn on my TV with a Python script via HDMI-CEC and I came across libcec.
However, I can't figure out the setup instructions for Windows.
https://github.com/trainman419/python-cec
Can anyone give me a step by step guide on what exactly I need to do to use the CEC commands in Python?
Or should I program with PyCharm directly on the RaspberryPi? This one is way too slow for this task in my opinion. Then I could install the CEC library very easily.
Thanks for your help.

Utilizing python code within swift using 3rd party software

so I'm pretty new to both swift and stack, but I have a problem with implimenting Pythonkit. But basically to provide a short summary, the kit basically allows you to be able to utilize python inside of swift (using certain swift functions in order to save variables, do functions, however, can execute the code of a .py file).
In the process of doing this however this error pops up
Fatal error: Python library not found. Set the PYTHON_LIBRARY environment variable with the path to a Python library.: file /Users/****/Library/Developer/Xcode/DerivedData/Y******L-
So I tried updating my Python software to 3.0 and above (I'm not quite sure, I think it was 3.7), however when I run python it shows it is at version 2.7. This kind of confused me a bit, however it was until the error did I notice something was wrong. Why does it show that error? What does it mean?
(I did find a similar post with a similar error in stack overflow, however I don't have enough reputation to comment as well as I don't think the answer was addressed to what I wanted so I'm just going to continue writing here)
The swift code itself has updated (xcode11) and following the steps a lot of the functions have changed within Xcode, what is it that I did wrong that caused the error? Following the link it seems I have to utilize pyto? Checking that link the functions of pyto are different than the ones pf PythonKit. In PythonKit you can utilize python within your swift code, while pyto seems to be a python integration for iOS?
Any advice? And please ask if anything needs clarification, or if there's a different solution please tell me. Thanks,Vince

Updating Python module in Matlab

I'm trying to run a Python script using Matlab's built-in py. It's pretty simple, but I'm running into some difficulty drying to debug an error in my code (which runs fine testing in my Python IDE but crashes when run through Matlab).
The issue is that Matlab seems to be caching the module the first time I call a function, and I can't figure out how to get it to recognize changes to the module without restarting Matlab. Is anyone aware of a way to avoid this issue?
This is the first limitation listed on the MATLAB documentation's Limitations to Python Support page:
Editing and reloading a Python® module in the same MATLAB session. To
use an updated module, restart MATLAB
Sorry. That said, that page might help you figure out what the issue is, as there are other limitations that might be coming into play. You might also find their page about troubleshooting Python errors useful.

Intellij IDEA OSX Python Development Headaches

I recently started working at a Java shop where staff primarily use IntelliJ IDEA on Macs for development. I am in charge of writing automated tests for a data centric project, and my go-to language for this is Python. In the past, I have used PyCharm on Linux and Windows with great success, but configuring IntelliJ IDEA for Python on OSX has been confusing to me. So far, I have had no issues setting up a project and getting it to run Python scripts, but each time I try using the debugger, I get the following error:
/usr/bin/python: can't open file '/Users/{USER}/Library/Application Support/helpers/pydev/pydevd.py': [Errno 2] No such file or directory
So far, Googling around has turned up hardly anything useful - and most of JetBrains's help manuals are PyCharm focused, which is rather unhelpful in the IntelliJ context. Has anyone else come across something like this? I'm looking for insight into what exactly is going wrong here.
Try uninstalling and re-installing the plugin? There's definitely something wrong with the path above, it should have an IntelliJ<version number> between the Application Support/python and the helpers (at least by what's on my system). I am running IntelliJ 13 with the python plugin and have been able to debug without any problems with it.

Categories

Resources