'gcloud init' command returns "Permission denied" - google-cloud-platform

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

Related

Python script can't find virtualenv path

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.

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

C:\Windows\system32>pip install pandasFatal error in launcher: Unable to create process using '"'

I have recently installed python-2.7.14 (32-bit) on windows 10. But when I try to install any package using command pip install XXX, it gives me above error.
I tried all solution to this existing problem but it didn't work for me.
My python is installed on C:\Python27
python -m pip install XXX
worked for me but when I tried to open jupyter notebook in windows command prompt by typing
jupyter notebook
It used to give me the same Fatal error.
Actually, it was my antivirus mcafee at organisational level which was blocking the exe to run.
To solve this I had installed python in D:\ folder.

AWS cli installation on Mac with anaconda python

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!

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.