In my VS Code, I got the Python extension running, Python 3.6.1 and Anaconda3 installed. When I copy and paste some code, VS Code asked me to install autopep8. When I press "Yes", it shows a box as .
First I chose "Install using Conda". Next, the following error message pops out and it failed to properly install autopep8:
PS D:\Python> conda activate base
CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
If using 'conda activate' from a batch script, change your
invocation to 'CALL conda.bat activate'.
To initialize your shell, run
$ conda init <SHELL_NAME>
Currently supported shells are:
- bash
- cmd.exe
- fish
- tcsh
- zsh
- powershell
See 'conda init --help' for more information and options.
IMPORTANT: You may need to close and restart your shell after running 'conda init'.
PS D:\Python> & conda install --name base autopep8
Collecting package metadata (current_repodata.json): failed
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/main/win-64/current_repodata.json>
Elapsed: -
An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
If your current network has https://www.anaconda.com blocked, please file
a support request with your network engineering team.
'https://repo.anaconda.com/pkgs/main/win-64'
I don't understand what the message means. Can anyone help me?
Ok I figured the solution to this problem. The root cause is that my Powershell is not configured to allow scripts from running in my system. Here are the steps if anyone has this problem too:
Set-ExecutionPolicy -ExecutionPolicy Unrestricted
and pick Y
conda init powershell
and runYour installation under conda failed because you have not set up your shell to use conda. The instructions are a little down in the error message on how to set this up:
To initialize your shell, run
$ conda init <SHELL_NAME>
Currently supported shells are:
- bash
- cmd.exe
- fish
- tcsh
- zsh
- powershell
See 'conda init --help' for more information and options.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.