共计 3582 个字符,预计需要花费 9 分钟才能阅读完成。
默认 linux 带的 python 是 2.7 版本的 但是连 pip 命令都用不了 有没有什么一键命令升级成 3.8 版本的 python |
网友回复:
注册 : 现在默认的基本都带 python3 是你命令不对啊 python 是 2。7 python3 一般都是 3。5 以上了
sanxian: 根据这个命令解决了只使用 pip 就可以安装 而且网上好多教程给的命令也就直接 pip 没加三 能方便些不更好吗是吧
Tankie: 我擦 可以使用 pip 了 就是不知道这几个 warning 要不要紧 [[email protected] ~]# python3 -m pip install –upgrade pip WARNING: Running pip install with root privileges is generally not a good idea. Try `__main__.py install –user` instead. Collecting pip Downloading https://files.pythonhosted.org/packages/a4/6d/6463d49a933f547439d6b5b98b46af8742cc03ae83543e4d7688c2420f8b/pip-21.3.1-py3-none-any.whl (1.7MB) 100% |████████████████████████████████| 1.7MB 299kB/s Installing collected packages: pip Successfully installed pip-21.3.1 [[email protected] ~]# pip install speedtest-cli Collecting speedtest-cli Downloading speedtest_cli-2.1.3-py2.py3-none-any.whl (23 kB) Installing collected packages: speedtest-cli Successfully installed speedtest-cli-2.1.3 WARNING: Running pip as the ‘root’ user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv [[email protected] ~]# python -V Python 2.7.5 [[email protected] ~]# python3 -V Python 3.6.8 复制代码
sanxian: python3 -m pip install –upgrade pip 复制代码
sanxian: 我选择直接 miniconda
论坛大师 : apt install python3 python3-pip -y yum install python3 python3-pip -y
minota: 要关联 path 而且占用空间大
YorkZhao: [root[url=home.php?mod=space&uid=22998]@localhost[/url] ~]# pip install speedtest-cli -bash: pip: 未找到命令 复制代码
YorkZhao: 什么发行版的 linux, 现在都带 python3 了
sanxian: 安装好之后再用 python - V 还是显示 2.75 是不是需要把执行命令的版本再切换一下啊 我记得之前有人教过我但是我忘了
枝江小狼王 : python3 -v
sanxian: 你用 python3 命令试下,说不定都 3.9 了
注册 : [[email protected] ~]# python -V Python 2.7.5 复制代码 [[email protected] ~]# pip install speedtest-cli -bash: pip: 未找到命令 复制代码
注册 : apt autoremove python python-pip -y In /usr/bin/python3 /usr/bin/python 复制代码
sanxian: python 默认 python2 python3 试试
YorkZhao: 错误:尝试移除受保护的 “yum” [[email protected] ~]# In /usr/bin/python3 /usr/bin/python -bash: In: 未找到命令 [[email protected] ~]# python -V Python 2.7.5 [[email protected] ~]# pip install speedtest-cli -bash: pip: 未找到命令 尝试了你回复的第一个 我用的 yum 执行了好多东西然后最后报错一个上面的内容 尝试 pip 还是不行 复制代码
枝江小狼王 : [[email protected] ~]# pip install speedtest-cli -bash: pip: 未找到命令 [[email protected] ~]# python3 -V Python 3.6.8 复制代码 我的目的是想使用一下那个 pip 安装测速脚本 但是如你所说的 python3 出来的确实是 3.68 但是也不是最新版不知道为什么 依然使用不了 pip 命令
sanxian: python3 -m pip install –upgrade pip 复制代码
sanxian: pip3
论坛大师 : 我擦 可以使用 pip 了 就是不知道这几个 warning 要不要紧 [[email protected] ~]# python3 -m pip install –upgrade pip WARNING: Running pip install with root privileges is generally not a good idea. Try `__main__.py install –user` instead. Collecting pip Downloading https://files.pythonhosted.org/packages/a4/6d/6463d49a933f547439d6b5b98b46af8742cc03ae83543e4d7688c2420f8b/pip-21.3.1-py3-none-any.whl (1.7MB) 100% |████████████████████████████████| 1.7MB 299kB/s Installing collected packages: pip Successfully installed pip-21.3.1 [[email protected] ~]# pip install speedtest-cli Collecting speedtest-cli Downloading speedtest_cli-2.1.3-py2.py3-none-any.whl (23 kB) Installing collected packages: speedtest-cli Successfully installed speedtest-cli-2.1.3 WARNING: Running pip as the ‘root’ user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv [[email protected] ~]# python -V Python 2.7.5 [[email protected] ~]# python3 -V Python 3.6.8 复制代码
Hello0World: 都给你说了 python 改成 python3 你就想不到 pip 改成 pip3 吗?服了 MJJ 了,完全没有折腾探索精神。
sanxian: 根据上边大佬说的解决了 但是目前有个新问题就是 pip 安装的脚本想卸载的话是咋用而且默认下载的位置是哪里哎呀
注册 : 根据这个命令解决了只使用 pip 就可以安装 而且网上好多教程给的命令也就直接 pip 没加三 能方便些不更好吗是吧
注册 : Python 默认设置为 python3 sudo update-alternatives –install /usr/bin/python python /usr/bin/python3 150 复制代码 centos 系统下慎用 默认改成 python3 以后 yum 命令报错 得找文档修改
sanxian: 我擦看来有些吓人还是算了
wendyhzy: miniconda