Cronitor CLI usage is different from documentation - python

I'm trying to install the Cronitor CLI on a Raspberry Pi running Raspbian. I've followed the steps from here, swapping amd64 for arm and taking /local/ out of the third command to match to where I put it with the second command. The specific commands I used were:
curl -sOL https://cronitor.io/dl/linux_arm.tar.gz
sudo tar xvf linux_arm.tar.gz -C /usr/bin/
sudo /usr/bin/cronitor configure --api-key [my api key]
When I run "cronitor discover" after installing I get the following usage message:
usage: cronitor [-h] [--apiKey APIKEY] [--id ID] [--code CODE] [--msg MSG]
(--run | --complete | --fail | --ok | --pause PAUSE)
I haven't been able to find anywhere online where this usage is specified, and I'm not sure why this is different from what the documentation says. I do have the Cronitor python3 package installed using "sudo pip3 install cronitor", but my understanding is that it should not interfere, right? Any help would be appreciated.
To resolve the issue I have uninstalled both the CLI and the Python package and tried to reinstall the CLI without the Python package installed. It gives me the same results.
EDIT: For anyone stumbling across this same error in the future, "sudo cronitor" works as intended! Use sudo to access the CLI!

Related

rabbitmq command breaks all pip install

New to MQTT and Linux world.
I am following this link to set up my Mqtt broker on Raspberry Pi 4.
after running this command
# import PackageCloud signing key
wget -O - "https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey" | sudo apt-key add -
and followed its instruction, I ran this:
curl -s https://packagecloud.io/install/repositories/rabbitmq/rabbitmq-server/script.python.sh | bash
All my pip install are failing.
for example:
$ pip3 install PyMail
Looking in indexes: https://pypi.org/simple, https://packagecloud.io/rabbitmq/rabbitmq-server/pypi/simple
Collecting PyMail
Could not install packages due to an EnvironmentError: 404 Client Error: Not Found for url: https://packagecloud.io/rabbitmq/rabbitmq-server/pypi/simple/pymail/
How can I fix it?
follow this link, complete and working commands for rmq setup:
And you can use pika for connecting ur rmq via python
https://computingforgeeks.com/how-to-install-latest-erlang-on-ubuntu-18-04-lts/
https://computingforgeeks.com/how-to-install-latest-rabbitmq-server-on-ubuntu-18-04-lts/
I have tried to remove my pip3 and re-install it.
Surprisingly, even after removal and re-installation, the error is still there~!!!
This is how I solved this problem:
I opened the pip configuration file which is located:(depending on different OS, the file could locate at different place. Mine is Raspbian Buster 10)
$HOME/.pip/pip.conf
In its content I saw this:
[global]
extra-index-url=https://packagecloud.io/rabbitmq/rabbitmq-server/pypi/simple
then I removed the packagecloud url and restarted my terminal.
problem solved.
I think some scripts in this file:
https://packagecloud.io/install/repositories/rabbitmq/rabbitmq-server/script.python.sh
modified the pip config

PJSUA/PJSIP - Unable to increase support to 32 accounts/transports/calls

I've tried various attempts using config_site.h during build, and had little to no improvement... Still stuck at 8 accounts. Code is:
import pjsua
lib = pjsua.Lib()
lib.init()
lib.start()
transport = lib.create_transport(pjsua.TransportType.UDP)
for x in range(10):
lib.create_account_for_transport(transport)
And:
Assertion failed: (pjsua_var.acc_cnt < (sizeof(pjsua_var.acc)/sizeof(pjsua_var.acc[0]))), function pjsua_acc_add, file ../src/pjsua-lib/pjsua_acc.c, line 401.
This issue seems not only to be a PJSUA/PJSIP issue, but a platform specific issue (Mac OS X) as the (nearly) identical steps were performed on Ubuntu 15.10 and it was able to create additional accounts with no issue.
Steps completed on working Ubuntu 15.10 install:
sudo ./configure CFLAGS=-fPIC CXXFLAGS=-fPIC
sudo make dep && make
sudo make
cd pjsip-apps/src/python
sudo make
sudo python setup.py install
Note: Issues during make dep (pjsip) and sudo make (python lib) required running sudo make and sudo python setup.py install again to properly complete install.
These same steps, completed on a Mac OS X 10.11 platform, does not allow for additional transports nor additional accounts to be created. Will attempt a second question specifically addressing transports.

How do I install pip in python 2.7?

My end goal is to install the requests module, and the way to do that seems to be with pip. I have looked through the pip install documentation here http://www.pip-installer.org/en/latest/installing.html
The documentation has offered me no help. It tells me to "securely download get-pyp.py". I have been searching for a way to do this, and so far, everything I have seen recommends the command
curl --silent --show-error --retry 5 https://raw.github.com/pypa/pip/master/contrib/get-pip.py | sudo python2.7
I have been unable to figure out how to use this command. Curl is not a python command. I installed curl for windows and ran this command in windows command line, which worked, but I was unable to proceed from there. Is this intended to be installed with windows command line, or something else? I am lost.
You can first install easy_install (which is part of set up tools) from the following location
https://pypi.python.org/pypi/setuptools#windows
Right click on the link and save the file ez_setup.py and then run it.
Once that is complete and you have added the scripts to your path variable (C...Python2.7..scripts), you can install pip using
easy_install pip
Check out this video for more help.
http://www.youtube.com/watch?v=MIHYflJwyLk&feature=youtu.be
Download the correct version from here: http://www.lfd.uci.edu/~gohlke/pythonlibs/#pip
And can find more info in this question: How do I install pip on Windows?

