Could not install packages due to an OSError: [WinError 2] No such file or directory

19,984

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.

  1. First, try to import numpy and use it. If it doesn't work, try the second option.

  2. Try to install numpy again with user privilege by running the command below:

    pip install numpy --user
    
Share:
19,984
Anatoly
Author by

Anatoly

Learning developing in Android system. Working in windows systems.

Updated on July 22, 2022

Comments

  • Anatoly
    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.

    Here is a command prompt in the picture

    Can anyone help? Thanks.