I can install numpy or pandas, but I can\'t import them in cmd, jupyter notebook or sublime text. (However, I can install and import them in Pycharm).
I\'ve already
I'm using PyCharm, determined to learn the PipEnv virtualization tool(it utilizes SHA256 hashing against downloaded packages), and was experiencing this same exact error message (error 193, %1 not a valid win32 or whatever). I realize this isn't exactly your scenario however, you're using python and PyCharm so I figure it might and might help others who arrive here. Anyways...
The way I resolved it was by: 1.) in the 'Add Python Interpreter' window (first setting up virtualization interpreter), I had to put "C:\Users\ericm\AppData\Roaming\Python\Python38\Scripts\pipenv.exe" as my "Pipenv executable'. (After doing this, I began getting a permission error when trying to utilize it) 2.) I had to add my project's path into the "Working directory" (e.x. C:\Users\ericm\OneDrive\Documents\Programming\Python\NameOfProject)
No more errors of any kind and my app is fully working again.
Reinstalling numpy did not work for me.
I had the same issue and noticed multiple paths pointing to numpy in the error message. E.g.
C:\Users\USERNAME\AppData\Roaming\Python\Python37\*
C:\Users\USERNAME\AppData\Local\Programs\Python\Python37-32\*
I deleted the C:\Users\USERNAME\AppData\Roaming\Python\Python37\*
folder because that was left behind by a previous Python which I had uninstalled. I would not recommend deleting anything until you are certain you won't break other things, so maybe send it to the recycle bin and restore if it does not fix the issue for you.
You can try this, I solved my problem after update package.
pip install --upgrade numpy
if nothing changed, you can upgrade pip first, than upgrade numpy.
python -m pip install --upgrade pip
(if you want to update all package, please refer to this page:How to upgrade all Python packages with pip?)
Or check the python version is fit your environment or not. Please make sure you remove old version totally after you reinstall new version.
Okay, so this eventually helped me:
I uninstalled only a numpy module with "pip uninstall numpy",
I reinstalled it once again with "pip install numpy",
I ran python, imported just one function from numpy (as I thought that maybe just some of the functions can't be imported, not entire numpy) - "from numpy import array"
The function worked,so I tried to import the entire numpy once again and this time it succeeded without OSError.