我已经在我的Windows 10笔记本电脑上按照python3.4用户网站上的文档安装了Theano 0.8.2。依赖项和theano包本身的安装是成功的,所有这些都是通过pip更新的。当我尝试导入theano时,它会产生一个我很不熟悉的非常大错误。错误的前置只是超过1000行似乎是打印到终端的代码。
This question似乎非常相关,但我不明白答案,而堆栈跟踪确实与我的不同。它说问题出在编译器上,但老实说我不知道如何解决它。有人为我提供解决方案吗?
这是堆栈跟踪,减去前面的代码。
=============================== In file included from C:\Python34\include/Python.h:8:0,
from C:\Users\billy\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_69_Stepping_1_GenuineIntel-3.4.3-32\lazylinker_ext\mod.cpp:1: C:\Python34\include/pyconfig.h:301:23: error: expected ';' at end of member declaration # define PY_LONG_LONG __int64
^ C:\Python34\include/pyconfig.h:413:30: note: in expansion of macro 'PY_LONG_LONG' #define PY_UINT64_T unsigned PY_LONG_LONG
^ C:\Python34\include/pyhash.h:65:9: note: in expansion of macro 'PY_UINT64_T'
PY_UINT64_T k0;
^ In file included from C:\Python34\include/Python.h:71:0,
from C:\Users\billy\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_69_Stepping_1_GenuineIntel-3.4.3-32\lazylinker_ext\mod.cpp:1: C:\Python34\include/pyhash.h:65:21: error: 'k0' does not name a type
PY_UINT64_T k0;
^ In file included from C:\Python34\include/Python.h:8:0,
from C:\Users\billy\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_69_Stepping_1_GenuineIntel-3.4.3-32\lazylinker_ext\mod.cpp:1: C:\Python34\include/pyconfig.h:301:23: error: expected ';' at end of member declaration # define PY_LONG_LONG __int64
^ C:\Python34\include/pyconfig.h:413:30: note: in expansion of macro 'PY_LONG_LONG' #define PY_UINT64_T unsigned PY_LONG_LONG
^ C:\Python34\include/pyhash.h:66:9: note: in expansion of macro 'PY_UINT64_T'
PY_UINT64_T k1;
^ C:\Python34\include/pyconfig.h:301:23: error: redeclaration of 'unsigned int <anonymous union>::<anonymous struct>::__int64' # define PY_LONG_LONG __int64
^ C:\Python34\include/pyconfig.h:413:30: note: in expansion of macro 'PY_LONG_LONG' #define PY_UINT64_T unsigned PY_LONG_LONG
^ C:\Python34\include/pyhash.h:66:9: note: in expansion of macro 'PY_UINT64_T'
PY_UINT64_T k1;
^ C:\Python34\include/pyconfig.h:301:23: note: previous declaration 'unsigned int <anonymous union>::<anonymous struct>::__int64' # define PY_LONG_LONG __int64
^ C:\Python34\include/pyconfig.h:413:30: note: in expansion of macro 'PY_LONG_LONG' #define PY_UINT64_T unsigned PY_LONG_LONG
^ C:\Python34\include/pyhash.h:65:9: note: in expansion of macro 'PY_UINT64_T'
PY_UINT64_T k0;
^ In file included from C:\Python34\include/Python.h:71:0,
from C:\Users\billy\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_69_Stepping_1_GenuineIntel-3.4.3-32\lazylinker_ext\mod.cpp:1: C:\Python34\include/pyhash.h:66:21: error: 'k1' does not name a type
PY_UINT64_T k1;
^ In file included from C:\Python34\include/Python.h:8:0,
from C:\Users\billy\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_69_Stepping_1_GenuineIntel-3.4.3-32\lazylinker_ext\mod.cpp:1: C:\Python34\include/pyconfig.h:301:23: error: '__int64' was not declared in this scope # define PY_LONG_LONG __int64
^ C:\Python34\include/longobject.h:88:44: note: in expansion of macro 'PY_LONG_LONG' PyAPI_FUNC(PyObject *) PyLong_FromLongLong(PY_LONG_LONG);
^ In file included from C:\Python34\include/Python.h:50:0,
from C:\Users\billy\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_69_Stepping_1_GenuineIntel-3.4.3-32\lazylinker_ext\mod.cpp:1: C:\Python34\include/pyconfig.h:301:23: error: '__int64' does not name a type # define PY_LONG_LONG __int64
^ C:\Python34\include/pyport.h:771:34: note: in definition of macro 'PyAPI_FUNC' # define PyAPI_FUNC(RTYPE) RTYPE
^ C:\Python34\include/longobject.h:90:12: note: in expansion of macro 'PY_LONG_LONG' PyAPI_FUNC(PY_LONG_LONG) PyLong_AsLongLong(PyObject
*);
^ In file included from C:\Python34\include/Python.h:78:0,
from C:\Users\billy\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_69_Stepping_1_GenuineIntel-3.4.3-32\lazylinker_ext\mod.cpp:1: C:\Python34\include/longobject.h:91:35: error: expected initializer before 'PyLong_AsUnsignedLongLong' PyAPI_FUNC(unsigned PY_LONG_LONG) PyLong_AsUnsignedLongLong(PyObject *);
^ C:\Python34\include/longobject.h:92:35: error: expected initializer before 'PyLong_AsUnsignedLongLongMask' PyAPI_FUNC(unsigned PY_LONG_LONG) PyLong_AsUnsignedLongLongMask(PyObject *);
^ In file included from C:\Python34\include/Python.h:50:0,
from C:\Users\billy\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_69_Stepping_1_GenuineIntel-3.4.3-32\lazylinker_ext\mod.cpp:1: C:\Python34\include/pyconfig.h:301:23: error: '__int64' does not name a type # define PY_LONG_LONG __int64
^ C:\Python34\include/pyport.h:771:34: note: in definition of macro 'PyAPI_FUNC' # define PyAPI_FUNC(RTYPE) RTYPE
^ C:\Python34\include/longobject.h:93:12: note: in expansion of macro 'PY_LONG_LONG' PyAPI_FUNC(PY_LONG_LONG) PyLong_AsLongLongAndOverflow(PyObject *, int *);
^ In file included from C:\Python34\include/Python.h:8:0,
from C:\Users\billy\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_69_Stepping_1_GenuineIntel-3.4.3-32\lazylinker_ext\mod.cpp:1: C:\Python34\include/pyconfig.h:301:23: error: '__int64' does not name a type # define PY_LONG_LONG __int64
^ C:\Python34\lib\site-packages\numpy\core\include/numpy/npy_common.h:281:9: note: in expansion of macro 'PY_LONG_LONG' typedef PY_LONG_LONG npy_longlong;
^ In file included from C:\Python34\lib\site-packages\numpy\core\include/numpy/npy_3kcompat.h:22:0,
from C:\Users\billy\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_69_Stepping_1_GenuineIntel-3.4.3-32\lazylinker_ext\mod.cpp:7: C:\Python34\lib\site-packages\numpy\core\include/numpy/npy_common.h:282:31: error: expected initializer before 'npy_ulonglong' 01005 0, /* tp_base */ typedef unsigned PY_LONG_LONG npy_ulonglong; 01006 0, /* tp_dict */
^ 01007 0, /* tp_descr_get */ In file included from C:\Python34\lib\site-packages\numpy\core\include/numpy/npy_3kcompat.h:22:0, 01008 0, /* tp_descr_set */ 01009 0, /* tp_dictoffset */
from C:\Users\billy\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_69_Stepping_1_GenuineIntel-3.4.3-32\lazylinker_ext\mod.cpp:7: 01010 (initproc)CLazyLinker_init,/* tp_init */ 01011 0, /* tp_alloc */ C:\Python34\lib\site-packages\numpy\core\include/numpy/npy_common.h:583:17: error: 'npy_longlong' does not name a type 01012 CLazyLinker_new, /* tp_new */
typedef npy_longlong npy_int64; 01013 };
^ 01014 01015 static PyObject * get_version(PyObject *dummy, PyObject *args) C:\Python34\lib\site-packages\numpy\core\include/numpy/npy_common.h:584:17: error: 'npy_ulonglong' does not name a type 01016 {
typedef npy_ulonglong npy_uint64; 01017 PyObject *result = PyFloat_FromDouble(0.21);
^ 01018 return result; 01019 } C:\Python34\lib\site-packages\numpy\core\include/numpy/npy_common.h:1062:9: error: 'npy_int64' does not name a type 01020 typedef npy_int64 npy_timedelta; 01021 static PyMethodDef lazylinker_ext_methods[] = {
^ 01022 {"get_version", get_version, METH_VARARGS, "Get extension version."}, 01023 {NULL, NULL, 0, NULL} /* Sentinel
*/ 01024 }; 01025 01026 #if defined(NPY_PY3K) C:\Python34\lib\site-packages\numpy\core\include/numpy/npy_common.h:1063:9: error: 'npy_int64' does not name a type 01027 static struct PyModuleDef moduledef = { typedef npy_int64 npy_datetime; 01028 PyModuleDef_HEAD_INIT,
^ 01029 "lazylinker_ext", In file included from C:\Python34\lib\site-packages\numpy\core\include/numpy/ndarrayobject.h:18:0, 01030 NULL, 01031 -1,
from C:\Python34\lib\site-packages\numpy\core\include/numpy/npy_3kcompat.h:23, 01032 lazylinker_ext_methods, 01033 NULL,
from C:\Users\billy\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_69_Stepping_1_GenuineIntel-3.4.3-32\lazylinker_ext\mod.cpp:7: 01034 NULL, 01035 NULL, C:\Python34\lib\site-packages\numpy\core\include/numpy/ndarraytypes.h:731:9: error: 'npy_int64' does not name a type 01036 NULL
npy_int64 year; 01037 };
^ 01038 #endif 01039 #if defined(NPY_PY3K) 01040 #define RETVAL m 01041 PyMODINIT_FUNC 01042 PyInit_lazylinker_ext(void) { 01043 #else 01044 #define RETVAL 01045 PyMODINIT_FUNC 01046 initlazylinker_ext(void) 01047 { 01048 #endif 01049 PyObject* m; C:\Python34\lib\site-packages\numpy\core\include/numpy/ndarraytypes.h:737:9: error: 'npy_int64' does not name a type 01050
npy_int64 day; 01051 lazylinker_ext_CLazyLinkerType.tp_new = PyType_GenericNew;
^ 01052 if (PyType_Ready(&lazylinker_ext_CLazyLinkerType) < 0) In file included from C:\Users\billy\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_69_Stepping_1_GenuineIntel-3.4.3-32\lazylinker_ext\mod.cpp:7:0: 01053 return RETVAL; 01054 #if defined(NPY_PY3K) C:\Python34\lib\site-packages\numpy\core\include/numpy/npy_3kcompat.h: In function 'FILE* npy_PyFile_Dup2(PyObject*, char*, off_t*)': 01055 m = PyModule_Create(&moduledef); 01056 #else C:\Python34\lib\site-packages\numpy\core\include/numpy/npy_3kcompat.h:228:32: error: 'PyLong_AsLongLong' was not declared in this scope 01057 m
= Py_InitModule3("lazylinker_ext", lazylinker_ext_methods,
pos = PyLong_AsLongLong(ret); 01058 "Example module that creates an extension type.");
^ 01059 #endif 01060 Py_INCREF(&lazylinker_ext_CLazyLinkerType); C:\Python34\lib\site-packages\numpy\core\include/numpy/npy_3kcompat.h: In function 'int npy_PyFile_DupClose2(PyObject*, FILE*, off_t)': 01061 PyModule_AddObject(m, "CLazyLinker", (PyObject
*)&lazylinker_ext_CLazyLinkerType); 01062 C:\Python34\lib\site-packages\numpy\core\include/numpy/npy_3kcompat.h:266:41: error: 'lseek' was not declared in this scope 01063 return RETVAL;
if (npy_lseek(fd, orig_pos, SEEK_SET) == -1) { 01064 }
^ 01065
Problem occurred during compilation with the command line below: C:\cygwin64\bin\g++.exe -shared -g -march=haswell -mmmx -mno-3dnow
-msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mmovbe -maes -mno-sha -mpclmul -mpopcnt -mabm -mno-lwp -mfma -mno-fma4 -mno-xop -mbmi -mbmi2 -mno-tbm -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mno-rtm -mno-hle -mrdrnd -mf16c -mfsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr -mxsave -mxsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=4096 -mtune=haswell
-DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -m32 -IC:\Python34\lib\site-packages\numpy\core\include -IC:\Python34\include -IC:\Python34\lib\site-packages\theano\gof -o C:\Users\billy\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_69_Stepping_1_GenuineIntel-3.4.3-32\lazylinker_ext\lazylinker_ext.pyd C:\Users\billy\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_69_Stepping_1_GenuineIntel-3.4.3-32\lazylinker_ext\mod.cpp
-LC:\Python34\libs -LC:\Python34 -lpython34 Traceback (most recent call last): File "C:\Python34\lib\site-packages\theano\gof\lazylinker_c.py", line 74, in <module>
raise ImportError() ImportError
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\Python34\lib\site-packages\theano\gof\lazylinker_c.py", line 91, in <module>
raise ImportError() ImportError
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\Python34\lib\code.py", line 90, in runcode
exec(code, self.locals) File "<input>", line 1, in <module> File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition
2016.1.3\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs) File "C:\Python34\lib\site-packages\theano\__init__.py", line 63, in <module>
from theano.compile import ( File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition
2016.1.3\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs) File "C:\Python34\lib\site-packages\theano\compile\__init__.py", line 9, in <module>
from theano.compile.function_module import * File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition
2016.1.3\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs) File "C:\Python34\lib\site-packages\theano\compile\function_module.py", line 22, in <module>
import theano.compile.mode File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition
2016.1.3\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs) File "C:\Python34\lib\site-packages\theano\compile\mode.py", line 12, in <module>
import theano.gof.vm File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition
2016.1.3\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs) File "C:\Python34\lib\site-packages\theano\gof\vm.py", line 638, in <module>
from . import lazylinker_c File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition
2016.1.3\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs) File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition
2016.1.3\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs) File "C:\Python34\lib\site-packages\theano\gof\lazylinker_c.py", line 126, in <module>
preargs=args) File "C:\Python34\lib\site-packages\theano\gof\cmodule.py", line 2204, in compile_str
(status, compile_stderr.replace('\n', '. '))) Exception: Compilation failed (return status=1): In file included from C:\Python34\include/Python.h:8:0,. from C:\Users\billy\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_69_Stepping_1_GenuineIntel-3.4.3-32\lazylinker_ext\mod.cpp:1:. C:\Python34\include/pyconfig.h:301:23: error: expected ';' at end of member declaration. # define PY_LONG_LONG __int64 . ^. C:\Python34\include/pyconfig.h:413:30: note: in expansion of macro 'PY_LONG_LONG'. #define PY_UINT64_T unsigned PY_LONG_LONG . ^. C:\Python34\include/pyhash.h:65:9: note: in expansion of macro 'PY_UINT64_T'. PY_UINT64_T k0; . ^. In file included from C:\Python34\include/Python.h:71:0,. from C:\Users\billy\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_69_Stepping_1_GenuineIntel-3.4.3-32\lazylinker_ext\mod.cpp:1:. C:\Python34\include/pyhash.h:65:21: error: 'k0' does not name a type. PY_UINT64_T k0; . ^. In file included from C:\Python34\include/Python.h:8:0,. from C:\Users\billy\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_69_Stepping_1_GenuineIntel-3.4.3-32\lazylinker_ext\mod.cpp:1:. C:\Python34\include/pyconfig.h:301:23: error: expected ';' at end of member declaration. # define PY_LONG_LONG __int64 . ^. C:\Python34\include/pyconfig.h:413:30: note: in expansion of macro 'PY_LONG_LONG'. #define PY_UINT64_T unsigned PY_LONG_LONG . ^. C:\Python34\include/pyhash.h:66:9: note: in expansion of macro 'PY_UINT64_T'. PY_UINT64_T k1; . ^. C:\Python34\include/pyconfig.h:301:23: error: redeclaration of 'unsigned int <anonymous union>::<anonymous struct>::__int64'. # define PY_LONG_LONG __int64 . ^. C:\Python34\include/pyconfig.h:413:30: note: in expansion of macro 'PY_LONG_LONG'. #define PY_UINT64_T unsigned PY_LONG_LONG . ^. C:\Python34\include/pyhash.h:66:9: note: in expansion of macro 'PY_UINT64_T'. PY_UINT64_T k1; . ^. C:\Python34\include/pyconfig.h:301:23: note: previous declaration 'unsigned int <anonymous union>::<anonymous struct>::__int64'. # define PY_LONG_LONG __int64 . ^. C:\Python34\include/pyconfig.h:413:30: note: in expansion of macro 'PY_LONG_LONG'. #define PY_UINT64_T unsigned PY_LONG_LONG . ^. C:\Python34\include/pyhash.h:65:9: note: in expansion of macro 'PY_UINT64_T'. PY_UINT64_T k0; . ^. In file included from C:\Python34\include/Python.h:71:0,. from C:\Users\billy\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_69_Stepping_1_GenuineIntel-3.4.3-32\lazylinker_ext\mod.cpp:1:. C:\Python34\include/pyhash.h:66:21: error: 'k1' does not name a type. PY_UINT64_T k1; . ^. In file included from C:\Python34\include/Python.h:8:0,. from C:\Users\billy\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_69_Stepping_1_GenuineIntel-3.4.3-32\lazylinker_ext\mod.cpp:1:. C:\Python34\include/pyconfig.h:301:23: error: '__int64' was not declared in this scope. # define PY_LONG_LONG __int64 . ^. C:\Python34\include/longobject.h:88:44: note: in expansion of macro 'PY_LONG_LONG'. PyAPI_FUNC(PyObject *) PyLong_FromLongLong(PY_LONG_LONG); . ^. In file included from C:\Python34\include/Python.h:50:0,. from C:\Users\billy\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_69_Stepping_1_GenuineIntel-3.4.3-32\lazylinker_ext\mod.cpp:1:. C:\Python34\include/pyconfig.h:301:23: error: '__int64' does not name a type. # define PY_LONG_LONG __int64 . ^. C:\Python34\include/pyport.h:771:34: note: in definition of macro 'PyAPI_FUNC'. # define PyAPI_FUNC(RTYPE) RTYPE . ^. C:\Python34\include/longobject.h:90:12: note: in expansion of macro 'PY_LONG_LONG'. PyAPI_FUNC(PY_LONG_LONG) PyLong_AsLongLong(PyObject
*); . ^. In file included from C:\Python34\include/Python.h:78:0,. from C:\Users\billy\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_69_Stepping_1_GenuineIntel-3.4.3-32\lazylinker_ext\mod.cpp:1:. C:\Python34\include/longobject.h:91:35: error: expected initializer before 'PyLong_AsUnsignedLongLong'. PyAPI_FUNC(unsigned PY_LONG_LONG) PyLong_AsUnsignedLongLong(PyObject *); . ^. C:\Python34\include/longobject.h:92:35: error: expected initializer before 'PyLong_AsUnsignedLongLongMask'. PyAPI_FUNC(unsigned PY_LONG_LONG) PyLong_AsUnsignedLongLongMask(PyObject *); . ^. In file included from C:\Python34\include/Python.h:50:0,. from C:\Users\billy\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_69_Stepping_1_GenuineIntel-3.4.3-32\lazylinker_ext\mod.cpp:1:. C:\Python34\include/pyconfig.h:301:23: error: '__int64' does not name a type. # define PY_LONG_LONG __int64 . ^. C:\Python34\include/pyport.h:771:34: note: in definition of macro 'PyAPI_FUNC'. # define PyAPI_FUNC(RTYPE) RTYPE . ^. C:\Python34\include/longobject.h:93:12: note: in expansion of macro 'PY_LONG_LONG'. PyAPI_FUNC(PY_LONG_LONG) PyLong_AsLongLongAndOverflow(PyObject *, int *); . ^. In file included from C:\Python34\include/Python.h:8:0,. from C:\Users\billy\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_69_Stepping_1_GenuineIntel-3.4.3-32\lazylinker_ext\mod.cpp:1:. C:\Python34\include/pyconfig.h:301:23: error: '__int64' does not name a type. # define PY_LONG_LONG __int64 . ^. C:\Python34\lib\site-packages\numpy\core\include/numpy/npy_common.h:281:9: note: in expansion of macro 'PY_LONG_LONG'. typedef PY_LONG_LONG npy_longlong;. ^. In file included from C:\Python34\lib\site-packages\numpy\core\include/numpy/npy_3kcompat.h:22:0,. from C:\Users\billy\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_69_Stepping_1_GenuineIntel-3.4.3-32\lazylinker_ext\mod.cpp:7:. C:\Python34\lib\site-packages\numpy\core\include/numpy/npy_common.h:282:31: error: expected initializer before 'npy_ulonglong'. typedef unsigned PY_LONG_LONG npy_ulonglong;. ^. In file included from C:\Python34\lib\site-packages\numpy\core\include/numpy/npy_3kcompat.h:22:0,. from C:\Users\billy\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_69_Stepping_1_GenuineIntel-3.4.3-32\lazylinker_ext\mod.cpp:7:. C:\Python34\lib\site-packages\numpy\core\include/numpy/npy_common.h:583:17: error: 'npy_longlong' does not name a type. typedef npy_longlong npy_int64;. ^. C:\Python34\lib\site-packages\numpy\core\include/numpy/npy_common.h:584:17: error: 'npy_ulonglong' does not name a type. typedef npy_ulonglong npy_uint64;. ^. C:\Python34\lib\site-packages\numpy\core\include/numpy/npy_common.h:1062:9: error: 'npy_int64' does not name a type. typedef npy_int64 npy_timedelta;. ^. C:\Python34\lib\site-packages\numpy\core\include/numpy/npy_common.h:1063:9: error: 'npy_int64' does not name a type. typedef npy_int64 npy_datetime;. ^. In file included from C:\Python34\lib\site-packages\numpy\core\include/numpy/ndarrayobject.h:18:0,. from C:\Python34\lib\site-packages\numpy\core\include/numpy/npy_3kcompat.h:23,. from C:\Users\billy\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_69_Stepping_1_GenuineIntel-3.4.3-32\lazylinker_ext\mod.cpp:7:. C:\Python34\lib\site-packages\numpy\core\include/numpy/ndarraytypes.h:731:9: error: 'npy_int64' does not name a type. npy_int64 year;. ^. C:\Python34\lib\site-packages\numpy\core\include/numpy/ndarraytypes.h:737:9: error: 'npy_int64' does not name a type. npy_int64 day;. ^. In file included from C:\Users\billy\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_69_Stepping_1_GenuineIntel-3.4.3-32\lazylinker_ext\mod.cpp:7:0:. C:\Python34\lib\site-packages\numpy\core\include/numpy/npy_3kcompat.h: In function 'FILE* npy_PyFile_Dup2(PyObject*, char*, off_t*)':. C:\Python34\lib\site-packages\numpy\core\include/numpy/npy_3kcompat.h:228:32: error: 'PyLong_AsLongLong' was not declared in this scope. pos = PyLong_AsLongLong(ret);. ^. C:\Python34\lib\site-packages\numpy\core\include/numpy/npy_3kcompat.h: In function 'int npy_PyFile_DupClose2(PyObject*, FILE*, off_t)':. C:\Python34\lib\site-packages\numpy\core\include/numpy/npy_3kcompat.h:266:41: error: 'lseek' was not declared in this scope. if (npy_lseek(fd, orig_pos, SEEK_SET) == -1) {. ^.
答案 0 :(得分:0)
由于这个问题有点关于在Windows上安装Theano,我会告诉你我是如何建议的。
首先,如果可能,删除任何其他python环境。 确保python没有其他冲突的环境路径,以防万一。
1.安装EPD CANOPY
2.安装Canopy应用程序上可用的软件包安装程序上的MinGW软件包
这应该很容易,你只需从Canopy应用程序中打开包管理器。
3.从EPD内部安装Theano
之前你发送垃圾邮件&#34; pip install&#34;,在下面,:
pip install --upgrade --no-deps git + git://github.com/Theano/Theano.git
在你看到的每一个命令提示中,不要做。
- 相反,Open Canopy。
在Canopy屏幕中,转到&#34;工具&#34; ,然后打开&#34; Canopy命令提示符&#34;
与Windows中的CMD完全相同的屏幕将会打开。
在该屏幕上,执行:
pip install --upgrade --no-deps git + git://github.com/Theano/Theano.git
现在应该可以正常工作。
-
然而,不要忘记你需要,显然是Windows SDK,当然取决于Windows版本。 您可以尝试安装最后一个Visual Studio,并附带您需要的所有内容。
如果您需要更多信息,请查看此相关的Stackoverflow主题: