Can't install Apns on my debian GCE instance - python

I have a GCE instance with Debian wheezy on it, I'm running my phython/Django code (my beckend) for an IOS application.
I'm trying to use a TSL push notification library but I'm failing to install it
sudo easy_install apns -
got an error: Setup script exited with error: file '/tmp/easy_install-sOkSjl/apns-2.0/apns-send' does not exist
sudo pip install apns -
got an Exception & error: [Errno 104] Connection reset by peer
sudo pip install pyapns -
didn't work either
if I copy it to my GCE instance how do I install & configure it, in Github documentation only states how to use easy_install.

When I was trying to install apns using pip, I also got the "apns-send does not exist" message. This was solved by downloading this script from their git repo and placing it in the build folder (in my case, build/apns).
For some reason, it seems it is not included in the version on PyPI.

Related

How to force install all dependencies in virtualenv?

I am trying to deploy my flask app on AWS Lambda by using Zappa. I carefully followed all the tutorials but I always get deployment error :
Error: Warning! Status check on the deployed lambda failed. A GET request to '/' yielded a 502 response code.
I entered zappa tail and I figured out that the dependencies are not installed even after I made pip freeze > requirements.txt . The problem is, there are a lot of dependencies and it really boring to install each of them manually.
Is there any magic command that will allow me to automatically install all dependencies in the virtualenv ?
Why don't you just run
pip install -r requirements.txt?

AWS - install python packages while deploying EC2 server

i am currently working on a project where I need to deploy python application on my EC2 instance. I cannot seem to figure out how to install packages on my EC2 instance during application installation. I have tried installation via "requirements.txt" file
mysql-connector-python==8.0.22
as well as via .ebextenstion/01_packages.config file that looks as following:
packages:
yum:
mysql-connector-python: '8.0.22'
requests: '2.24.0'
BUT every time is deploy new version of my application i get an error and updated list of packages is not installed.
Any assistance is highly appreciated.
I verified on EB Python 3.7 AL2 version 3.1.4 that the following requirements.txt works:
mysql-connector-python==8.0.22
requests==2.24.0
Thus if you have other issues, they are not caused by the requirements.txt on that platform.
Ended up creating setup.config file in my .ebextentions, where I configured command to install required packages.
commands:
install_requests:
command: "pip install requests"
install_wheel:
command: "pip install wheel"
install_mysql-connector-python:
command: "pip install mysql-connector-python"

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

How to run a local script on a remote server using my local python installation?

I have a local script that I want to run on a remote server using my local python installation. I need to do this because I have specific packages installed which I am unable to install on the remote server.
I tried two solutions I found but neither are working.
ssh user#remote python -u < script.py
and
cat script.py | ssh user#remote python -
Both of the above give me the ImportError for a module installed only on my local machine. I definitely have access to run code on the server using their installation but cannot install anything myself.
I tried to clone the server's python but get this error:
user#server:~$ conda create -n my_root --clone="/opt/anaconda"
Source: /opt/anaconda
Destination: /home/user/.conda/envs/my_root
The following packages cannot be cloned out of the root environment:
- conda-4.3.17-py27_0
- conda-env-2.6.0-0
Fetching package metadata .........
Packages: 153
Files: 0
ERROR conda.core.link:_execute_actions(335): An error occurred while
installing package 'defaults::pycairo-1.10.0-py27_0'.
IOError(13, 'Permission denied')
Attempting to roll back.
IOError(13, 'Permission denied')
If python is installed on the remote machine all you need to do is pip install any modules that you are using in script.py. You can check if it's installed with python -V.
It's not possible to run scripts on a remote server unless it's set up to allow you to do so. As you can imagine, it would be a pretty severe security vulnerability if you could!
What is it that you're trying to achieve?
If there is a restriction that you can not install the module on the server's global pip directory, you can use the Python virtual environment to virtually isolate your script from the server operating system install modules.

openstack ceiolometer is throwing unknown error while installing

I have installed pre setting(setuptools, pbr and other rpm), and then I am running following cmd to install:
**sudo python setup.py install
error in setup command: Error parsing /home/skumar/ceilometer/setup.cfg: OSError: [Errno 2] No such file or directory**
I can't get the problem.
My setup.cfg file is:
https://github.com/openstack/ceilometer/blob/stable/icehouse/setup.cfg
Ran into a similar problem trying to install a new python-neutronclient. I didn't know anything about pbr, but apparently it uses it. I found from here that git needed to be installed. Once I installed git and re-ran setup.py install, it gave me a different error:
error in setup command: Error parsing /tmp/python-neutronclient-contrail-icehouse/setup.cfg: Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. Are you sure that git is installed?
I removed the unzipped directory, checked it out via git, installed python-dev, and re-ran the setup.py install with success.

Categories

Resources