安裝python3 在添加軟鏈時報錯如下(翻譯過來的意思就是:創(chuàng)建符號鏈接失敗,文件存在。)
[root@VM-12-15-centos Python-3.7.6]# ln -s /usr/local/python3/bin/python3.7 /usr/bin/python3
ln: failed to create symbolic link '/usr/bin/python3': File exists
解決辦法1,加個f參數(shù)覆蓋之前存在的文件
ln -sf /usr/local/python3/bin/python3.7 /usr/bin/python3
把?-s?命令修改成?-sf?命令;-f?命令的意思是強制執(zhí)行,也就意味著如果不存在就執(zhí)行創(chuàng)建,存在就執(zhí)行覆蓋掉
?解決辦法2,先 刪除 再創(chuàng)建文章來源:http://www.zghlxwxcb.cn/news/detail-605962.html
#刪除原有的python3軟連接
rm -rf /usr/bin/python3
#創(chuàng)建python3軟連接
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
#驗證python3軟連接是否正常創(chuàng)建,正常會返回安裝的版本信息
pyton3 -V
#刪除原有的pip3軟連接
rm -rf /usr/bin/pip3
#創(chuàng)建pip3軟連接
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
#驗證pip3軟連接是否正常創(chuàng)建,正常創(chuàng)建會返回pip版本與關(guān)聯(lián)的python版本信息
pip3 -V
參考
解決:ln: failed to create symbolic link ‘/usr/bin/java’: File exists_番茄牛腩不吃番茄的博客-CSDN博客https://blog.csdn.net/LIFENG0402/article/details/118324501Centos編譯安裝Python3.9.10 - 分享即記憶 (waitsaber.org)文章來源地址http://www.zghlxwxcb.cn/news/detail-605962.html
到了這里,關(guān)于[已解決]ln: failed to create symbolic link ‘/usr/bin/python’: File exists的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!