Conda and anaconda-navigator not starting

Hi
I installed ananconda under windows 11 without admin right. after installation, conda or ananconda-naviogator launched normally, it works.

however, after restart the pc, all conda command, "conda env list " or “conda activate my-env” will generate the following error and the anancond-naviogator can not be launched.
please help to fix it

>>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

Traceback (most recent call last):
  File "C:\Users\user1\AppData\Local\anaconda3\Lib\site-packages\conda\exception_handler.py", line 17, in __call__
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user1\AppData\Local\anaconda3\Lib\site-packages\conda\cli\main.py", line 54, in main_subshell
    parser = generate_parser(add_help=True)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user1\AppData\Local\anaconda3\Lib\site-packages\conda\cli\conda_argparse.py", line 127, in generate_parser
    configure_parser_plugins(sub_parsers)
  File "C:\Users\user1\AppData\Local\anaconda3\Lib\site-packages\conda\cli\conda_argparse.py", line 354, in configure_parser_plugins
    else set(find_commands()).difference(plugin_subcommands)
             ^^^^^^^^^^^^^^^
  File "C:\Users\user1\AppData\Local\anaconda3\Lib\site-packages\conda\cli\find_commands.py", line 71, in find_commands
    for entry in os.scandir(dir_path):
                 ^^^^^^^^^^^^^^^^^^^^
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'C:\\Downloads"'

$ C:\Users\user1\AppData\Local\anaconda3\Scripts\conda-script.py --version

environment variables:
CIO_TEST=
CONDA_ALLOW_SOFTLINKS=false
CONDA_EXE=C:/Users/user1/AppData/Local/anaconda3\Scripts\conda.exe
CONDA_ROOT=C:\Users\user1\AppData\Local\anaconda3
CURL_CA_BUNDLE=
HOMEPATH=\Users\user1
LD_PRELOAD=
PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\Sys
tem32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program
Files\dotnet;C:\Program Files (x86)\NVIDIA
Corporation\PhysX\Common;C:\Program Files\PuTTY;C:\Program
Files\Git\cmd;C:\Downloads";C:\Program Files\nodejs;C:\Program Files\n
odejs;C:\Users\user1\AppData\Local\anaconda3;C:\Users\yuandan
.zhang\AppData\Local\anaconda3\Library\mingw-
w64\bin;C:\Users\user1\AppData\Local\anaconda3\Library\usr\bin
;C:\Users\user1\AppData\Local\anaconda3\Library\bin;C:\Users\y
uandan.zhang\AppData\Local\anaconda3\Scripts;C:\Users\user1\Ap
pData\Local\Microsoft\WindowsApps;C:\Users\user1\AppData\Local
\Programs\Microsoft VS Code\bin
PSMODULEPATH=d:.RedirFolders\user1\My
Documents\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell
\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules
REQUESTS_CA_BUNDLE=
SSL_CERT_FILE=

 active environment : None
   user config file : C:\Users\user1\.condarc

populated config files : C:\Users\user1.condarc
conda version : 23.7.4
conda-build version : 3.26.0
python version : 3.11.4.final.0
virtual packages : __archspec=1=x86_64
__cuda=12.2=0
__win=0=0
base environment : C:\Users\user1\AppData\Local\anaconda3 (writable)
conda av data dir : C:\Users\user1\AppData\Local\anaconda3\etc\conda
c
package cache : C:\Users\user1\AppData\Local\anaconda3\pkgs
C:\Users\user1.conda\pkgs
C:\Users\user1\AppData\Local\conda\conda\pkgs
envs directories : C:\Users\user1\AppData\Local\anaconda3\envs
C:\Users\user1.conda\envs
C:\Users\user1\AppData\Local\conda\conda\envs
platform : win-64
user-agent : conda/23.7.4 requests/2.31.0 CPython/3.11.4 Windows/10 Windows/10.0.22621
administrator : False
netrc file : None
offline mode : False

An unexpected error has occurred. Conda has prepared the above report.
If you suspect this error is being caused by a malfunctioning plugin,
consider using the --no-plugins option to turn off plugins.

Example: conda --no-plugins install

Alternatively, you can set the CONDA_NO_PLUGINS environment variable on
the command line to run the command without plugins enabled.

