江月年年只相似Xuan 2022-07-07 14:45 采纳率: 71.4%
浏览 305
已结题

anaconda激活虚拟环境、创建都报错

使用anaconda时报错,之前曾经使用联想电脑管家更新过一次(纯属误操作),导致anaconda和pycharm都更新,当时更新结束后重新配置环境都成功,一周以后出现此情况:


(base) C:\Users\82776>activate python363
WARNING conda.exceptions:print_unexpected_error_report(1246): KeyError('pkgs_dirs')
Traceback (most recent call last):
  File "E:\StudyTools\Anaconda\conda\lib\site-packages\conda\exceptions.py", line 1114, in __call__
    return func(*args, **kwargs)
  File "E:\StudyTools\Anaconda\conda\lib\site-packages\conda\cli\main.py", line 110, in main_sourced
    print(activator.execute(), end="")
  File "E:\StudyTools\Anaconda\conda\lib\site-packages\conda\activate.py", line 172, in execute
    return getattr(self, self.command)()
  File "E:\StudyTools\Anaconda\conda\lib\site-packages\conda\activate.py", line 146, in activate
    builder_result = self.build_activate(self.env_name_or_prefix)
  File "E:\StudyTools\Anaconda\conda\lib\site-packages\conda\activate.py", line 294, in build_activate
    return self._build_activate_stack(env_name_or_prefix, False)
  File "E:\StudyTools\Anaconda\conda\lib\site-packages\conda\activate.py", line 308, in _build_activate_stack
    prefix = locate_prefix_by_name(env_name_or_prefix)
  File "E:\StudyTools\Anaconda\conda\lib\site-packages\conda\base\context.py", line 1712, in locate_prefix_by_name
    envs_dirs = context.envs_dirs
  File "E:\StudyTools\Anaconda\conda\lib\site-packages\conda\base\context.py", line 533, in envs_dirs
    return mockable_context_envs_dirs(self.root_writable, self.root_prefix, self._envs_dirs)
  File "E:\StudyTools\Anaconda\conda\lib\site-packages\conda\base\context.py", line 107, in mockable_context_envs_dirs
    fixed_dirs += join(user_data_dir(APP_NAME, APP_NAME), 'envs'),
  File "E:\StudyTools\Anaconda\conda\lib\site-packages\conda\_vendor\appdirs.py", line 67, in user_data_dir
    path = os.path.join(_get_win_folder(const), appauthor, appname)
  File "E:\StudyTools\Anaconda\conda\lib\site-packages\conda\_vendor\appdirs.py", line 265, in _get_win_folder_with_pywin32
    from win32com.shell import shellcon, shell
ImportError: DLL load failed while importing shell: 找不到指定的程序。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "E:\StudyTools\Anaconda\conda\lib\site-packages\conda\exceptions.py", line 1244, in print_unexpected_error_report
    message_builder.append(get_main_info_str(error_report['conda_info']))
  File "E:\StudyTools\Anaconda\conda\lib\site-packages\conda\cli\main_info.py", line 237, in get_main_info_str
    info_dict['_' + key] = ('\n' + 26 * ' ').join(info_dict[key])
KeyError: 'pkgs_dirs'

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

    Traceback (most recent call last):
      File "E:\StudyTools\Anaconda\conda\lib\site-packages\conda\exceptions.py", line 1114, in __call__
        return func(*args, **kwargs)
      File "E:\StudyTools\Anaconda\conda\lib\site-packages\conda\cli\main.py", line 110, in main_sourced
        print(activator.execute(), end="")
      File "E:\StudyTools\Anaconda\conda\lib\site-packages\conda\activate.py", line 172, in execute
        return getattr(self, self.command)()
      File "E:\StudyTools\Anaconda\conda\lib\site-packages\conda\activate.py", line 146, in activate
        builder_result = self.build_activate(self.env_name_or_prefix)
      File "E:\StudyTools\Anaconda\conda\lib\site-packages\conda\activate.py", line 294, in build_activate
        return self._build_activate_stack(env_name_or_prefix, False)
      File "E:\StudyTools\Anaconda\conda\lib\site-packages\conda\activate.py", line 308, in _build_activate_stack
        prefix = locate_prefix_by_name(env_name_or_prefix)
      File "E:\StudyTools\Anaconda\conda\lib\site-packages\conda\base\context.py", line 1712, in locate_prefix_by_name
        envs_dirs = context.envs_dirs
      File "E:\StudyTools\Anaconda\conda\lib\site-packages\conda\base\context.py", line 533, in envs_dirs
        return mockable_context_envs_dirs(self.root_writable, self.root_prefix, self._envs_dirs)
      File "E:\StudyTools\Anaconda\conda\lib\site-packages\conda\base\context.py", line 107, in mockable_context_envs_dirs
        fixed_dirs += join(user_data_dir(APP_NAME, APP_NAME), 'envs'),
      File "E:\StudyTools\Anaconda\conda\lib\site-packages\conda\_vendor\appdirs.py", line 67, in user_data_dir
        path = os.path.join(_get_win_folder(const), appauthor, appname)
      File "E:\StudyTools\Anaconda\conda\lib\site-packages\conda\_vendor\appdirs.py", line 265, in _get_win_folder_with_pywin32
        from win32com.shell import shellcon, shell
    ImportError: DLL load failed while importing shell: 找不到指定的程序。

`$ E:\StudyTools\Anaconda\conda\Scripts\conda-script.py shell.cmd.exe activate python363`

  environment variables:
conda info could not be constructed.
KeyError('pkgs_dirs')

An unexpected error has occurred. Conda has prepared the above report.

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?
  • 写回答

1条回答 默认 最新

  • CSDN-Ada助手 CSDN-AI 官方账号 2022-07-08 06:01
    关注
    这篇文章:Anaconda虚拟环境配置踩坑 也许有你想要的答案,你可以看看
    同时,你还可以查看手册:python- 创建虚拟环境 中的内容
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 10月25日
  • 已采纳回答 10月17日
  • 创建了问题 7月7日

悬赏问题

  • ¥35 用python实现除法算法中goldschmidt算法
  • ¥15 汇编代码转换成C代码
  • ¥15 除法算法中的归一化具体是怎么变的?
  • ¥20 集成电路的逻辑电路和晶体管简化图
  • ¥15 下载windows builder后的问题
  • ¥15 按要求对程序的逻辑进行更正
  • ¥50 悬赏帮写C++编程 诚信
  • ¥15 端口连接数为什么会有限制
  • ¥15 安卓数据提交之后格式不对
  • ¥15 需要数据库运行的图片