Howto enable rpy2 in python using ports?

I know that there are several questions touching this problem, but I can hardly figure out, if there is one solution for my problem. I am using Mac 10.6.8, MacPorts 2.1.3.
Here I refer to one discussion here on SO, where my issue seems to be addressed. This is, what I have done:
$ sudo port install py-rpy2 # seemed to be fine. A
$ python -m 'rpy2.tests' # gave the output
usr/bin/python: No module named rpy2
$ /opt/local/bin/python2.7 -m 'rpy2.tests # results in a
'Segmentation fault' # and MacOS is complaining..
After upgrading all outdated packages and
$ sudo port -f uninstall py-rpy2
$ sudo port -f install py-rpy2
... the same as above.<br>
$ sudo easy_install rpy2
throws many errors and ends with
'error: Setup script exited with error: command 'gcc-4.2' failed with exit status 1'
You can find full output here.
I have only a
/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/
path, 2.7 has no
/Library/Frameworks/Python.framework/Versions/
entry.
localhost:~$ ls /opt/local/bin/python*
/opt/local/bin/python2.4
/opt/local/bin/python3.3 /opt/local/bin/python2.6
/opt/local/bin/python3.3-config /opt/local/bin/python2.6-config
/opt/local/bin/pythonw2.6 /opt/local/bin/python2.7
/opt/local/bin/pythonw2.7 /opt/local/bin/python2.7-config
/opt/local/bin/pythonw3.3
$ which python
'/usr/bin/python'
This one is Python 2.6.1.

How to build sqlite for Python 2.4?

I would like to use pysqlite interface between Python and sdlite database. I have already Python and SQLite on my computer. But I have troubles with installation of pysqlite. During the installation I get the following error message:
error: command 'gcc' failed with exit status 1
As far as I understood the problems appears because version of my Python is 2.4.3 and SQLite is integrated in Python since 2.5. However, I also found out that it IS possible to build sqlite for Python 2.4 (using some tricks, probably).
Does anybody know how to build sqlite for Python 2.4?
As another option I could try to install higher version of Python. However I do not have root privileges. Does anybody know what will be the easiest way to solve the problem (build SQLite fro Python 2.4, or install newer version of Python)? I have to mention that I would not like to overwrite the old version version of Python.
Thank you in advance.
You can download and install Python to your home directory.
$ cd
$ mkdir opt
$ mkdir downloads
$ cd downloads
$ wget http://www.python.org/ftp/python/2.6.2/Python-2.6.2.tgz
$ tar xvzf Python-2.6.2.tgz
$ cd Python-2.6.2
$ ./configure --prefix=$HOME/opt/ --enable-unicode=ucs4
$ make
$ make install
Then, (if you are using bash) in your .bash_profile do
export PATH=$HOME/opt/bin/:$PATH
export PYTHONPATH=$HOME/opt/lib:$HOME/opt/lib/site-packages:$PYTHONPATH
Then, source the file to make it available
$ cd
$ source .bash_profile
$ python -V
where python -V will return the python version. If the correct version appears, any packages that you run with Python's setup.py util (assuming the developer followed the correct conventions) will install in ~/opt/lib/python2.x/site-packages directory.
Download pysqlite here, cd into the directory you downloaded to, unpack the tarball:
$ tar xzf pysqlite-2.5.5.tar.gz
then just do (if your permissions are set right for this; may need sudo otherwise):
$ cd pysqlite-2.5.5
$ python2.4 setup.py install
one error does appear in the copious output:
File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/pysqlite2/test/py25tests.py", line 48
with self.con:
^
SyntaxError: invalid syntax
since as clearly shown that file is for py 2.5 tests only (with statement not present in 2.4!-). Nevertheless the install is successful:
$ python2.4 -c'import pysqlite2'
$
All this is on Mac OS X 10.5 but using python2.4 separately installed from the system-supplied Python 2.5.
The error you report doesn't tell us much -- maybe you're missing the headers or libraries for sqlite itself? Can you show us other output lines around that single error msg...?
If you don't have root privileges, I would recommend installing a more recent version of Python in your home directory and then adding your local version to your PATH. It seems easier to go that direction than to try to make sqlite work with an old version of Python.
You will also be doing yourself a favor by using a recent version of Python, because you'll have access to the numerous recent improvements in the language.
I had the same trouble with gcc failing with Ubuntu Karmic. I fixed this by installing the python-dev package. In my case, I'm working with python2.4, so I installed the python2.4-dev package. The python-dev package should work for python2.6.

Categories

Resources