0

Trying to upgrade my python 2.7 scripts to the latest python 3.x for my PC running Windows 7-x64. To do so, I installed python 3.8.9.

I get a nasty error when I press ENTER after typing "import pandas" in a script that also import wxpython. I tracked down the issue to pandas.

enter image description here

Checking pandas installation:

pandas in e:\python38-32\lib\site-packages (2.0.3)
python-dateutil>=2.8.2 in e:\python38-32\lib\site-packages (from pandas) (2.9.0.post0)
pytz>=2020.1 in e:\python38-32\lib\site-packages (from pandas) (2025.2)
tzdata>=2022.1 in e:\python38-32\lib\site-packages (from pandas) (2025.2)
numpy>=1.20.3 in e:\python38-32\lib\site-packages (from pandas) (1.24.4)
six>=1.5 in e:\python38-32\lib\site-packages (from python-dateutil>=2.8.2->pandas) (1.17.0)

Everything seems fine, but something there is wrong.

1 Answer 1

2

So, I go to the pandas issue requests and don't find anything interesting.

Then, it occurs to me that maybe I should try "import numpy". And bam, same Windows error!

So, I go to the numpy issue requests and find out that the culprit is most certainly the old processor of my PC.

Solution

$ pip3 uninstall numpy
$ pip3 install numpy==1.24.0
$ py
>>> import numpy

Fail!

$ pip3 uninstall numpy
$ pip3 install numpy==1.23.5
$ py
>>> import numpy
>>>

Success!

Conclusion

Install a version of numpy by installing/uninstalling versions down to the one numpy don't complain about the processor of your PC. That method should work under any OS.

Problem is, wxpython install a "wrong" version of numpy.

The METADATA of this package (version 4.2.2) reads:

Requires-Dist: numpy<1.17; python_version <= "2.7"
Requires-Dist: numpy; python_version >= "3.0" and python_version < "3.12"

No minimum version, therefore potential issues may arise with the "new" (not the newest) numpy installed by force.

IMHO, wxpython should not install numpy by default, but make a supplemental package for those interested in widgets using numpy.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.