AWS cli installation on Mac with anaconda python - amazon-web-services

I am installing aws cli on Mac. Previously I installed anaconda to control my python versions. So I installed python using conda. Now I want to install aws cli.
By using pip:
pip3 install awscli --upgrade --user
The installation was successful. However, when I run
aws --version
It told me that aws command was not found.
I again tried to add it to the command line path. But I could not find where it was installed.
When I run
which python
It gave me
/anaconda/bin/python
People say this might not be the real folder and it is true I could not find aws cli under it either.
I then run
ls -al /anaconda/bin/python
It gives
lrwxr-xr-x 1 mac staff 9 Aug 15 20:14 /anaconda/bin/python -> python3.6
I dont understand the path at all.
How could I find where my aws cli installed?

I ran into the same issue and eventually found the awscli command in ~/.local/bin. Just add /Users/<username>/.local/bin to your $PATH.
You can do this by editing ~/.bash_profile, which probably already has these lines in it:
# added by Anaconda3 4.4.0 installer
export PATH="/Users/<username>/anaconda/bin:$PATH"
You could make another copy of this line but replace the anaconda path with the new one, but I just updated the existing path since the two are related:
# added by Anaconda3 4.4.0 installer
export PATH="/Users/<username>/.local/bin:/Users/<username>/anaconda/bin:$PATH"

I solved the problem by using conda to install awscli.
conda install -c conda-forge awscli
worked so far. It seems that pip install does not work for conda installed python... Is this conclusion true?

If it's installing and then saying "command not found" it probably just means that the executable it has installed is not referenced in the operating systems PATH environment variable.
Here is how to add the downloaded executable to PATH: https://docs.aws.amazon.com/cli/latest/userguide/cli-install-macos.html#awscli-install-osx-path
Here is the AWS docs to troubleshoot the issue: https://docs.aws.amazon.com/cli/latest/userguide/troubleshooting.html

I encountered an identical situation.
I solved this by adding the location of the awscli command to the file...
/etc/paths
The location to my awscli command was where others had found it...
~/.local/bin
From my home directory in Mac OS X Terminal, I entered a quick nano command to edit the /etc/paths file...
sudo nano /etc/paths
#For those who don't know...
#sudo is to get admin access
#nano is quick and dirty file editor.
# /etc/paths is the file you want to edit.
I entered my password, then I just added the awscli command location at the end of the file...
/Users/UpAndAtThem/.local/bin
Yours might be be...
/Users/your_username_here/.local/bin
Still in Nano editor to exit and save: Hit control+X > Hit Y > Hit Enter.
Here's a quick video...
https://youtu.be/htb_HTwtgmk
Good luck!

Related

Unable to install AWS SAM Cli on Mac

I am trying to install AWS SAM Cli on my Mac because I am trying to learn the AWS services. But I have installed the AWS cli successful using bundle. But when I tried to install the AWS SAM Cli as well. But it is not working. This is what I have done so far.
Run this command
pip install --user aws-sam-cli
Everything went fine.
Then I opened and edited the ~/.bash_profile. This is the content of the .bash_profile
export PATH=/Applications/MAMP/bin/php/php7.2.7/bin:$PATH
# Find your Python User Base path (where Python --user will install packages/scripts)
$ USER_BASE_PATH=$(python -m site --user-base)
# Update your preferred shell configuration
-- Standard bash --> ~/.bash_profile
-- ZSH --> ~/.zshrc
export PATH=$PATH:$USER_BASE_PATH/bin
Then I closed the terminal and run sam --version.
It is saying command not found. What is wrong with my installation?
The now recommended way to install SAM CLI is to use brew and honestly it's way better, saves you a lot of headaches, like the one you're facing now. See these instructions for details.

Missing AWS Dependency

i had a case where i need to configure an AWS structure similar to the architecture that is described in this article, is but this article is old, when i followed the steps i couldn't pass the step at which i run the script "vip_monitor.sh".
so be specific, at the step 5 by running the script i got the following error
Can't open /etc/profile.d/aws-apitools-common.sh
that shell script doesn't exist in the whole machine, how to solve this issue?
Thanks in advance
You will have to set api tools manually.
Ubuntu makes their own AMI's for Amazon, and they don't build the apitools into the images.
You can use official ubuntu documentation to fix these:
Install ec2 api tools
sudo apt-add-repository ppa:awstools-dev/awstools
sudo apt-get update
sudo apt-get install ec2-api-tools
actually i installed the ec2-api-tools J.Parashar instructed, and when i ran the script vip_monitor.sh it gave me the same error so i just took the missing script aws-apitools-common.sh file from an Amazon Linux instance and paste it at the path /etc/profile.d/ and then changed the mode to the script to executable chmod +x aws-apitools-common.sh and ran the script 'vip_monitor.sh'.
if you had the error :Unexpected operator run the script with bash ./vip_monitor.sh

