RequestsDependencyWarning: when running gsutil command - python-3.x

Im gettng the below error when i try to run this command on ubuntu 18
gsutil ls
/snap/google-cloud-sdk/161/lib/third_party/requests/init.py:83: RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown.
Tried to run gcloud components update but i got this error
(gcloud.components.update) You cannot perform this action because this Cloud SDK installation is managed by an external package manager.
Please consider using a separate installation of the Cloud SDK created through the default mechanism described at: https://cloud.google.com/sdk/
Am i missing anything ?

This is because your python interpreter and his dependencies are outdated, also, your Gcloud SDK package was installed via snap package, when Gcloud SDK is installed via apt repository or snap package the command gcloud components update will not work, instead you need to run the proper command to update your packages, in your case you need to run this command to update your snap packages
sudo snap refresh
To update the python's packages cryptography and request you need to install the OS package python-pip and after that update your outdated packages
sudo apt-get install python-pip
python -m pip install --upgrade cryptography
python -m pip install --upgrade requests
Since this is a warning message, you can continue working with gcloud/gsutil, but keeping your Python interpreter updated will allow you to use new functions in software written in Python, for example, the Gcloud SDK.

Related

How to install node.js v16 on VPS cPanel WHM when ea-nodejs10 installs v10.24.1?

I want to yum install xrpl to sign transactions via the xrpl.js library on a cPanel WHM VPS and have made it through How to install a Node.js Application enough that all four ea-*** RPMs, including ea-nodejs10 v10.24.1, have been installed. However, xrpl.js recommends node.js v14 while also supporting v12 & v16.
Further, package-lock.json must be installed prior to xrpl.js - yet even though WHM Edit Package shows package-lock.json added:
yum install package-lock.json throws "No package package-lock.json available." Although repeating yum install ea-nodejs10 returns "Package already installed."
So I would appreciate advice on how to install node.js v14 and package-lock.json on this system thanks.
I am now able to sign, send, and validate XRP Ledger transactions with python - hence my iOS-XRPL UI javascript brew will delegate its signing-validating to python functions.
Edit:
MobileApp-XRP Ledger blockchain Linux dedicated server xrpl-py library installation
MobileApp business XRPL transactions on MoblieAppDomainName.com browser requires a Dedicated Server, instead of a VPS, to install the required xrpl-py python library. Several guides continue to evolve for the several systems.
Present solution starts with Bluehost Linux DS Python Installation latest version 3.9.2 guide.
However the make install command attempts - and fails - to break the existing python 2.7 installation integral to the cPanel framework and needs to be replaced by make altinstall as described by Grepitout: How to Install Python 3 in cPanel Server.
Except that didn't quite work either -> What eventually worked on author's Mac OS-Linux system was Computing for Geeks: Install Python 3.9 on CentOS 8 / CentOS 7 guide:
$ ssh username#serveripaddress
sudo yum -y update
sudo yum groupinstall "Development Tools" -y
sudo yum install openssl-devel libffi-devel bzip2-devel -y
$ gcc --version
sudo yum install wget -y
wget https://www.python.org/ftp/python/3.9.7/Python-3.9.7.tgz
tar xvf Python-3.9.7.tgz
cd Python-3.9*/
./configure --enable-optimizations
sudo make altinstall
$ python3.9 --version
Python 3.9.7

How to convert multiple ipynb files (which are in GCP) to py files

