Can't install azure cli on centos - azure

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/

Related

RequestsDependencyWarning: when running gsutil command

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.

How to install python version 3.5.6 into ubuntu/ Linux?

I need to install python version 3.5.6. What are the requirements to install python 3.5.6.
python 3.6 is already installed on my local machine
What I have tried?
I looked into Python downloads. Downloaded tarball for python3.5.6.
Installed it by using following set of commands
wget https://www.python.org/ftp/python/3.5.6/Python-3.5.6.tar.xz
tar -xf Python-3.5.6.tar.xz
cd Python-3.5.6
sudo apt-get install libbz2-dev libsqlite3-dev build-essential
./configure
make
sudo make install
After installation when I run python3 -V it shows python 3.6.
Expected behaviour
python3 -V command should show python3.5.6
What I am doing wrong?
Try uninstalling it or removing the package all together from your computer. Afterwards try:
$ sudo apt-get install --reinstall python3.5
or you could try:
$ sudo aptitude reinstall python2.7
Best of luck.
python3.5 might show 3.5.6, depending on where and how things are on your PATH.
Either way, instead of manually compiling and installing Python (especially as you're side-stepping your package manager (apt) here which may cause trouble down the line), look into pyenv. After installation, approximately:
$ pyenv install 3.5.6
$ pyenv local 3.5.6
$ python
and you're ready to roll.

csvkit in2csv command not working

I followed installment instructions mentioned here
Its a simple pip install command
After that I went to my linux terminal and wrote in2csvbut got the following error:
/usr/bin/in2csv: No such file or directory
Originally I tried to install it using the command:
sudo apt-get install python3-csvkit
And the in2csv command used to work on terminal, but it appears to work under python 3 installation and I need it under my python2.7.
so I uninstalled the python3-csvkit, and installed it again using pip install, but again its not working from terminal, this way.
Any ideas why, and how to solve it?
in2csv command manual: here
I just had this problem and solved with:
sudo pip install csvkit
Without the sudo pip installs csvkit in /home/username/.local/lib/python2.7/site-packages and probably puts the executable in /home/username/.local/bin. You could avoid the sudo by adding that to your shell PATH.

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