SoFunction
Updated on 2024-10-30

About the file Permission denied solution (pip)

File Permission denied resolution (pip)

concern

Permission denied for pip command.

cure

First check the path of pip, whether it is global or not, you can use the following command:

which pip

If it's global, just change it to the pip path under your own authority (Baidu for details)

If this is the error

在这里插入图片描述

View pip in the appropriate path

在这里插入图片描述

If it is white, it means, no it is not an executable file use the following command:

chmod u+x pip  #orchmod u+x *

在这里插入图片描述

The solution to the permissions denied situation of pip or conda installation

concern

> pip install bleach

...
...
Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/xxx/xxx/anaconda3/lib/python3.6/site-packages/bleach-2.1.4-py3.-info/PKG-INFO'
Consider using the `--user` option or check the permissions.

>conda install pywavelets
Solving environment: failed

NotWritableError: The current user does not have write permissions to a required path.
  path: /xxx/xxx/anaconda3/pkgs/cache/
  uid: 501
  gid: 20

method settle an issue

Change the related folder permissions.

For convenience, change permissions directly on the entire anaconda folder and add -R to change permissions on all subfolders

>sudo chown -R 501:20 /xxx/xxx/anaconda3/

This problem is more likely to be caused by previous use of sudo pip or sudo conda

summarize

The above is a personal experience, I hope it can give you a reference, and I hope you can support me more.