ubuntu python里用pip安装的包无法调用?

ubuntu python里用pip安装的包无法调用?

pip安装好的包,无法调用,好像不是环境变量问题,以streamlit为例

python -m pip --version

pip 21.3.1 from /home/xxx/.local/lib/python3.8/site-packages/pip (python 3.8)

python -m site

sys.path = [

'/home/xxx',

'/usr/local/lib/python3.8/site-packages',

'/usr/lib/python38.zip',

'/usr/lib/python3.8',

'/usr/lib/python3.8/lib-dynload',

'/home/xxx/.local/lib/python3.8/site-packages',

'/usr/local/lib/python3.8/dist-packages',

'/usr/lib/python3/dist-packages',

]

USER_BASE: '/home/xxx/.local' (exists)

USER_SITE: '/home/xxx/.local/lib/python3.8/site-packages' (exists)

ENABLE_USER_SITE: True

echo $PATH

/home/xxx/.nvm/versions/node/v14.16.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/xxx/AliceVision-2.2.0/bin:/home/xxx/anaconda3/bin:/opt/contentful-cli-linux-1.2.12:/usr/lib/jvm/java-11-openjdk-amd64/bin:/home/xxx/.local/lib/python3.8/site-packages

whereis streamlit

streamlit: /home/xxx/.local/lib/python3.8/site-packages/streamlit

streamlit

streamlit:未找到命令

请问如何解决?


回答:

好吧,就是环境变量的问题,添加:/home/xxx/.local/bin

以上是 ubuntu python里用pip安装的包无法调用? 的全部内容, 来源链接: utcz.com/p/938180.html

回到顶部