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

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日

悬赏问题

  • ¥15 求京东批量付款能替代天诚
  • ¥15 slaris 系统断电后,重新开机后一直自动重启
  • ¥15 51寻迹小车定点寻迹
  • ¥15 谁能帮我看看这拒稿理由啥意思啊阿啊
  • ¥15 关于vue2中methods使用call修改this指向的问题
  • ¥15 idea自动补全键位冲突
  • ¥15 请教一下写代码,代码好难
  • ¥15 iis10中如何阻止别人网站重定向到我的网站
  • ¥15 滑块验证码移动速度不一致问题
  • ¥15 Utunbu中vscode下cern root工作台中写的程序root的头文件无法包含