Skip to main content
 首页 » 编程设计

python之在 Windows 机器上安装 Theano

2025年04月02日19TianFang

我已经看完了

How to install Theano on Anaconda Python 2.7 x64 on Windows?

我安装了 Anaconda 2 并按照步骤操作,我可以导入 theano,但是偶尔我会在 python 崩溃时收到类似这样的 Windows 崩溃消息窗口:

python.exe crashes when importing `theano`

我已经完成了“conda install mingw libpython”这一步。

另外,当我运行 theano.test() 时,我收到此警告:

pycuda 在 theano.misc.pycuda_init 中导入失败。

总的来说,我认为 windows 安装页面中有更多关于 visual studio 和其他模块的步骤。我安装了 Microsoft 的 Visual Studio 2012。

请您参考如下方法:

您是否完全按照 theano 安装说明进行操作?

在 Windows 7 x64 上,我建议使用 Enthought 的 Canopy,如果您是学生,您可以免费获得完整的软件包。

或者,我以前也用过 WinPython,它运行良好。 尽管您必须遵循所有步骤,包括:

安装 Windows Software Development Kit 7.1 版,或者您可以安装它附带的最新 Visual Studio,它带有安装 Microsoft Visual C++ Compiler for Python 2.7 的选项

安装 TDM GCC

但一定要检查

http://deeplearning.net/software/theano/install_windows.html

您可能想检查是否遗漏了任何步骤。

我之前在使用 Anaconda 和 Theano 时遇到过问题。所以我放弃了使用它。 然而,一位 friend 在它和 Theano 上取得了成功。

请确保在安装 theano 之前正确安装了环境和 python 设置。

做

where gcc 
where gendef 
where cl 
where nvcc 

在命令提示符上可能会揭示一些东西......

请务必安装好Windows SDK和最新的visual studio。