Example: CONDA_NO_PLUGINS=true conda install

If submitted, this report will be used by core maintainers to improve
future releases of conda.
Would you like conda to send this report to the core maintainers? [y/N]:

Yuandan

1 Like

I’m having the exact same issue. I also have a Mac and this issue does not happen on the Mac.

Check your System Env Path, there is a double-quote in your PATH. Remove all double-quote would work.

image

  File "C:\Users\jeyaraman_kssmart\anaconda3\lib\site-packages\conda\cli\find_commands.py", line 71, in find_commands
    for entry in os.scandir(dir_path):
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: '.C:\\Windows\\system32'

go to the find_commands.py in that 71 lines
except (FileNotFoundError, NotADirectoryError, PermissionError) change into

  except (FileNotFoundError, NotADirectoryError, PermissionError,OSError):

now the error is cleared

2 Likes

I got the same error and tried your sol .
I works know thanks a lot

Facing the below error can any one look into it

(base) C:\Users\punya>conda

>>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

Traceback (most recent call last):
  File "C:\ProgramData\anaconda3\Lib\site-packages\conda\exception_handler.py", line 17, in __call__
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\ProgramData\anaconda3\Lib\site-packages\conda\cli\main.py", line 54, in main_subshell
    parser = generate_parser(add_help=True)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ProgramData\anaconda3\Lib\site-packages\conda\cli\conda_argparse.py", line 127, in generate_parser
    configure_parser_plugins(sub_parsers)
  File "C:\ProgramData\anaconda3\Lib\site-packages\conda\cli\conda_argparse.py", line 354, in configure_parser_plugins
    else set(find_commands()).difference(plugin_subcommands)
             ^^^^^^^^^^^^^^^
  File "C:\ProgramData\anaconda3\Lib\site-packages\conda\cli\find_commands.py", line 71, in find_commands
    for entry in os.scandir(dir_path):
                 ^^^^^^^^^^^^^^^^^^^^
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: "'C:\\Users\\punya\\AppData\\Local\\Programs\\Python\\Python312\\Scripts"

$ C:\ProgramData\anaconda3\Scripts\conda-script.py

environment variables:
CIO_TEST=
CONDA_DEFAULT_ENV=base
CONDA_EXE=C:\ProgramData\anaconda3\condabin..\Scripts\conda.exe
CONDA_EXES=“C:\ProgramData\anaconda3\condabin..\Scripts\conda.exe”
CONDA_PREFIX=C:\ProgramData\anaconda3
CONDA_PROMPT_MODIFIER=(base)
CONDA_PYTHON_EXE=C:\ProgramData\anaconda3\python.exe
CONDA_ROOT=C:\ProgramData\anaconda3
CONDA_SHLVL=1
CURL_CA_BUNDLE=
HOMEPATH=\Users\punya
LD_PRELOAD=
PATH=C:\ProgramData\anaconda3;C:\ProgramData\anaconda3\Library\mingw-
w64\bin;C:\ProgramData\anaconda3\Library\usr\bin;C:\ProgramData\anacon
da3\Library\bin;C:\ProgramData\anaconda3\Scripts;C:\ProgramData\anacon
da3\bin;C:\ProgramData\anaconda3\condabin;C:\Program Files\Eclipse Ado
ptium\jdk-21.0.1.12-
hotspot\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:
\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C
:\Program Files\Amazon\AWSCLIV2;C:\Program
Files\Docker\Docker\resources\bin;C:\Program Files\Git\cmd;'C:\Users\p
unya\AppData\Local\Programs\Python\Python312\Scripts;C:\Users\punya\Ap
pData\Local\Programs\Python\Python312\Scripts;C:\Program
Files\Snowflake SnowSQL;C:\Program Files\dotnet;C:\Program
Files\Graphviz\bin;C:\Program Files\Graphviz 2.44.1\bin;C:\Users\punya
\AppData\Local\Programs\Python\Launcher;C:\Users\punya\AppData\Local\M
icrosoft\WindowsApps;.;C:\Users\punya\AppData\Local\Programs\Microsoft
VS Code\bin;C:\Users\punya.dotnet\tools
PSMODULEPATH=C:\Program

That fixed it for me. Thanks!