Is there any way to convert ipynb files to .py
I have tried file extension change method but unable to execute the (.py) files after conversion.
I also seen a method to convert ipynb files to .py (nbconvert) but it didnt work.
----> (nbconvert method worked in my local machine)
But i need to perform operation in GCP (files which are stored in my buckets)
Below is the code which i have used to convert ipynb to py. not able to convert by this.
is there any other way?
pip install notebooktoall
from notebooktoall.transform import transform_notebook
transform_notebook(ipynb_file=”my_jupyter_notebook.ipynb”, export_list=[“html”, “py”])
You can use Google Cloud Datalab.
Cloud Datalab is built on Jupyter and is a powerful interactive tool created to explore, analyze, transform, and visualize data and build machine learning models on Google Cloud Platform.
Steps to set up and open Cloud Datalab:
First update your gcloud CLI components so you're sure you have the latest version.
gcloud components update
After that you can install through the CLI using apt or yum
sudo apt update && sudo apt upgrade google-cloud-sdk
sudo yum upgrade google-cloud-sdk
Install the datalab component
gcloud components install datalab
In case you have installed using apt or yum, use these commands to update the components:
sudo apt update && sudo apt install google-cloud-sdk-datalab
sudo yum install google-cloud-sdk-datalab
Create a datalab instance:
datalab create datalab-instance-name
Here is a link to the quickstart tutorials depending on what you need.
Basically Datalab is Google Cloud answer to use in the Google Cloud ecosystem.

Can't install azure cli on centos

I am trying to install azure-cli on centos 7 box. I am getting this error repeatedly
Error: Package: azure-cli-2.0.80-1.el7.x86_64 (azure-cli)
Requires: libpython3.6m.so.1.0()(64bit)
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
I tried to execute both commands but none of these worked for me.
Acturally, Azure CLI requires python3, it's even an executable Python package azure-cli which you can find in PyPI.org. So please make sure there is a Python 3 runtime installed in your CentOS 7.
If you want to fix your issue manually, you can try to download and install the related rpm package for Libpython3.6m.so.1.0()(64bit) from https://pkgs.org/download/libpython3.6m.so.1.0()(64bit), as the figure below.
However, the best way is to follow the offical tutorial Install Azure CLI with yum to install it in CentOS 7.
Otherwise, the other solution is as below to directly install its python package via pip.
Please check whether the Python 3 runtime had been installed in CentOS 7 via command python3 -V or python -V to see the Python version or system will remind you to install it.
Please check whether the pip or pip3 command for Python 3 runtime had been installed via pip3 -V or pip -V to see the pip version or system will remind you to install it.
Completed the two steps above, you can easily to install azure-cli via command sudo pip3 install azure-cli or sudo pip install azure-cli, it will help to install azure-cli to the system path, then you can try to use it via az --version.
You can install it by mentioning the repo/package URL
sudo yum install https://packages.microsoft.com/yumrepos/azure-cli/azure-cli-2.38.0-1.el7.x86_64.rpm
packages can be found here https://packages.microsoft.com/yumrepos/azure-cli/

How to upgrade AWS CLI to the latest version?

