问题
After installing Anaconda 4.3.1, Spyder and Anaconda Navigator do not run. When trying anaconda-navigator through the Anaconda Prompt, I get as an end error:
binstar_client.errors.BinstarError: O:: The system cannot find the path specified
conda config --show:
(C:\Anaconda3) C:\Windows\system32>conda config --show
add_anaconda_token: True
add_pip_as_python_dependency: True
allow_softlinks: True
always_copy: False
always_softlink: False
always_yes: False
auto_update_conda: True
binstar_upload: None
changeps1: True
channel_alias: https://conda.anaconda.org
channel_priority: True
channels:
- defaults
client_ssl_cert:
client_ssl_cert_key:
create_default_packages: []
debug: False
default_channels:
- https://repo.continuum.io/pkgs/free
- https://repo.continuum.io/pkgs/r
- https://repo.continuum.io/pkgs/pro
- https://repo.continuum.io/pkgs/msys2
disallow: []
envs_dirs:
- C:\Anaconda3\envs
- C:\Users\Geo01\AppData\Local\conda\conda\envs
- O:\.conda\envs
json: False
offline: False
proxy_servers: {}
quiet: False
shortcuts: True
show_channel_urls: None
ssl_verify: True
track_features: []
update_dependencies: True
use_pip: True
verbosity: 0
So the problem seems to be that under envs_dirs I have an O:\ .conda\envs entry, and it seems to be set as the home directory for Anaconda. O: is a network drive on this machine, and I have no write permission on it. I want to remove this entry from envs_dirs, but somehow can't.
What I have tried so far and it has not worked:
reinstalling Anaconda with the network drive disconnected still results in O:\ being the home drive
reinstalling Anaconda without automatic PATH through the installer and adding it later
reinstalling Anaconda with Run as Administrator
conda config remove-key envs_dirs :
CondaKeyError: Error with key 'envs_dirs': key 'envs_dirs' is not in the config file
set CONDA_ENVS_PATH=C:\Anaconda3\envs;C:\Users\Geo01\AppData\Local\conda\conda\envs
put a .condarc file of my creation under C:\Anaconda3 with the following contents:
envs_dirs:
-C:\Anaconda3\envs
-C:\Users\Geo01\AppData\Local\conda\conda\envs
===========================================================
A similar question has been asked before, with no answer, yet.
回答1:
Problem was occuring because the HOME and HOMEDRIVE python environmental variables were set to O:.
This could be checked by os.environ['HOME'] in another python interpreter on the computer (in this case, from QGIS).
I fixed it by putting
import os
os.environ['HOME']='C:\\'
os.environ['HOMEDRIVE']='C:'
at the beginning of the spyder-script.py and anaconda-navigator-script.py under C:\Anaconda3\Scripts
来源:https://stackoverflow.com/questions/49158684/anaconda-installation-points-to-network-drive-as-home-folder-cannot-start-spyd