即使具有正确的权限,也无法执行 pip

即使具有正确的权限,也无法执行 pip

我正在寻找pip位于conda此处的环境中运行的东西:

/opt/conda/envs/myenv/bin

激活 conda 环境并运行 pip 后:

$ conda activate myenv
$ pip --help

我收到以下错误:

bash: /opt/conda/envs/myenv/bin/pip: /opt/conda/envs/myenv/bin/python: bad interpreter: Permission denied

/opt/conda/envs/myenv/bin/pip 上的权限是:

 File: /opt/conda/envs/myenv/bin/pip
  Size: 234         Blocks: 8          IO Block: 4096   regular file
Device: 66h/102d    Inode: 10355178    Links: 1
Access: (0770/-rwxrwx---)  Uid: (    0/    root)   Gid: ( 1000/anaconda)
Access: 2019-12-03 20:15:28.000000000 +0000
Modify: 2019-12-03 20:15:28.000000000 +0000
Change: 2019-12-03 20:20:01.754106880 +0000
 Birth: -

/opt/conda/envs/myenv/bin/python 上的权限是:

  File: python -> python3.7
  Size: 9           Blocks: 0          IO Block: 4096   symbolic link
Device: 3dh/61d Inode: 10355190    Links: 1
Access: (0777/lrwxrwxrwx)  Uid: (    0/    root)   Gid: ( 1000/anaconda)
Access: 2019-12-03 20:15:42.000000000 +0000
Modify: 2019-12-03 20:15:42.000000000 +0000
Change: 2019-12-03 20:20:01.758106820 +0000
 Birth: -

我还验证了我的用户 ( myuser) 是否属于以下anaconda组:

$ cat /etc/group
anaconda:x:1000:root,myuser

我甚至尝试为其提供绝对路径,但仍然失败:

$ /opt/conda/envs/myenv/bin/pip --help
bash: /opt/conda/envs/myenv/bin/pip: /opt/conda/envs/myenv/bin/python: bad interpreter: Permission denied

pip为什么即使我有正确的权限,我还是无法运行?任何帮助都将不胜感激!

相关内容