By default python 2.75 is installed in my machine and I installed boto3 and awcli using pip install awscli boto3 -U --ignore-installed six command. And it got installed fine, I checked,but there I can't find .aws directory in my home directory. I tried to find using locate and find commands but no use. I want to know where that directory is to add a new profile to the credentials file in the .aws directory
You have to run aws configure to have it create the ~/.aws directory.
.aws hidden directory so you need to write command ls -a. This command will provide all hidden folders.
Also I found that .aws folder gets created in the adminstrator account(user) so just take that into account while working ,as if you don't have admin power then login through that and then check like in C:\Users\Administrator.aws
Related
I have been trying to run my AWS EC2 as admin by using sudo but I'm unable to do so, It says bash- sudo command not found. and when I try to install sudo none of other commands are working. After checking I came to know all of those files like apt-get, sudo, yum are missing from my PATH /bin folder. How can I get those back or how can I install them again. I'm using AWS EC2 and Centos with cPanel on it.
So, I think I messed up bad. I was having trouble running a python file locally, and during troubleshooting, I read a post that said to run the below:
sudo chown $(my_username) ~/.aws/credentials sudo chown $(my_username) ~/.aws/config
I ran that (which presumably changed owner of those files from root to my_username), and now, when I run a python script that utilizes a pyspark session, I'm not able to read in any s3 parquet files!
Is there a way I can revert the ownership of those files back to root? Or is there a way I can just create new ones that root owns and delete the old ones? Am I even thinking about this correctly?
Please help!
You need to use braces in bash when doing parameter substitution.
sudo chown ${my_username} ~/.aws/credentials
Basically, a python script I'm running doesn't find the path to a script located in a virtualenv folder, while I can see that script from bash.
Details:
I have Python 2.7 installed globally and OpenCV3.1 installed in virtualenv, with virtualenv located at the path
~/.virtualenvs/cvcorrect
I'm trying to run a script (written by someone else) that requires loading of activate_this.py to run the script. In my case, it is located at
~/.virtualenvs/cvcorrect/bin/activate_this.py
I can see that it is there it when I look into that folder from shell. However, when I run the script, with the correct path, it gives the common
IOError: [Errno 2] No such file or directory:
'~/.virtualenvs/cvcorrect/bin/activate_this.py'
Tried running this both as regular and superuser. Same results. Running in Ubuntu 64 bit in VMWare 15.
The solution was to find and input the full path: /root/.virtualenvs/cvcorrect/bin/activate_this.py
This was not as straightforward as usual, because .virtualenvs folder was located in the root folder which was not accessible using GUI. Also, bash shell gave me the path
~/.virtualenvs/cvcorrect/bin/activate_this.py
The solution was to cd to the folder from shell and use:
readlink -f activate_this.py
Which finally gave me the correct path.
I've installed Google Cloud SDK on my laptop. The gcloud command is available/accessible via git bash from any subdirectory. However, the gcloud init command returns the following error:
/c/Program Files (x86)/Google/Cloud SDK/google-cloud-sdk/bin/gcloud:
line 191: /c/Users/me/AppData/Local/Microsoft/WindowsApps/python:
Permission denied /c/Program Files (x86)/Google/Cloud
SDK/google-cloud-sdk/bin/gcloud: line 191:
/c/Users/me/AppData/Local/Microsoft/WindowsApps/python: Permission
denied
Any idea what the issue might be or how to debug it?
Hmm, so your shell is bash? And you're on Windows apparently, so try using a cmd shell (at the start menu, hunt for cmd and run it). See if you can run python from there. If that works, then running gcloudshould probably work too.
If that doesn't work, then you've probably got python installed improperly somehow. If you didn't install it, maybe something else installed it for you as part of a package. You should probably uninstall and reinstall it (https://www.python.org/downloads/). Also check if gcloud requires any specific version of python first.
Include location of python in your path.
If it looks for some other name of python e.g. python3, include soft link to python
prompt> ln -s python python3
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!