Remote build doesn't install dependencies using python 3.2 standard runtime - iron.io

i'm uploading a worker to iron worker running Python 3.2 with in the standard environment, using my own http client directly (not the ruby or go cli) according to the REST API. However, despite having a .worker file along with my python script in a zip file and despite successfully uploading my worker, dependencies are not installed prior to the worker execution, so I get an error like that :
Traceback (most recent call last):
File "/mnt/task/pakt.py", line 3, in <module>
import requests
ImportError: No module named requests
requests module is declared in my worker file that way :
pip "requests"
How can I fix this ? thanks .

You should use the new Docker based workflow, then you can be sure you have the correct dependencies, and that everything is working, before uploading.
https://github.com/iron-io/dockerworker/tree/master/python

Related

scrapyd deployed in KubeSphere,and when running scrapy selenium got exception:'twisted.internet.error.ReactorAlreadyInstalledError'

I deploy scrapyd in KubeSphere, I got expectation when I run scrapy and selenium:
2022-03-16T12:57:15+0000 [Launcher,1832/stderr] return Crawler(spidercls, self.settings, init_reactor=True)
File "/usr/local/lib/python3.9/site-packages/scrapy/crawler.py", line 82, in __init__
default.install()
File "/usr/local/lib/python3.9/site-packages/twisted/internet/epollreactor.py", line 256, in install
2022-03-16T12:57:15+0000 [Launcher,1832/stderr] installReactor(p)
File "/usr/local/lib/python3.9/site-packages/twisted/internet/main.py", line 32, in installReactor
2022-03-16T12:57:15+0000 [Launcher,1832/stderr] raise error.ReactorAlreadyInstalledError("reactor already installed")
twisted.internet.error.ReactorAlreadyInstalledError: reactor already installed
I don't have twisted installed separately. Why does it report that it already exists?
Without code and package version, it is hard to guess what happens. If your program was once working, check your scrapy version. There is an issue in latest 2.6 version. You could pin your scrapy at 2.5.1 .
If you are under developing scrapy scripts, you might want to run multiple spiders in a script. It is easy to mess up the pipeline and get twisted.internet.error.ReactorAlreadyInstalledError error. You could check this.

Custom Block Unable to Be Found

I have an Ubuntu LTS20.04 vm with with GNU Radio installed via PPA. Following the Guided Tutorial GNU Radio in C++, I've created, built, and installed a project identical to the sample presented within.
I went to set up the objective flow graph presented at the beginning of the tutorial in GNURadio companion, but when I attempt to execute the it, I get the following error:
Warning: failed to XInitThreads()
Traceback (most recent call last):
File "/home/user/Documents/GNURadio Flowgraphs/testqpsk.py", line 38, in <module>
import tutorial
ModuleNotFoundError: No module named 'tutorial'
What steps do I need to take to resolve this? I should note that the PPA install does not seem to configure paths correctly, as I had to EXPORT GR_PREFIX=/usr to get gr_modtool to function.
The problem was that cmake's default install prefix (/usr/local) does not correspond with default Python search paths. My resolution was the following:
export PYTHONPATH=/usr/local/lib/python3/dist-packages:/usr/lib/python3/dist-packages:$PYTHONPATH
Both this export statement and the GR_PREFIX export were added to my ~/.profile.

Anaconda install of Tensorflow missing 'audio_ops' from contrib framework

