我最近尝试将Xlwings加载项添加到我的ms-excel中,在这样做的过程中,我四处移动并删除了计算机中的一堆文件。现在我无法运行Conda,当我尝试运行任何类型的Conda命令时,我会在终端上收到下面的错误消息。
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Python path configuration:
PYTHONHOME = (not set)
PYTHONPATH = (not set)
program name = '/opt/anaconda3/bin/python'
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = '/opt/anaconda3/bin/python'
sys.base_prefix = '/opt/anaconda3'
sys.base_exec_prefix = '/opt/anaconda3'
sys.platlibdir = 'lib'
sys.executable = '/opt/anaconda3/bin/python'
sys.prefix = '/opt/anaconda3'
sys.exec_prefix = '/opt/anaconda3'
sys.path = [
'/opt/anaconda3/lib/python39.zip',
'/opt/anaconda3/lib/python3.9',
'/opt/anaconda3/lib/lib-dynload',
]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem
encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'
我看到了另一个帖子ImportError:没有名为';编码';关于这个问题,并尝试遵循那里的说明,但对我的情况没有帮助。有人能帮忙吗?我几天来一直试图解决这个问题,但没有成功,我完全没有主意。
如果您以前创建了如下环境并设置为PYTHONHOMEC: \ProgramData\Anaconda3\envs\py39将其调整回:C: \ProgramData\Anaconda3
这是因为你没有新的安装程序"envs";然而直到你:conda-create--name py39-python=3.9conda激活py39
已解决。解决方案是使用命令行安装程序而不是图形安装程序来安装anaconda3。
当我通过python c-API在c++应用程序中嵌入了一条python时,我在Windows下遇到了anaconda的问题。
我有以下错误,他们的密钥在哪里,
c:ProgramDataAnaconda3python39.zip
不存在。我创建了一个同名的文本文件,这为我解决了问题。
Python path configuration:
PYTHONHOME = (not set)
PYTHONPATH = (not set)
program name = 'python'
isolated = 0
environment = 1
user site = 1
import site = 1
[...]
sys.prefix = 'c:\ProgramData\Anaconda3'
sys.exec_prefix = 'c:\ProgramData\Anaconda3'
sys.path = [
'c:\ProgramData\Anaconda3\python39.zip',
'.\DLLs',
'.\lib',
[...],
]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'