Home > OS >  I install a python package with "pip install opencv-python" and it gives me a warning in U
I install a python package with "pip install opencv-python" and it gives me a warning in U

Time:01-30

The warning it gives me is this:

WARNING: The scripts f2py, f2py3 and f2py3.10 are installed in '/home/minombre/.local/bin' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

How do I fix this? Or can I just leave it like that? even though I would like to fix it. I am using for the first time linux ubuntu.

CodePudding user response:

The warning message you are seeing is telling you that the scripts 'f2py', 'f2py3', and 'f2py3.10' are installed in the directory '/home/minombre/.local/bin', but this directory is not on your system's PATH. The PATH is a list of directories that your system looks in when you run a command. When you run a command, your system looks in the directories listed in the PATH for a file with that name.

You have a few options to solve this:

  1. Add the directory '/home/minombre/.local/bin' to your system's PATH. This will allow your system to find the scripts when you run them. You can do this by editing the '.bashrc' file in your home directory and adding the following line at the end of the file:

    export PATH=$PATH:/home/minombre/.local/bin

  2. Use the full path to the script when you run it. Instead of just running f2py, for example, you would run '/home/minombre/.local/bin/f2py'

  3. Use the '--no-warn-script-location' flag when you install the package. This will suppress the warning message but it will not add the directory to your PATH.

    pip install opencv-python --no-warn-script-location

It's important to note that if you are not going to use the scripts that are giving the warning, you can safely ignore the warning.

It is also important to mention that you can also check your PATH by running in the terminal:

echo $PATH

and it will show you the list of directories.

  • Related