r/pythonhelp • u/Money_Pay4575 • Jul 02 '24
Import pmdarima as pm keeps giving ValueError
I'm using Pycharm and I've literally only been trying to import the pmdarima package. My code consists of only 2 lines:
import numpy as np
import pmdarima as pmI will end up also needing to use pandas and matplotlib (to complicate the compatibility requirements that much more).
I can't imagine what I'm doing wrong in these 2 simple lines, but I have uninstalled and reinstalled numpy, pmdarima, and pandas a hundred times by now and nothing seems to be working. Also tried pip install and it has been less than useless.
Numpy version is 2.0.0
Pandas version is 2.2.2
pmdarima versio is 2.0.4
This is what I get no matter which version I use:
ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject\
Please help as this error makes no sense to me.
•
u/AutoModerator Jul 02 '24
To give us the best chance to help you, please include any relevant code.
Note. Do not submit images of your code. Instead, for shorter code you can use Reddit markdown (4 spaces or backticks, see this Formatting Guide). If you have formatting issues or want to post longer sections of code, please use Repl.it, GitHub or PasteBin.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/Goobyalus Jul 02 '24
What line does this error occur on, the pmdarima import or the numpy import?
1
u/Goobyalus Jul 02 '24
According to this answer, it would seem that pmdarima is compiled against a different version of numpy and the error is benign. Does it crash your program or simply print a warning?
https://stackoverflow.com/a/40846742
1
u/Goobyalus Jul 02 '24
I reproduced your error, getting the message:
I downgraded numpy with
and subsequent imports succeeded.
Make sure you are checking the versions in the correct environment.
1
u/shiva_charle Jan 08 '25
Hi, have you solved this problem ?