更新ipykernel或其他任何内容都会导致linkerror和回滚

时间:2019-06-21 08:40:03

标签: python windows-10 anaconda 64-bit conda

conda更新ipykernel -v

产生以下响应。通过anaconda提示符在任何软件包上进行任何更新或安装都是相同的。以管理员身份运行。

另一方面,IDLE和pip往往更易于使用,但我宁愿anaconda进行工作。

我尝试过“全部清除conda”和“全部清除conda”。

Executing transaction: ...working... ===> UNLINKING PACKAGE: defaults::ipykernel-4.10.0-py37_0 <===
  prefix=D:\Anaconda3


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


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

==> stderr <==
'chcp' is not recognized as an internal or external command,
operable program or batch file.
'chcp' is not recognized as an internal or external command,
operable program or batch file.
'chcp' is not recognized as an internal or external command,
operable program or batch file.



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

Attempting to roll back.


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


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

Attempting to roll back.


Rolling back transaction: ...working... ===> REVERSING PACKAGE UNLINK: defaults::ipykernel-4.10.0-py37_0 <===
  prefix=D:\Anaconda3


done
Traceback (most recent call last):
  File "D:\Anaconda3\lib\site-packages\conda\core\link.py", line 1079, in run_script
    subprocess_call(command_args, env=env, path=dirname(path))
  File "D:\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:\\Anaconda3\\.tmpsme8hq3b.bat']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\Anaconda3\lib\site-packages\conda\core\link.py", line 649, in _execute_post_link_actions
    activate=True)
  File "D:\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.1-py37h39e3cac_0
running your command again with `-v` will provide additional information
location of failed script: D:\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:\Anaconda3\lib\site-packages\conda\core\link.py", line 558, in _execute
    cls._execute_post_link_actions(pkg_idx_tracked, axngroup)
  File "D:\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.1-py37h39e3cac_0
running your command again with `-v` will provide additional information
location of failed script: D:\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:\Anaconda3\lib\site-packages\conda\exceptions.py", line 1003, in __call__
    return func(*args, **kwargs)
  File "D:\Anaconda3\lib\site-packages\conda\cli\main.py", line 84, in _main
    exit_code = do_call(args, p)
  File "D:\Anaconda3\lib\site-packages\conda\cli\conda_argparse.py", line 82, in do_call
    exit_code = getattr(module, func_name)(args, parser)
  File "D:\Anaconda3\lib\site-packages\conda\cli\main_update.py", line 20, in execute
    install(args, parser, 'update')
  File "D:\Anaconda3\lib\site-packages\conda\cli\install.py", line 275, in install
    handle_txn(unlink_link_transaction, prefix, args, newenv)
  File "D:\Anaconda3\lib\site-packages\conda\cli\install.py", line 304, in handle_txn
    unlink_link_transaction.execute()
  File "D:\Anaconda3\lib\site-packages\conda\core\link.py", line 241, in execute
    self._execute(tuple(concat(interleave(itervalues(self.prefix_action_groups)))))
  File "D:\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.1-py37h39e3cac_0
running your command again with `-v` will provide additional information
location of failed script: D:\Anaconda3\Scripts\.ipykernel-post-link.bat
==> script messages <==
<None>

1 个答案:

答案 0 :(得分:0)

为解决此问题,我卸载了现有的python 3.7和anaconda。我重新安装了anaconda,但有一个不同之处。

在Anaconda安装过程中,我将Anaconda注册为默认的Python 3.7。这样,Visual Studio,PyDev和其他程序可以自动将Anaconda检测为要使用的主要版本。

问题与此类似: Running setup.py install for fbprophet ... error