Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python3 numpy import error PyCapsule_Import could not import module "datetime"

I am trying to import numpy with python3 on MacOS mojave. I am getting this error. I don't know if it has something to do with a virtual environment or something like that.

Error: PyCapsule_Import could not import module "datetime"

I have tried reinstalling python3 and reinstalling numpy

like image 203
tomvis1984 Avatar asked Jul 27 '26 14:07

tomvis1984


1 Answers

In my case I had this problem, because my script was called math.py, which caused module import problems. Make sure your own python files do not share name with some of common module names. After I renamed my script to something else, I could run script normally.

like image 135
K.H. Avatar answered Jul 29 '26 04:07

K.H.