我正在尝试在 Ubuntu 22.04 上安装 radian R 终端。该项目的说明github 页面建议使用 pip 安装它,我是这样做的:
pip3 install -U radian
安装成功:
Defaulting to user installation because normal site-packages is not writeable
Collecting radian
Using cached radian-0.6.4-py3-none-any.whl
Requirement already satisfied: rchitect<0.4.0,>=0.3.39 in ./.local/lib/python3.10/site-packages (from radian) (0.3.39)
Requirement already satisfied: pygments>=2.5.0 in ./.local/lib/python3.10/site-packages (from radian) (2.13.0)
Requirement already satisfied: prompt-toolkit<3.1,>=3.0.15 in ./.local/lib/python3.10/site-packages (from radian) (3.0.33)
Requirement already satisfied: wcwidth in ./.local/lib/python3.10/site-packages (from prompt-toolkit<3.1,>=3.0.15->radian) (0.2.5)
Requirement already satisfied: six>=1.9.0 in /usr/lib/python3/dist-packages (from rchitect<0.4.0,>=0.3.39->radian) (1.16.0)
Requirement already satisfied: cffi>=1.10.0 in ./.local/lib/python3.10/site-packages (from rchitect<0.4.0,>=0.3.39->radian) (1.15.1)
Requirement already satisfied: pycparser in ./.local/lib/python3.10/site-packages (from cffi>=1.10.0->rchitect<0.4.0,>=0.3.39->radian) (2.21)
Installing collected packages: radian
WARNING: The script radian is installed in '/home/user/.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.
Successfully installed radian-0.6.4
但是,当我尝试运行它时,找不到该命令。这是怎么回事?为什么安装后我无法运行 radian?
user@computer:~$ radian
radian: command not found
我尝试将 /home/user/.local/bin 添加到 $PATH 但并没有解决问题:
user@computer:~$ echo $PATH
home/user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin
答案1
我尝试将 /home/user/.local/bin 添加到 $PATH 但并没有解决问题:
user@computer:~$ echo $PATH home/user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bi> n:/usr/games:/usr/local/games:/snap/bin:/snap/bin
也在寻找答案,你找到了正确的解决方案(添加到路径),但你有一个拼写错误。你在路径的第一行上~/.local/bin
缺少一个/
before 。home