I'm trying to follow along the Audio Recognition Network tutorial.
I've created an Anaconda environment with python 3.6 and followed the install instruction accordingly for installing the GPU whl.
I can run the 'hello world' TF example.
When I go to run 'train.py' in the Audio Recognition Network tutorial/example, I get:
Traceback (most recent call last):
File "train.py", line 79, in <module>
import input_data
File "/home/philglau/speech_commands/input_data.py", line 35, in <module>
from tensorflow.contrib.framework.python.ops import audio_ops as contrib_audio
ImportError: cannot import name 'audio_ops'
The code in the tutorial that fails is:
from tensorflow.contrib.framework.python.ops import audio_ops as contrib_audio
I then backed up that chain until I could import some part of it:
import tensorflow.contrib.framework as test ==> works
import tensorflow.contrib.framework.python as test --> fail:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'tensorflow.contrib.framework' has no attribute 'python'
Not sure where I'm going wrong on my install.
Details:
Ubuntu 16.04
Anaconda env with python 3.6
Followed the 'anaconda' instruction on the TF install page. (GPU version)
I also tried using a python 2.7 env for anaconda but got the same results.
It looks like they're releasing the audio_ops modules in version 1.4 (https://github.com/tensorflow/tensorflow/issues/11339#issuecomment-327879009).
Until v1.4 is released, an easy way around this is to install the nightly tensorflow build
pip install tf-nightly
or with the docker image linked in the issue comment.
The short answer:
The framework is missing the "audio_ops.py" and the example wont work until the file is released. Or you code the wrappers.
More on this:
If you go to the: tensorflow.contrib.framework.python.ops local folder you can find other *_ops.py files but not the "audio_ops.py".
If you get it from the Master at: https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/framework/python/ops
You will find the file is almost empty and with import labels wrong: "audio_ops" vs "gen_audio_ops".
With almost empty I mean that: decode_wav, encode_wav, audio_spectrogram , mfcc are not implemented/wrapped.
So, no working example and no fun.
We need to check again when "audio_ops.py" is released.
Here:
https://github.com/tensorflow/tensorflow/issues/11339
You can find a Developer saying: "we don't actually want to make them public / supported yet. I'm sorry this decision wasn't better documented"

unittest in tensorflow, python session_test.py, got a exception

I'm trying to run session_test.py from https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/client/session_test.py, So in my anaconda, tensorflow virtual env, I went to the corresponding directory in tensorflow like ../master/tensorflow/python/client/.. and run
python session_test.py
I got exception info like this:
Traceback (most recent call last):
File "session_test.py", line 32, in
from tensorflow.core.protobuf import cluster_pb2
ImportError: cannot import name 'cluster_pb2'
What package I should install or related documents that I could read about it. Is there anyone trying to do the same thing, run those unit test coming along with each module in tensorflow repo?
Please help me, thanks!
That line was added just a couple of weeks ago (see commit), and relates to a new feature being implemented in TensorFlow. Unless you have compiled and installed a very bleeding-edge version of TensorFlow you won't be able to run it. Instead, try to run the script corresponding to the version of TensorFlow that you have installed (for example, this is for version 1.1.0, the latest stable release at the time of writing).

Error with PyQtDeploy

I'm using PyQt 5.3.1 and I'm deploying with pyqtdeploy 0.4 and when i want to build a project i obtain this error message:
Generating code...
Cleaning E:\ProgramasPython3\PythonQT\QTCalculator\build.
Freezing C:\Users\Tobal\AppData\Local\Temp\bootstrap_py3.py
Freezing E:\ProgramasPython3\PythonQT\QTCalculator\qtcalculator.py
Freezing E:/ProgramasPython3/PythonQT\QTCalculator\__init__.py
Freezing E:/ProgramasPython3/PythonQT\QTCalculator\calculator_ui.py
Freezing E:/ProgramasPython3/PythonQT\QTCalculator\img_rc.py
Freezing E:/ProgramasPython3/PythonQT\QTCalculator\qtcalculator.py
Freezing C:\Python34\libs\site-packages\PyQt5\__init__.py
Unable to freeze C:\Python34\libs\site-packages\PyQt5\__init__.py.
Traceback (most recent call last):
File "C:\Users\Tobal\AppData\Local\Temp\freeze.py", line 103, in <module>
freeze_as_data(py_file, options.as_data)
File "C:\Users\Tobal\AppData\Local\Temp\freeze.py", line 36, in freeze_as_data
code = _get_marshalled_code(py_filename)
File "C:\Users\Tobal\AppData\Local\Temp\freeze.py", line 71, in _get_marshalled_code
source_file = open(py_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Python34\\libs\\site-packages\\PyQt5\\__init__.py'
I think this is a bug. someone does know how to fix it?
Thanks
Did you build PyQt5 statically? The host and target Python are two different things, and often in different directories. The target Python has PyQt module built statically, the host Python must also have PyQt5 installed (because pyqtdeploy uses Qt for its GUI) but its usually a dynamic library in the host Python.
In the pyqtdeploy GUI on "Locations" tab, make sure that "Standard library directory" is correct.