I recently noticed that I am running an old version of AWS CLI that is lacking some functionality I need:
$aws --version
aws-cli/1.2.9 Python/3.4.3 Linux/3.13.0-85-generic
How can I upgrade to the latest version of the AWS CLI (1.10.24)?
Edit:
Running the following command fails to update AWS CLI:
$ pip install --upgrade awscli
Requirement already up-to-date: awscli in /usr/local/lib/python2.7/dist-packages
Cleaning up...
Checking the version:
$ aws --version
aws-cli/1.2.9 Python/3.4.3 Linux/3.13.0-85-generic
From http://docs.aws.amazon.com/cli/latest/userguide/installing.html#install-with-pip
To upgrade an existing AWS CLI installation, use the --upgrade option:
pip install --upgrade awscli
On Linux and MacOS X, here are the three commands that correspond to each step:
$ curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
$ unzip awscli-bundle.zip
$ sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
This does not work:
pip install --upgrade awscli
This worked fine on Ubuntu 14.04( no need to reboot also .. You would have to first install pip3 ):
pip3 install --upgrade awscli
For Ubuntu 16.04 I used parts of the other answers and comments and just reloaded bash instead of rebooting.
I installed the aws-cli using apt so I removed that first:
sudo apt-get remove awscli
Then I could pip install (I chose to use sudo to install globally with pip2):
sudo pip install -U awscli
Since I was doing this on a server I didn't want to reboot it, but reloading bash did the trick:
source ~/.bashrc
At this point I could use the new version of aws cli
aws --version
Update: Upgrade instance using AWS CLI v1 to AWS CLI v2:
This question and answer was initially created when there was only an AWS CLI v1. There is now a AWS CLI v2. The installation instructions for the AWS CLI v2 can be found here.
The new AWS CLI v2 has different installation instructions based on whether your EC2 instance is using Linux x86 (64-bit) or Linux ARM architecture.
To upgrade to AWS CLI v2, on an EC2 instance using Linux ARM, I had to issue the following commands:
rm -rf /bin/aws
curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
./aws/install -i /usr/local/aws -b /bin
Subsequently test your AWS CLI version by executing: aws --version
For the Linux x86 (64-bit) architecture I'm hoping the commands are the same except for replacing the curl command with the following: (as per the installation instructions)
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o
"awscliv2.zip"
The AMI I used was the most recent one currently available and it was still using the AWS CLI v1. In the future if AWS starts packaging AWS CLI v2 with their AMIs this answer might require an update.
Original answer: Upgrade instance using AWS CLI v1 to use the most recent version of AWS CLI v1:
If you are having trouble installing the AWS CLI using pip you can use the "Bundled Installer" as documented here.
The steps discussed there are as follows:
$ curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
$ unzip awscli-bundle.zip
$ sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
Check your AWS CLI version subsequently as a sanity-check that everything executed correctly:
$ aws --version
If the AWS CLI didn't update to the latest version as expected maybe the AWS CLI binaries are located somewhere else as the previously-given commands assume.
Determine where AWS CLI is being executed from:
$ which aws
In my case, AWS CLI was being executed from /bin/aws, so I had to install the
"Bundled Installer" using that location as follows:
$ sudo ./awscli-bundle/install -i /user/local/aws -b /bin/aws
Try
sudo pip install --upgrade awscli, and open a new shell.
This worked well for me (no need to reboot).
Simple use
sudo pip install awscli --force-reinstall --upgrade
This will upgrade all the required modules.
On Mac you can use homebrew:
to install: brew install awscli
to upgrade: brew upgrade awscli
Make sure you don't have multiple installations: where aws
pip install awscli --upgrade --user
The --upgrade option tells pip to upgrade any requirements that are already installed. The --user option tells pip to install the program to a subdirectory of your user directory to avoid modifying libraries used by your operating system.
We can follow the below commands to install AWS CLI on UBUNTU:
sudo apt install curl
curl “https://s3.amazonaws.com/aws-cli/awscli-bundle.zip” -o
“awscli-bundle.zip”
unzip awscli-bundle.zip
sudo ./awscli-bundle/install -i /usr/local/ aws -b /usr/local/bin/aws
rm -rf awscli-bundle.zip awscli-bundle
To test: aws — version
For More Info :
https://gurudathbn.wordpress.com/2018/03/31/installing-aws-cli-on-ubuntu/
When using sudo pip install --upgrade awscli I got the following error:
ERROR: Could not install packages due to an EnvironmentError: [Errno 30] Read-only file system: '/lib'
By using sudo with -H option, I could fix the problem.
sudo -H pip install --upgrade awscli
Currently, using pip will get you the old version of awscli, 1.18.103.
The latest version of aws-cli, 2.0.33 is on the v2 branch. You can download the installer for Linux, Windows and macOS from here.
I was trying to install awscli on one of my ec2 instances where I tried both
sudo pip install --upgrade awscli,
sudo pip3 install --upgrade awscli
which didn't worked, as I was getting errors like
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-2nh71cs2/cryptography/
And rebooting servers were not an option.
Luckily, simple
sudo apt update
sudo apt install awscli worked.
I do it by removing & installing the awscli like described in this video
basically:
pip uninstall awscliv2
pip install awscliv2
pip install awscliv2==your-version
pip install awscliv
(you can keep v1 along with v2 if you want)
pip install --upgrade ...
works as well. sure.
I do not install it globally (like some ppl seems still do), btw. Because sometimes I need different v for different cases. so I keep it in separate python virtual environment.
For windows you can try this command
msiexec.exe /i https://awscli.amazonaws.com/AWSCLIV2.msi
Install or update the AWS CLI on macOS
curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg"
sudo installer -pkg ./AWSCLIV2.pkg -target /
Done!
You can verify the same with below cmd
aws --version
Try AWS Cloud Shell, Quick and easy
AWS CloudShell is a browser-based shell that makes it easy to securely manage, explore, and interact with your AWS resources. CloudShell is pre-authenticated with your console credentials.
Benefits
No extra credentials to manage
Always up to date
No cost
More Details here https://aws.amazon.com/cloudshell/
Customizable
To install globally, get on the sudo access
sudo su & then upgrade aws cli by
pip3 install --upgrade awscli

