nb_conda_kernels icon indicating copy to clipboard operation
nb_conda_kernels copied to clipboard

Failed to change to virtual environment kernel with [Python conda envs: xxx] prefix

Open Beliefuture opened this issue 3 years ago • 0 comments

When I want to change the kernel into a virtual environment through the panel and choose the prefix Python: [conda envs:xxx] one, it just can't work and print the following error message.

image

'"C:\Users\Z�-LE~1\AppData\Local\TEMP_~1\tmp6dbccs_p.bat"' is not recognized as an internal or external command,
operable program or batch file.
Could Not Find C:\Users\Z�-LE~1\AppData\Local\TEMP_~1\tmp6dbccs_p.bat
Traceback (most recent call last):
  File "E:\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "E:\Anaconda3\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "E:\Anaconda3\lib\site-packages\nb_conda_kernels\runner.py", line 72, in <module>
    exec_in_env(*(sys.argv[1:]))
  File "E:\Anaconda3\lib\site-packages\nb_conda_kernels\runner.py", line 40, in exec_in_env
    env = check_output(ecomm, shell=is_win).decode(encoding)
UnicodeDecodeError: 'gbk' codec can't decode byte 0x9c in position 77: illegal multibyte sequence
[I 14:09:09.917 NotebookApp] KernelRestarter: restarting kernel (1/5), keep random ports
The system cannot find the path specified.
'"C:\Users\Z�-LE~1\AppData\Local\TEMP_~1\tmpbpt0puxm.bat"' is not recognized as an internal or external command,
operable program or batch file.
Could Not Find C:\Users\Z�-LE~1\AppData\Local\TEMP_~1\tmpbpt0puxm.bat
Traceback (most recent call last):
  File "E:\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "E:\Anaconda3\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "E:\Anaconda3\lib\site-packages\nb_conda_kernels\runner.py", line 72, in <module>
    exec_in_env(*(sys.argv[1:]))
  File "E:\Anaconda3\lib\site-packages\nb_conda_kernels\runner.py", line 40, in exec_in_env
    env = check_output(ecomm, shell=is_win).decode(encoding)
UnicodeDecodeError: 'gbk' codec can't decode byte 0x9c in position 77: illegal multibyte sequence
[I 14:09:12.946 NotebookApp] KernelRestarter: restarting kernel (2/5), keep random ports
The system cannot find the path specified.
'"C:\Users\Z�-LE~1\AppData\Local\TEMP_~1\tmpxrqt2bbb.bat"' is not recognized as an internal or external command,
operable program or batch file.
Could Not Find C:\Users\Z�-LE~1\AppData\Local\TEMP_~1\tmpxrqt2bbb.bat
Traceback (most recent call last):
  File "E:\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "E:\Anaconda3\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "E:\Anaconda3\lib\site-packages\nb_conda_kernels\runner.py", line 72, in <module>
    exec_in_env(*(sys.argv[1:]))
  File "E:\Anaconda3\lib\site-packages\nb_conda_kernels\runner.py", line 40, in exec_in_env
    env = check_output(ecomm, shell=is_win).decode(encoding)
UnicodeDecodeError: 'gbk' codec can't decode byte 0x9c in position 77: illegal multibyte sequence
[I 14:09:15.976 NotebookApp] KernelRestarter: restarting kernel (3/5), keep random ports
The system cannot find the path specified.
'"C:\Users\Z�-LE~1\AppData\Local\TEMP_~1\tmpkxkxs0gz.bat"' is not recognized as an internal or external command,
operable program or batch file.
Could Not Find C:\Users\Z�-LE~1\AppData\Local\TEMP_~1\tmpkxkxs0gz.bat
Traceback (most recent call last):
  File "E:\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "E:\Anaconda3\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "E:\Anaconda3\lib\site-packages\nb_conda_kernels\runner.py", line 72, in <module>
    exec_in_env(*(sys.argv[1:]))
  File "E:\Anaconda3\lib\site-packages\nb_conda_kernels\runner.py", line 40, in exec_in_env
    env = check_output(ecomm, shell=is_win).decode(encoding)
UnicodeDecodeError: 'gbk' codec can't decode byte 0x9c in position 77: illegal multibyte sequence
But when I choose the not Python: [conda envs:xxx] prefix that points out to the same environment which I rename, it can find the kernel. The two red blocks point to the same virtual environment py36.

Desktop (please complete the following information):

OS: windows 10 Browser: Edge

Beliefuture avatar Oct 22 '21 15:10 Beliefuture