Could not install packages due to an OSError: [WinError 2] No such file or directory
Solution 1
Try running the command as administrator:
or
pip install numpy --user
to install numpy without any special previlages
Solution 2
I had the same problem with other packages. Just try
pip install 'package name' --user
and see if the issue is resolved. It worked out for me.
Solution 3
It seems like the package you are trying to install already exists, or you don't have privileges to install it.
First, try to
import numpy
and use it. If it doesn't work, try the second option.Try to
install numpy
again with user privilege by running the command below:pip install numpy --user

Anatoly
Learning developing in Android system. Working in windows systems.
Updated on July 22, 2022Comments
-
Anatoly 5 months
I try to use pip to install numpy, and I receive the following error message:
Python: Could not install packages due to an OSError: [Errno 2] No such file or directory 'c:\python39\Scripts\f2py.exe' -> 'c:\python39\Scripts\f2py.exe.deleteme'
I'm not sure about an older version of numpy installed first.
I ran just command prompt, not a one with admin privileges.
Can anyone help? Thanks.