Unable to start ara - ara

I have installed ara as per documentation
https://ara.readthedocs.io/en/stable/installation.html
however when I try to access it from url it does not load. I am not sure where are the ara logs.
Kindly find below information from logs
[jim#centos74.master /data/OnlyOnMyPC/ansible]type ara
ara is /bin/ara
[jim#centos74.master /data/OnlyOnMyPC/ansible]file /bin/ara
/bin/ara: Python script, ASCII text executable
[jim#centos74.master /data/OnlyOnMyPC/ansible]/bin/ara
Traceback (most recent call last):
File "/bin/ara", line 11, in <module>
sys.exit(main())
File "/usr/lib/python2.7/site-packages/ara/shell.py", line 73, in main
return aracli.run(argv)
File "/usr/lib/python2.7/site-packages/cliff/app.py", line 279, in run
result = self.interact()
File "/usr/lib/python2.7/site-packages/cliff/app.py", line 318, in interact
from .interactive import InteractiveApp
File "/usr/lib/python2.7/site-packages/cliff/interactive.py", line 20, in <module>
import cmd2
File "/usr/lib/python2.7/site-packages/cmd2.py", line 226, in <module>
import gtk
File "/usr/lib64/python2.7/site-packages/gtk-2.0/gtk/__init__.py", line 64, in <module>
_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
[jim#centos74.master /data/OnlyOnMyPC/ansible]systemctl status ara
Unit ara.service could not be found.
I would greatly appreciate your assistance.
End game is to have ara working so we can see statistical information of playbooks etc
Thank you

I'm the author of ara and just came across this question.
The quick start guide in the README should hopefully allow you to get started: https://github.com/ansible-community/ara#quickstart
If you have any questions, please feel free to reach out to us on Slack or IRC.
Thanks !

Related

onnxruntime: Given model could not be parsed while creating inference session. Error message: Protobuf parsing failed

According to the example code mentioned below the library. I have followed the example code but it didn't work.
[Library] https://github.com/notAI-tech/NudeNet/
Code
from nudenet import NudeClassifier
import onnxruntime
classifier = NudeClassifier()
classifier.classify('/home/coremax/Downloads/DETECTOR_AUTO_GENERATED_DATA/IMAGES/3FEF7B75-3823-4153-8490-87483AAC6ABC'
'.jpg')
I have also followed the previous solution on StackOverflow but it didn't work
Error on running Super Resolution Model from ONNX
Traceback (most recent call last):
File "/snap/pycharm-community/276/plugins/python-ce/helpers/pydev/pydevd.py", line 1491, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "/snap/pycharm-community/276/plugins/python-ce/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/home/coremax/Documents/NudeNet/main.py", line 3, in <module>
classifier = NudeClassifier()
File "/home/coremax/Documents/NudeNet/nudenet/classifier.py", line 37, in __init__
self.nsfw_model = onnxruntime.InferenceSession(model_path)
File "/home/coremax/anaconda3/envs/AdultNET/lib/python3.6/site-packages/onnxruntime/capi/session.py", line 158, in __init__
self._load_model(providers or [])
File "/home/coremax/anaconda3/envs/AdultNET/lib/python3.6/site-packages/onnxruntime/capi/session.py", line 166, in _load_model
True)
RuntimeError: /onnxruntime_src/onnxruntime/core/session/inference_session.cc:238 onnxruntime::InferenceSession::InferenceSession(const onnxruntime::SessionOptions&, const onnxruntime::Environment&, const string&) status.IsOK() was false. Given model could not be parsed while creating inference session. Error message: Protobuf parsing failed.
I know it is too late but hope this helps someone build a very useful software.
why it fails
the error is that for NudeClassifier to work it has to download the onnx model from this link
but github now requires you to be logged in to download any file so the constructor for the NudeClassifier fails as it tries to download this model
Solution
create a folder in your user's home folder with the name .NudeNet/
download the model from this link
save the model in the folder you created in step one
you should now have the model at the following path ~/.NudeNet/classifier_model.onnx
now you're ready to go good luck!

Multimodal activity generator (SAGA) for SUMO - KeyError while running

I am currently in the process of using SAGA to generate a scenario for my OSM file. However, I keep getting the error below.
File "scenarioFromOSM.py", line 398, in <module>
main(sys.argv[1:])
File "scenarioFromOSM.py", line 317, in main
'{}/contributed/saga/defaults/activitygen.json'.format(os.environ['SUMO_TOOLS']),
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/os.py", line 675, in __getitem__
raise KeyError(key) from None
KeyError: 'SUMO_TOOLS'
Could anyone help me resolve this? Thanks!
Needed to declare it.
export SUMO_TOOLS="$SUMO_HOME"/tools

Is there another library I have missed before running chatterbot?

I've tried to create a chatbot program using the chatterbot library. It produced some errors which beat all attempts to resolve. Finally, I went to the chatterbot documentation online and copy/pasted the first example chatterbot code and run it in my editor. This produced the same errors. So I want to know if there is some library I have missed perhaps, what that library is and the version of the library to install?
I've run the example code from https://chatterbot.readthedocs.io/en/stable/examples.html Simple Example (as found below). It has produced the same errors.
from chatterbot import ChatBot
from chatterbot.trainers import ListTrainer
# Create a new chat bot named Charlie
chatbot = ChatBot('Charlie')
trainer = ListTrainer(chatbot)
trainer.train([
"Hi, can I help you?",
"Sure, I'd like to book a flight to Iceland.",
"Your flight has been booked."
])
# Get a response to the input text 'I would like to book a flight.'
response = chatbot.get_response('I would like to book a flight.')
print(response)
I expect to have a prompt at the terminal that allows input and produces a response. I got a list of error instead.
Traceback (most recent call last):
File "/Users/ikwame.amofa/PycharmProjects/trychat/main.py", line 3, in <module>
from chatterbot import ChatBot
File "/Users/ikwame.amofa/PycharmProjects/trychat/venv/lib/python3.7/site-packages/chatterbot/__init__.py", line 4, in <module>
from .chatterbot import ChatBot
File "/Users/ikwame.amofa/PycharmProjects/trychat/venv/lib/python3.7/site-packages/chatterbot/chatterbot.py", line 2, in <module>
from chatterbot.storage import StorageAdapter
File "/Users/ikwame.amofa/PycharmProjects/trychat/venv/lib/python3.7/site-packages/chatterbot/storage/__init__.py", line 1, in <module>
from chatterbot.storage.storage_adapter import StorageAdapter
File "/Users/ikwame.amofa/PycharmProjects/trychat/venv/lib/python3.7/site-packages/chatterbot/storage/storage_adapter.py", line 3, in <module>
from chatterbot.tagging import PosHypernymTagger
File "/Users/ikwame.amofa/PycharmProjects/trychat/venv/lib/python3.7/site-packages/chatterbot/tagging.py", line 4, in <module>
from chatterbot.tokenizers import get_sentence_tokenizer
File "/Users/ikwame.amofa/PycharmProjects/trychat/venv/lib/python3.7/site-packages/chatterbot/tokenizers.py", line 4, in <module>
from chatterbot.corpus import load_corpus, list_corpus_files
File "/Users/ikwame.amofa/PycharmProjects/trychat/venv/lib/python3.7/site-packages/chatterbot/corpus.py", line 5, in <module>
from chatterbot_corpus.corpus import DATA_DIRECTORY
ModuleNotFoundError: No module named 'chatterbot_corpus'
First of all, put your error message in a code tag,
Secondly, you forgot to install the library. Install it using:
pip install chatterbot-coprus

iPython won't start anymore after using os.dup2()

I was just trying out the os.dup2() function to redirect outputs, when I was typing in os.dup2(3,1), which my ipython (2.7) didn't seem to like.
It crashed and now it won't start again, yielding the error:
Traceback (most recent call last):
File "/usr/bin/ipython", line 8, in <module>
launch_new_instance()
File "/usr/lib/python2.7/dist-packages/IPython/frontend/terminal/ipapp.py", line 402, in launch_new_instance
app.initialize()
File "<string>", line 2, in initialize
File "/usr/lib/python2.7/dist-packages/IPython/config/application.py", line 84, in catch_config_error
return method(app, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/IPython/frontend/terminal/ipapp.py", line 312, in initialize
self.init_shell()
File "/usr/lib/python2.7/dist-packages/IPython/frontend/terminal/ipapp.py", line 332, in init_shell
ipython_dir=self.ipython_dir)
File "/usr/lib/python2.7/dist-packages/IPython/config/configurable.py", line 318, in instance
inst = cls(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/IPython/frontend/terminal/interactiveshell.py", line 183, in __init__
user_module=user_module, custom_exceptions=custom_exceptions
File "/usr/lib/python2.7/dist-packages/IPython/core/interactiveshell.py", line 456, in __init__
self.init_readline()
File "/usr/lib/python2.7/dist-packages/IPython/core/interactiveshell.py", line 1777, in init_readline
self.refill_readline_hist()
File "/usr/lib/python2.7/dist-packages/IPython/core/interactiveshell.py", line 1789, in refill_readline_hist
include_latest=True):
File "/usr/lib/python2.7/dist-packages/IPython/core/history.py", line 256, in get_tail
return reversed(list(cur))
DatabaseError: database disk image is malformed
If you suspect this is an IPython bug, please report it at:
https://github.com/ipython/ipython/issues
or send an email to the mailing list at ipython-dev#scipy.org
You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.
Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
c.Application.verbose_crash=True
can anyone help me with that?
Reposting as an answer:
That looks like fd 3 is your IPython history database, and you redirected stdout to it and corrupted it.
To get it to start again, remove or rename ~/.ipython/profile_default/history.sqlite (or ~/.config/ipython/profile_default/history.sqlite on certain IPython versions on Linux).

matplotlib gtk issue

Firstly, I know very very little about Python, Xwindows, Matplotlib or GTK. I am trying to run a tool called SpliceGrapher which uses the above. I get an (ugly, sorry) error:
/usr/lib64/python2.6/site-packages/gtk-2.0/gtk/__init__.py:57: GtkWarning: could not open display
warnings.warn(str(e), _gtk.Warning)
/home/my/bin/lib64/python2.6/site-packages/matplotlib/backends/backend_gtk.py:52: GtkWarning: gdk_cursor_new_for_display: assertion `GDK_IS_DISPLAY (display)' failed
cursors.MOVE : gdk.Cursor(gdk.FLEUR),
Traceback (most recent call last):
File "/home/my/bin/SpliceGrapher-0.2.0/scripts/view_splicegraphs.py", line 28, in <module>
from pylab import *
File "/home/my/bin/lib64/python2.6/site-packages/pylab.py", line 1, in <module>
from matplotlib.pylab import *
File "/home/my/bin/lib64/python2.6/site-packages/matplotlib/pylab.py", line 264, in <module>
from matplotlib.pyplot import *
File "/home/my/bin/lib64/python2.6/site-packages/matplotlib/pyplot.py", line 95, in <module>
new_figure_manager, draw_if_interactive, _show = pylab_setup()
File "/home/my/bin/lib64/python2.6/site-packages/matplotlib/backends/__init__.py", line 25, in pylab_setup
globals(),locals(),[backend_name])
File "/home/my/bin/lib64/python2.6/site-packages/matplotlib/backends/backend_gtkagg.py", line 10, in <module>
from matplotlib.backends.backend_gtk import gtk, FigureManagerGTK, FigureCanvasGTK,\
File "/home/my/bin/lib64/python2.6/site-packages/matplotlib/backends/backend_gtk.py", line 52, in <module>
cursors.MOVE : gdk.Cursor(gdk.FLEUR),
RuntimeError: could not create GdkCursor object
If anyone has any idea what I can do, that would be great.
I am on a Linux (RedHat) system, through puTTy using Xming. I have X11 configured and xeyes shows the little eyes that follow my mouse so I know thats working.
New error:
16:00:46 view_splicegraphs.py Started
Traceback (most recent call last):
File "/home/bmoran/bin/SpliceGrapher-0.2.0/scripts/view_splicegraphs.py", line 164, in <module>
g = getFirstGraph(f)
File "/home/bmoran/bin/lib64/python2.6/site-packages/SpliceGrapher/SpliceGraph.py", line 371, in getFirstGraph
result = SpliceGraphParser(f, **args).next()
File "/home/bmoran/bin/lib64/python2.6/site-packages/SpliceGrapher/SpliceGraph.py", line 1351, in __init__
self.loadFromFile()
File "/home/bmoran/bin/lib64/python2.6/site-packages/SpliceGrapher/SpliceGraph.py", line 1424, in loadFromFile
raise ValueError("Graph feature found before graph header at line %d" % lineNo)
ValueError: Graph feature found before graph header at line 1
/usr/lib64/python2.6/site-packages/gtk-2.0/gtk/__init__.py:57: GtkWarning: could not open display
Tells you your script does not have an access to your X session.
Can you post here your script?
Did you access the machine with ssh -XC ... ?
on the shell when you issue echo $DISPLAY what do you see?
When you add in your script print os.getenv("DISPLAY") do you see the same result?
one more note ... I don't know Xming but I can recommend you to try MobaXterm, it has a builtin ssh and X11 server compiled for Windows, and my guess is that it will solve your X problem.