conda update conda not working due to Windows Program Files permissions - python-2.7

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.

Related

Virtualenv and django not working in bash on windows 10

I have a problem with using virtualenv and django in bash. If I type python -m venv env in cmd, then env\Scripts\activate, and then virtualenv - I get 'virtualenv' is not recognized as an internal or external command, operable program or batch file.. If I do the same in bash I get bash: virtualenv: command not found. How do I fix this?
Try the following to resolve your issue.
Check all of the environment variables related to the software you require to be used at least.
Check the permissions for files and folders for the software.
Sometimes uninstalling and installing the software with issues can solve problems quickly.
If you have performed number 2. and you are still have errors, proceed to number 3.
You may have dependencies missing, a good tool i have used on Windows is Dependency Walker, and the software will check if any file and dependencies are missing, and you should be able to download them.
An error message may output a file is not found but in fact a dependency is missing, relating to the software you are trying to run.
Try the following steps in the terminal, it may solve your problem.
using terminal, mkdir to make a directory for your project
cd to your project folder/dir
type pip3 freeze, it will show up all the installed packages and dependencies on global scope/system
but we gonna have a venv where we will install our necessary packages and dependencies
type python3 -m venv ./venv to create venv inside your current project folder, please ensure you are inside the folder before running this command
[if you are not using python 3, then the command will be python -m venv ./venv]
to actiavte environment,
on mac, run source ./venv/bin/activate ||
on windows, run .\venv\Scripts\activate.bat [if it doesn't work, try to put your absolute path]
you can check what is installed inside venv using pip freeze, you will see nothing inside the venv
Now you can install django inside venv for your project
to deactivate the environment, just type deactivate

'gcloud init' command returns "Permission denied"

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

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!

Unable to remove the python27 folder from windows which installed on 'c:/python27'

Installed python 2.7 interpreter on windows, in the folder C:/Python27. To get pip package, downloaded get-pip.py from https://raw.githubusercontent.com/pypa/pip/master/contrib/get-pip.py following this post How do I install pip on Windows?
Executed the file get-pip.py, pip is installed, and uninstalled the python 2.7 interpreter, deleted the "Python27" but unable to delete folder. Getting "you need permission to perform this action", you require permission from the computer's administrator to make changes to this folder pip-1.5.6.dist-info
When I tried installation again I'm getting error message like this:
"The installer has insufficient privileges to access the directory : The installation cannot continue".
You must have run the pip installer using elevated privileges somehow. To delete a protected folder in Windows, right-click on the icon to open Windows Explorer, select "Run as Administrator", and enter your password if needed. You can now navigate to C:\ and delete the Python27 folder. I'm not in front of Windows at the moment, so the steps might be slightly different, but should be quite similar to what I've described.