我正试图使用IPython shell中的以下命令将IPython中的scikit learn从0.13更新到0.14版本:
!pip install scikit-learn --update
一切似乎都在更新,但当我查看pip日志时,我看到了以下内容(如果有任何见解,我将不胜感激):
Rolling back uninstall of scikit-learn
Replacing c:anacondalibsite-packagesscikit_learn-0.13-py2.7.egg-info
Command C:Anacondapython.exe -c "import setuptools;__file__='c:\users\owner\appdata\local\temp\pip-build\scikit-learn\setup.py';exec(compile(open(__file__).read().replace('rn', 'n'), __file__, 'exec'))" install --record c:usersownerappdatalocaltemppip-pqca_z-recordinstall-record.txt --single-version-externally-managed failed with error code 1 in c:usersownerappdatalocaltemppip-buildscikit-learn
Exception information:
Traceback (most recent call last):
File "C:Anacondalibsite-packagespipbasecommand.py", line 107, in main
status = self.run(options, args)
File "C:Anacondalibsite-packagespipcommandsinstall.py", line 261, in run
requirement_set.install(install_options, global_options)
File "C:Anacondalibsite-packagespipreq.py", line 1166, in install
requirement.install(install_options, global_options)
File "C:Anacondalibsite-packagespipreq.py", line 589, in install
cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
File "C:Anacondalibsite-packagespiputil.py", line 612, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command C:Anacondapython.exe -c "import setuptools;__file__='c:\users\owner\appdata\local\temp\pip-build\scikit-learn\setup.py';exec(compile(open(__file__).read().replace('rn', 'n'), __file__, 'exec'))" install --record c:usersownerappdatalocaltemppip-pqca_z-recordinstall-record.txt --single-version-externally-managed failed with error code 1 in c:usersownerappdatalocaltemppip-buildscikit-learn
您正在使用anaconda,因此应该使用conda命令行(conda update scikit-learn
)来更新anaconda包,而不是pip。