值错误:内置类型大小不正确,请尝试重新编译

2024-04-27 00:16:59 发布

您现在位置:Python中文网/ 问答频道 /正文

我有给定的Python代码,在PyCharm的venv中使用。你知道吗

from keras.applications.resnet50 import ResNet50
from keras.preprocessing import image
from keras.applications.resnet50 import preprocess_input, decode_predictions
import numpy as np
print (np.__version__)

代码引发以下异常:

  File "type.pxd", line 9, in init mtrand
ValueError: builtins.type has the wrong size, try recompiling. Expected 840, got 864
PyDev console: starting.
Python 3.5.0a4 (v3.5.0a4:413e0e0004f4, Apr 19 2015, 18:01:47) [MSC v.1900 64 bit (AMD64)] on win32

我已经看过this similar topic 我升级了描述中的所有内容:

pip install --upgrade numpy
pip install --upgrade scipy
pip install --upgrade pandas

以及目前不需要的具体版本。你知道吗

pip install pandas==0.13.1

但我还是得到了同样的例外。你还有别的想法吗? 提前谢谢


Tags: installpip代码fromimportnumpypandasvenv