作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
问题:
当我尝试在 conda 中切换环境时出现错误,无法激活环境。奇怪的是,在 anaconda 导航器中,我可以激活另一个环境。如果可能的话,我宁愿不安装 conda new。
我试过了:
conda 更新 conda
畅达 anaconda-navigator --reset
错误:
Traceback (most recent call last):
File "D:\Programme\Anaconda3\lib\site-packages\conda\cli\main.py", line 138, in main
return activator_main()
File "D:\Programme\Anaconda3\lib\site-packages\conda\activate.py", line 1093, in main
print(activator.execute(), end='')
File "D:\Programme\Anaconda3\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u2580' in position 644: character maps to <undefined>
来自 conda 的我的系统/环境变量:
CIO_TEST=<not set>
CONDA_DEFAULT_ENV=base
CONDA_EXE=D:\Programme\Anaconda3\Scripts\conda.exe
CONDA_PREFIX=D:\Programme\Anaconda3
CONDA_PROMPT_MODIFIER=(base)
CONDA_PYTHON_EXE=D:\Programme\Anaconda3\python.exe
CONDA_ROOT=D:\Programme\Anaconda3
CONDA_SHLVL=1
CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2
GIT_LFS_PATH=D:\Programme\Git LFS
HOMEPATH=\Users\schup
NVTOOLSEXT_PATH=C:\Program Files\NVIDIA Corporation\NvToolsExt\
PATH=D:\Programme\Anaconda3;D:\Programme\Anaconda3\Library\mingw-w64\bin;D:
\Programme\Anaconda3\Library\usr\bin;D:\Programme\Anaconda3\Library\bi
n;D:\Programme\Anaconda3\Scripts;D:\Programme\Anaconda3\bin;D:\Program
me\Anaconda3;D:\Programme\Anaconda3\Library\mingw-w64\bin;D:\Programme
\Anaconda3\Library\usr\bin;D:\Programme\Anaconda3\Library\bin;D:\Progr
amme\Anaconda3\Scripts;D:\Programme\Anaconda3\bin;D:\Programme\Anacond
a3\condabin;C:\Program Files\NVIDIA GPU Computing
Toolkit\CUDA\v10.2\bin;C:\Program Files\NVIDIA GPU Computing
Toolkit\CUDA\v10.2\libnvvp;.;C:\ProgramData\DockerDesktop\version-
bin;C:\Program Files\Docker\Docker\Resources\bin;C:\Program Files
(x86)\Common Files\Oracle\Java\javapath;c:\programdata\oracle\java\jav
apath;c:\programme ▀jet java compiler\bin;c:\programme\notepad++\plug
ins\database;c:\programme\notepad++\plugins\php\ext;c:\programme\notep
ad++\plugins\php;c:\windows\system32;c:\windows;c:\windows\system32\wb
em;c:\windows\system32\windowspowershell\v1.0;c:\program
files\dotnet;c:\programme\nodejs;c:\programme\git\cmd;c:\programme\ssh
programm;c:\programme\python 3.6;c:\programme\python 3.4.1;c:\programm
e\gradle\gradle-4.1\bin;d:\programme\java\jdk1.8.0_144\bin;c:\program
files\git\cmd;d:\programme\mingw\bin;c:\users\schup\.dnx\bin;c:\progra
m files\microsoft dnx\dnvm;C:\Program Files (x86)\NVIDIA Corporation\P
hysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:
\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C
:\Program Files (x86)\Windows Live\Shared;C:\Program Files\NVIDIA
Corporation\NVIDIA NvDLISR;D:\Programme\Git LFS;C:\Program Files\Git\c
md;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\
System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program
Files (x86)\QuickTime\QTSystem;D:\Programme\MikeTex\miktex\bin\x64;C:\
Program Files\NVIDIA Corporation\Nsight Compute 2019.5.0;C:\Users\schu
p\AppData\Local\Programs\Python\Python37-32\Scripts;C:\Users\schup\App
Data\Local\Programs\Python\Python37-32;C:\Users\schup\AppData\Local\Mi
crosoft\WindowsApps;C:\Users\schup\AppData\Local\atom\bin;C:\Users\sch
up\AppData\Roaming\npm;D:\Programme\python\Scripts;D:\Programme\java\j
dk1.8.0_144\bin;C:\Users\schup\AppData\Local\GitHubDesktop\bin;C:\Prog
ram Files\JetBrains\PyCharm Community Edition
2019.2.2\bin;.;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.
0\bin;D:\Programme\Anaconda3\envs\coursera;D:\Programme\Anaconda3\envs
\coursera\Lib;C:\Program Files (x86)\Graphviz2.38;C:\Program Files
(x86)\Graphviz2.38\bin;C:\Program Files (x86)\Graphviz2.38\lib;C:\User
s\schup\AppData\Local\Microsoft\WindowsApps;C:\Users\schup\PycharmProj
ects\Workspace;C:\Users\schup\PycharmProjects\Workspace\pygame;C:\User
s\schup\PycharmProjects\Workspace\pygame snake;C:\Program
Files\JetBrains\PyCharm 2019.2.2\bin;.;C:\Users\schup\AppData\Roaming\
Python\Python37\Scripts;G:\programs\MiKTeX2.9\miktex\bin\x64
PSMODULEPATH=C:\Users\schup\Documents\WindowsPowerShell\Modules;C:\Program Files
(x86)\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell\Mod
ules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules;D:\Programme\A
utoIt3\AutoItX
PYTHONPATH=D:\Programme\Python 3.6\Lib;D:\Programme\Python
3.6\DLLs;D:\Programme\Python 3.6\Lib\tkinter
REQUESTS_CA_BUNDLE=<not set>
SSL_CERT_FILE=<not set>
VBOX_MSI_INSTALL_PATH=D:\Programme\VirtualBox\
active environment : base
active env location : D:\Programme\Anaconda3
shell level : 1
user config file : C:\Users\schup\.condarc
populated config files : C:\Users\schup\.condarc
conda version : 4.8.1
conda-build version : 3.17.6
python version : 3.7.4.final.0
virtual packages : __cuda=10.2
base environment : D:\Programme\Anaconda3 (writable)
channel URLs : https://repo.anaconda.com/pkgs/main/win-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/win-64
https://repo.anaconda.com/pkgs/r/noarch
https://repo.anaconda.com/pkgs/msys2/win-64
https://repo.anaconda.com/pkgs/msys2/noarch
package cache : D:\Programme\Anaconda3\pkgs
C:\Users\schup\.conda\pkgs
C:\Users\schup\AppData\Local\conda\conda\pkgs
envs directories : D:\Programme\Anaconda3\envs
C:\Users\schup\.conda\envs
C:\Users\schup\AppData\Local\conda\conda\envs
platform : win-64
user-agent : conda/4.8.1 requests/2.22.0 CPython/3.7.4 Windows/10 Windows/10.0.18362
administrator : False
netrc file : None
offline mode : False
最佳答案
对我来说,解决方案是设置 PYTHONIOENCODING=utf8
。无需为我手动触摸解码表。
例子:
PYTHONIOENCODING=utf8 conda activate myenv
答案取自 here .
关于python-3.x - Conda:UnicodeEncodeError: 'charmap' 编解码器无法对位置 644 中的字符 '\u2580' 进行编码:字符映射到 <undefined>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59974715/
我是一名优秀的程序员,十分优秀!