简体   繁体   中英

Unable to activate Conda environment as 'chcp' and 'cmd' is not recognized as internal or external command operable program

I am currently on the newest Anaconda3-5.0.1, Python 3.6 and using Windows 8 (during the Anaconda installation I ticked the add to PATH option). On Anaconda Prompt, I created a new conda env and Anaconda tells me to activate it with

 activate newenv

However, this error code pops up

 'chcp' is not recognized as an internal or external command, operable program or batch file
 'cmd' is not recognized as an internal or external command, operable program or batch file
 'cmd' is not recognized as an internal or external command, operable program or batch file 

Any ideas? I have tried this on Anaconda Prompt

set PATH=C:\Users\WIN8.1\Anaconda3\envs\newenv\Scripts;C:\Users\WIN8.1\Anaconda3\envs\newenv;%PATH%

However this is still unsuccessful as when i checked

conda info --envs

I can see the environment newenv I just created on the list, but the * sign is still next to root. The individual paths are also set correctly but not until the Scripts folder.

Would really appreciate help. Thanks so much guys.

I think first you should add the PATH where 'cmd' and 'chcp' located to the environment. (usually in C:\\Windows\\System32, you should check it out first) Then add the path, go to:

Control Panel -> Advanced System settings -> Environment Variables -> Path -> Edit

=====> Then add "C:\\Windows\\System32\\" or "%SystemRoot%\\System32;%SystemRoot%"

It worked for the others but actually this didnt work for me, then I run the command as

cd C:\Windows\System32 

activate [environment name]

(it means that I have to activate the environment where 'cmd' and 'chcp' located . It's weird, but it worked for me.)

Hope it helps.

In my case, I changed the values order for Path System variable - now I have C:\\Windows\\System32 set as the first value. I have also added C:\\Windows\\System32 in the Path user variable.

I had the problem but for installing matplotlib.

I changed my environment variable with C:\\windows\\system32, closed the Anaconda prompt and reopened as administrator. Executing the command as administrator made it work.

Here are some links which helped my researches :

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM