重新安装Anaconda失败 - 删除Anaconda和系统之间的所有冲突

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了重新安装Anaconda失败 - 删除Anaconda和系统之间的所有冲突相关的知识,希望对你有一定的参考价值。

在更新过程中结束了我的Anaconda环境(问题描述here)之后,我决定尝试重新安装Anaconda。然而,尽管进行了数小时的研究和错误搜索,但我未能安装Anaconda。

我的问题是如何将我的系统恢复到一个状态,使Anaconda不与我的系统冲突。

详情如下。

我的步骤如下:

  • 我卸载了Anaconda。
  • 我下载了最近版本的Anaconda并安装了它。不幸的是,没有安装Anaconda提示的可执行文件,Anaconda也没有出现在开始菜单中。问题部分解决了here
  • 我卸载了Anaconda并安装了Miniconda。
  • Miniconda成功安装。我按照建议的here安装了anaconda-clean并运行它。
  • 我卸载了Miniconda并确保在PATH中没有出现python安装。
  • 我删除了指向Python的注册表项
  • 我从PATH中删除了包含属于Qt5的文件的所有目录
  • 我检查过,AppData中没有出现Python和Anaconda
  • 我试图再次安装Anaconda,但失败与上述相同。
  • 我卸载了Anaconda并安装了Miniconda。
  • 我安装了anaconda-navigator
  • 我试图安装Glueviz,但失败了
  • 我一个接一个地删除了导致的不一致和安装包
  • 我遇到了安装ipykernel的问题,下面是完整的输出。
(base) C:\Users\Me>conda install ipykernel -v
Collecting package metadata: ...working... done
Solving environment: ...working... done
initializing UnlinkLinkTransaction with
  target_prefix: D:\_Programme\Anaconda3
  unlink_precs:

  link_precs:
    defaults::libsodium-1.0.16-h9d3ae62_0
    defaults::zeromq-4.3.1-h33f27b4_3
    defaults::pyzmq-18.0.0-py37ha925a31_0
    defaults::jupyter_client-5.2.4-py37_0
    defaults::ipykernel-5.1.0-py37h39e3cac_0



## Package Plan ##

  environment location: D:\_Programme\Anaconda3

  added / updated specs:
    - ipykernel


The following NEW packages will be INSTALLED:

  ipykernel          pkgs/main/win-64::ipykernel-5.1.0-py37h39e3cac_0
  jupyter_client     pkgs/main/win-64::jupyter_client-5.2.4-py37_0
  libsodium          pkgs/main/win-64::libsodium-1.0.16-h9d3ae62_0
  pyzmq              pkgs/main/win-64::pyzmq-18.0.0-py37ha925a31_0
  zeromq             pkgs/main/win-64::zeromq-4.3.1-h33f27b4_3


Proceed ([y]/n)? y

Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... ===> LINKING PACKAGE: defaults::libsodium-1.0.16-h9d3ae62_0 <===
  prefix=D:\_Programme\Anaconda3
  source=D:\_Programme\Anaconda3\pkgs\libsodium-1.0.16-h9d3ae62_0


===> LINKING PACKAGE: defaults::zeromq-4.3.1-h33f27b4_3 <===
  prefix=D:\_Programme\Anaconda3
  source=D:\_Programme\Anaconda3\pkgs\zeromq-4.3.1-h33f27b4_3


===> LINKING PACKAGE: defaults::pyzmq-18.0.0-py37ha925a31_0 <===
  prefix=D:\_Programme\Anaconda3
  source=D:\_Programme\Anaconda3\pkgs\pyzmq-18.0.0-py37ha925a31_0


===> LINKING PACKAGE: defaults::jupyter_client-5.2.4-py37_0 <===
  prefix=D:\_Programme\Anaconda3
  source=D:\_Programme\Anaconda3\pkgs\jupyter_client-5.2.4-py37_0


===> LINKING PACKAGE: defaults::ipykernel-5.1.0-py37h39e3cac_0 <===
  prefix=D:\_Programme\Anaconda3
  source=D:\_Programme\Anaconda3\pkgs\ipykernel-5.1.0-py37h39e3cac_0


$ C:\WINDOWS\system32\cmd.exe /d /c D:\_Programme\Anaconda3\.tmprx2boc11.bat
==> cwd: D:\_Programme\Anaconda3\Scripts <==
==> exit code: 1 <==
==> stdout <==

==> stderr <==
Das System kann den angegebenen Pfad nicht finden.
Parameterformat falsch - 65001.



An error occurred while installing package 'defaults::ipykernel-5.1.0-py37h39e3cac_0'.
LinkError: post-link script failed for package defaults::ipykernel-5.1.0-py37h39e3cac_0
running your command again with `-v` will provide additional information
location of failed script: D:\_Programme\Anaconda3\Scripts\.ipykernel-post-link.bat
==> script messages <==
<None>

Attempting to roll back.


===> REVERSING PACKAGE LINK: defaults::ipykernel-5.1.0-py37h39e3cac_0 <===
  prefix=D:\_Programme\Anaconda3


failed
An error occurred while installing package 'defaults::ipykernel-5.1.0-py37h39e3cac_0'.
LinkError: post-link script failed for package defaults::ipykernel-5.1.0-py37h39e3cac_0
running your command again with `-v` will provide additional information
location of failed script: D:\_Programme\Anaconda3\Scripts\.ipykernel-post-link.bat
==> script messages <==
<None>

Attempting to roll back.


Rolling back transaction: ...working... ===> REVERSING PACKAGE LINK: defaults::jupyter_client-5.2.4-py37_0 <===
  prefix=D:\_Programme\Anaconda3


===> REVERSING PACKAGE LINK: defaults::pyzmq-18.0.0-py37ha925a31_0 <===
  prefix=D:\_Programme\Anaconda3


===> REVERSING PACKAGE LINK: defaults::zeromq-4.3.1-h33f27b4_3 <===
  prefix=D:\_Programme\Anaconda3


===> REVERSING PACKAGE LINK: defaults::libsodium-1.0.16-h9d3ae62_0 <===
  prefix=D:\_Programme\Anaconda3


done
Traceback (most recent call last):
  File "D:\_Programme\Anaconda3\lib\site-packages\conda\core\link.py", line 1079, in run_script
    subprocess_call(command_args, env=env, path=dirname(path))
  File "D:\_Programme\Anaconda3\lib\site-packages\conda\gateways\subprocess.py", line 85, in subprocess_call
    output=formatted_output)
subprocess.CalledProcessError: Command '['C:\\WINDOWS\\system32\\cmd.exe', '/d', '/c', 'D:\\_Programme\\Anaconda3\\.tmprx2boc11.bat']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\_Programme\Anaconda3\lib\site-packages\conda\core\link.py", line 649, in _execute_post_link_actions
    activate=True)
  File "D:\_Programme\Anaconda3\lib\site-packages\conda\core\link.py", line 1095, in run_script
    raise LinkError(message)
conda.exceptions.LinkError: post-link script failed for package defaults::ipykernel-5.1.0-py37h39e3cac_0
running your command again with `-v` will provide additional information
location of failed script: D:\_Programme\Anaconda3\Scripts\.ipykernel-post-link.bat
==> script messages <==
<None>


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\_Programme\Anaconda3\lib\site-packages\conda\core\link.py", line 558, in _execute
    cls._execute_post_link_actions(pkg_idx_tracked, axngroup)
  File "D:\_Programme\Anaconda3\lib\site-packages\conda\core\link.py", line 664, in _execute_post_link_actions
    reverse_excs,
conda.CondaMultiError: post-link script failed for package defaults::ipykernel-5.1.0-py37h39e3cac_0
running your command again with `-v` will provide additional information
location of failed script: D:\_Programme\Anaconda3\Scripts\.ipykernel-post-link.bat
==> script messages <==
<None>



During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\_Programme\Anaconda3\lib\site-packages\conda\exceptions.py", line 1003, in __call__
    return func(*args, **kwargs)
  File "D:\_Programme\Anaconda3\lib\site-packages\conda\cli\main.py", line 84, in _main
    exit_code = do_call(args, p)
  File "D:\_Programme\Anaconda3\lib\site-packages\conda\cli\conda_argparse.py", line 82, in do_call
    exit_code = getattr(module, func_name)(args, parser)
  File "D:\_Programme\Anaconda3\lib\site-packages\conda\cli\main_install.py", line 20, in execute
    install(args, parser, 'install')
  File "D:\_Programme\Anaconda3\lib\site-packages\conda\cli\install.py", line 275, in install
    handle_txn(unlink_link_transaction, prefix, args, newenv)
  File "D:\_Programme\Anaconda3\lib\site-packages\conda\cli\install.py", line 304, in handle_txn
    unlink_link_transaction.execute()
  File "D:\_Programme\Anaconda3\lib\site-packages\conda\core\link.py", line 241, in execute
    self._execute(tuple(concat(interleave(itervalues(self.prefix_action_groups)))))
  File "D:\_Programme\Anaconda3\lib\site-packages\conda\core\link.py", line 587, in _execute
    rollback_excs,
conda.CondaMultiError: post-link script failed for package defaults::ipykernel-5.1.0-py37h39e3cac_0
running your command again with `-v` will provide additional information
location of failed script: D:\_Programme\Anaconda3\Scripts\.ipykernel-post-link.bat
==> script messages <==
<None>

德语部分翻译成英文:

$ C:\WINDOWS\system32\cmd.exe /d /c D:\_Programme\Anaconda3\.tmprx2boc11.bat
==> cwd: D:\_Programme\Anaconda3\Scripts <==
==> exit code: 1 <==
==> stdout <==

==> stderr <==
Das System kann den angegebenen Pfad nicht finden.
Parameterformat falsch - 65001.

翻译成

$ C:\WINDOWS\system32\cmd.exe /d /c D:\_Programme\Anaconda3\.tmprx2boc11.bat
==> cwd: D:\_Programme\Anaconda3\Scripts <==
==> exit code: 1 <==
==> stdout <==

==> stderr <==
The system cannot find the specified path
Parameter format is wrong - 65001.

Here是一个讨论这个问题的长线程。我完成安装的一些步骤受到了这个帖子中的帖子的启发,但我没有成功。请注意,我也在链接的帖子中发布了我的问题。如果我得到Anaconda开发人员的帮助,我会确保答案也会在这里发布。

我相信我的系统必须处于妨碍我安装Anaconda的状态。所有描述的问题都相当普遍,但到目前为止,所提出的解决方案都没有对我有用。我没有想法,并且会对我(和其他有相同问题的人)可以采取的步骤列表感兴趣,以便在与Anaconda没有冲突的状态下转移我的系统。

关于conda的详细信息:

(base) C:\Users\Me>conda info

     active environment : base
    active env location : D:\_Programme\Anaconda3
            shell level : 1
       user config file : C:\Users\Me\.condarc
 populated config files : C:\Users\Me\.condarc
          conda version : 4.6.9
    conda-build version : not installed
         python version : 3.7.1.final.0
       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/free/win-64
                          https://repo.anaconda.com/pkgs/free/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\Me\.conda\pkgs
                          C:\Users\Me\AppData\Local\conda\conda\pkgs
       envs directories : D:\_Programme\Anaconda3\envs
                          C:\Users\Me\.conda\envs
                          C:\Users\Me\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/4.6.9 requests/2.21.0 CPython/3.7.1 Windows/10 Windows/10.0.17134
          administrator : False
             netrc file : None
           offline mode : False

我正在使用64位Windows 10。

答案

暂时禁用我的反病毒程序对我来说是个窍门。我正在使用Windows 10中内置的防病毒程序。

打开Windows后卫安全中心并关闭实时保护。安装包ipykernel,再次打开实时保护。

之后我到目前为止还没有任何进一步的问题。

以上是关于重新安装Anaconda失败 - 删除Anaconda和系统之间的所有冲突的主要内容,如果未能解决你的问题,请参考以下文章

ModuleNotFoundError 尽管包安装

subtext 安装PythonIDE -Anaconda

Anaconda 安装和使用

anaconda使用jupyter 多个内核共用 添加自动补全插件

anaconda使用jupyter 多个内核共用 添加自动补全插件

PythonQt 和 Anaconda Python