Step by step: Installing Python 3.3, Lighttpd & Pymongo on Ubuntu 12.04

I'm currently migrating to new computer and I need to reinstall the software I am using which are:
Python 3.3,
Lighttpd (newest version),
Pymongo (newest version),
Ubuntu 12.04 Desktop (The System I'm using)
I started to install Python 3.3 by downloading it from the its official website (in tar.bz2 file) and by following this tutorial. Afterwards I installed Lighttpd and changed the lighttpd.conf for Python by following this tutorial, too.
I tried several paths for my cgi.assign, none of them worked. Especially /opt/python3.3/bin/python3.3 should be working, but it shows 500 - internal Server error all the time with a "hello world" test script.
Now regardless to this problem I have no clue on installing Pymongo. If I try to intall pip OR easy_install python3.3 I have to manually download it and execute the setup.py with my python3.3 executable, right? Because this always fails with an error:
`Error missing zlib on a bundle called distribute-0.7.3 (is this even the right tool I need, because it seems to be a legacy wrapper !?) or unknown url type: https for pymongo2.6.2 itself.`
I'm getting crazy with this setup. Why is this so difficult to handle? Other programs are just a few clicks to install even on a system like Ubuntu, but these particular development tools seem to be really difficult to install.If anybody has an idea on how to install all three together or has information on a better solution please help me out.
The system is used to program Python scripts in Eclipse and trying them out directly on the system (lighttpd). The database used is MongoDB. Python and MongoDB are communicating over the Pymongo driver. I am planning to use the system on a Server distribution on release and it has to be nicely scalable on a high amount of excecutions.
Thanks for your time,
It's easiest to use the Ubuntu repositories:
sudo apt-get update
sudo apt-get install python3 python3-pip lightppd python-pymongo
Or if that only installs the python2.x pymongo, use pip, which you've just installed:
sudo pip-3.3 install pymongo
Or better yet, use a virtualenv with the help of virtualenvwrapper (docs)
sudo pip install virtualenvwrapper
... # follow instructions for installing virtualenvwrapper
mkvirtualenv --python=/usr/bin/python3 -i pymongo mongoppd
workon mongoppd
... which will segregate the environment I've called 'mongoppd' from the rest of your system so you can't cause any trouble. Then you don't need sudo to pip-3.3 install things, just workon mongoppd then pip-3.3 install [...]. Or after the -i flag when you create the virtualenv to get it installed straight away.
In general, on Ubuntu, you should hardly ever have to install something manually. Your first attempt should be using sudo apt-get install (use tab-complete to see what's available or just google "ubuntu 12.04 packages [...]" and you'll find the list of packages). Then for python use pip install or pip-3.3 install as appropriate. You'll only need to run python setup.py install if you need to install a development version of a package or something obscure that's not on pip. I don't think there's a good reason to ever use easy_install these days.

Resources