conda update conda not working due to Windows Program Files permissions

I installed Anaconda for Python 2.7 for all users on my Windows 10 machine. When I try to update it via conda update conda I get the following error:
# You don't appear to have the necessary permissions to update packages
# into the install area 'C:\Program Files\Anaconda2'.
# However you can clone this environment into your home directory and
# then make changes to it.
# This may be done using the command:
#
# $ conda create -n my_root --clone=C:\Program Files\Anaconda2
Yet when I try to clone it into my home directory, I get the error:
PermissionError: [WinError 5] Access is denied: 'C:\\Program Files\\Anaconda2\\pkgs\\menuinst-1.4.1-py27_0.tmp'
Is there a way to solve this? I've been Googling but haven't found a clear solution.
Go to the start manual, find Anaconda Command Prompt. Right click on the icon and run it as an administrator (if you are). Then do the conda update as usual.
Ok so I installed Anaconda for myself only (instead of all users) and this solved the problem. Conversely, you can install Anaconda for all users and change the installation directory from 'Program Files' to your home directory and that should work. Quite a pain.
Same error i got. Run windows powershell as adminstrator and run the command it will execute.

pip not working on windows python 2.7.9

I've installed Python 2.7.9, which comes with already bundled with pip. I've check that it's there in the modules list.
But when I run pip install
I get
SyntaxError: invalid syntax
With install highlighted as the error?
What am I doing wrong?
Seems like you are running pip install from Python interactive console. Instead, you should run it from Windows console (cmd or PowerShell):
python2.exe -m pip install <package_name>
Where python2.exe is executable for Python2.7.9 (you may need to include full path to the executable file) and <package_name> is the name of package you want to install
Append C:\Python27\Scripts;in PATH variable
where C:\Python27\Scripts; is the path where pip script is located.
I faced the same issue and got to know that the error is because it is not able to find the pip.exe to execute.
You need to check the path : C:\Python27\Scripts
There, you will find the .exe file and if you run the command from that folder, the command should not give you the error or while running the command, please provide entire path instead of just pip command.
just put python before pip
python pip install <package_name>
To install try the following command:
python.exe -m install web.py
what i would suggest is navigate to the location where pip is located and try with the following command :
Pip install
enter image description here
Probably you want to install Python Modules? I really did many tries, So Finally reached on point to install Python3.6. It offers most easiest way to install it's modules, Try this way
https://stackoverflow.com/a/46652413/8145641
Soon's anwser worked for me, with slight difference, without 2 after python:
python.exe -m pip install <package_name>
What I don't understand, is that this should be equal to the command in interactive console as following, isn't it ?
pip -m install <pachage_name>

Trouble install PIP Windows

I have read posts on here but something doesn't seem to work. I am new to Python dev. I am running windows 7 64bit.
I am trying to install pip which I have downloaded and have easy_install in my c:\python27\scripts directory. When I use powershell and type
"python easy_install pip"
I get the error message:
"can't open file easy_install": [Errno 2] No such file or directory.
This seems odd as I can see the easy_install.exe is in that directory.
I have added c:\python27\scripts to my system PATH but, to be honest, I am not sure if this is right.
Could someone please help?
Thank you.
The selected answer dint fix it
This did:
python -m pip install -U pip
The best way to fix this is to compile easy_install yourself. First download the source code, and then compile it using python.
1 - Go here.
2 - Then extract the file, using 7-zip, or any software that can unzip a tar file. This is a tar.gz file, so after one extraction, it will give you the tar file, and then it will give you the actual directory and files for setup tools
3 - Go into the directory where you stored the contents of the extraction (using command prompt). For example, if you stored the directory on your desktop, you cd Desktop and then you go
cd dir_where_easy_install_is.
4 - Then run this command python setup.py install
That will install easy_install for you.
5 - Go back to your command line again, and then just type in easy_install pip, and that will install pip.
Then go ahead, and test it out, by installing django, just go into your command prompt, and enter this pip install django. After the download and the install, type in pip list, and see if django is in there. If it is, then pip has been successfully installed.
This worked running python from it's main dir against the easy_install.py in the extracted setuptools directory.
Then pip files should be in the Scripts dir.
Don't forget to run your CMD as administrator.