anaconda prompt打开异常

img
anaconda prompt打开的正常情况是如上图所示的,而我的却是

img
求大神解答,跪谢!

路径不要用中文

  • 1、打开anaconda prompt
    img
  • 2、属性
    img
  • 3、复制这个,在里面找到activate.bat的路径,我的是 C:\ProgramData\Anaconda3\Scrip1ts\activate.bat
    img
  • 4、编辑器打开这个.bat文件, 一下是我的文件内容,自己对照下哈(路径啥的,自己看一下,),另外编码可能也是有可能出问题的。
    @REM Copyright (C) 2012 Anaconda, Inc
    @REM SPDX-License-Identifier: BSD-3-Clause
    @REM Test first character and last character of %1 to see if first character is a "
    @REM but the last character isn't.
    @REM This was a bug as described in https://github.com/ContinuumIO/menuinst/issues/60
    @REM When Anaconda Prompt has the form
    @REM %windir%\system32\cmd.exe "/K" "C:\Users\builder\Miniconda3\Scripts\activate.bat" "C:\Users\builder\Miniconda3"
    @REM Rather than the correct
    @REM %windir%\system32\cmd.exe /K ""C:\Users\builder\Miniconda3\Scripts\activate.bat" "C:\Users\builder\Miniconda3""
    @REM this solution taken from https://stackoverflow.com/a/31359867
    @set "_args1=%1"
    @set _args1_first=%_args1:0,1%
    @set _args1_last=%_args1:
    -1%
    @set _args1_first=%_args1_first:"=+%
    @set _args1_last=%_args1_last:"=+%
    @set _args1=

@if "%_args1_first%"=="+" if NOT "%_args1_last%"=="+" (
@CALL "%~dp0..\condabin\conda.bat" activate
@GOTO :End
)

@REM This may work if there are spaces in anything in %*
@CALL "%~dp0..\condabin\conda.bat" activate %*

:End
@set _args1_first=
@set _args1_last=

你的用户名路径是中文,anaconda会乱码。