认知计算 茂森 2019-11-06 23:34 采纳率: 100%
浏览 361
已采纳

安装pylearn2,一直报“failed with exit status 2”这个错,咋回事呢……

C:\Users\Administrator>cd/d G:\Documents\GitHub\pylearn2

G:\Documents\GitHub\pylearn2>python setup.py install
C:\ProgramData\Anaconda3\lib\site-packages\setuptools\dist.py:475: UserWarning: Normalizing '0.1dev' to '0.1.dev0'
  normalized_version,
running install
Because Pylearn2 is under heavy development, we generally do not advice using the `setup.py install` command. Please consider using the `setup.py develop` command instead for the following reasons:

1. Using `setup.py install` creates a copy of the Pylearn2 source code in your Python installation path. In order to update Pylearn2 afterwards you will need to rerun `setup.py install` (!). Simply using `git pull` to update your local copy of Pylearn2 code will not suffice.

2. When using `sudo` to install Pylearn2, all files, including the tutorials, will be copied to a directory owned by root. Not only is running tutorials as root unsafe, it also means that all Pylearn2-related environment variables which were defined for the user will be unavailable.

Pressing enter will continue the installation of Pylearn2 in `develop` mode instead. Note that this means that you need to keep this folder with the Pylearn2 code in its current location. If you know what you are doing, and are very sure that you want to install Pylearn2 using the `install` command instead, please type `install`.

Installation mode: [develop]/install/cancel:
running develop
running egg_info
writing pylearn2.egg-info\PKG-INFO
writing dependency_links to pylearn2.egg-info\dependency_links.txt
writing requirements to pylearn2.egg-info\requires.txt
writing top-level names to pylearn2.egg-info\top_level.txt
reading manifest file 'pylearn2.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'pylearn2.egg-info\SOURCES.txt'
running build_ext
skipping 'pylearn2/utils\_window_flip.c' Cython extension (up-to-date)
building 'pylearn2.utils._window_flip' extension
G:\software\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -IC:\ProgramData\Anaconda3\lib\site-packages\numpy\core\include -IC:\ProgramData\Anaconda3\include -IC:\ProgramData\Anaconda3\include "-IG:\software\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\ATLMFC\include" "-IG:\software\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\include" /Tcpylearn2/utils\_window_flip.c /Fobuild\temp.win-amd64-3.7\Release\pylearn2/utils\_window_flip.obj
_window_flip.c
C:\ProgramData\Anaconda3\include\pyconfig.h(59): fatal error C1083: 无法打开包括文件: “io.h”: **No such file or directory
error: command 'G:\\software\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.23.28105\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
```**
  • 写回答

1条回答 默认 最新

  • 你知我知皆知 2024-07-29 20:02
    关注

    以下回答参考 皆我百晓生券券喵儿 等免费微信小程序相关内容作答,并由本人整理回复。

    在使用pylearn2时遇到错误“failed with exit status 2”,这可能是因为您尝试了在开发模式下安装Pylearn2。在这种情况下,Pylearn2会将源代码复制到您的Python安装路径中,因此当您更新Pylearn2之后,您需要重新运行setup.py install命令来确保所有更改都被正确应用。

    以下是如何解决此问题的步骤:

    1. 在您的Python安装目录(例如C:\Users\Administrator)中删除Pylearn2的所有相关文件和目录。
    2. 清除任何与Pylearn2相关的环境变量设置,并确保它们已经清除。
    3. 使用pip uninstall pylearn2命令卸载Pylearn2。
    4. 将Pylearn2源代码从当前工作目录移至一个安全的位置(例如:C:\Users\Administrator\pylearn2),并创建一个新的虚拟环境以管理这些代码。
    5. 更新您的虚拟环境并激活它。
    6. 使用pip install .pip install --upgrade .命令安装Pylearn2。
    7. 如果您想继续使用setup.py install命令,请再次执行上述步骤,但这次选择使用setup.py develop命令。

    希望以上建议能帮助您解决问题!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 已采纳回答 7月29日