woff 發表於 2024-3-7 13:45:21

在 Ubuntu 20.04 安装 Anaconda, pycharm 並啟用圖形化界面

在官網網址下載最新的Anaconda:https://www.anaconda.com/products/individual
下載完成後,在檔案所在的資料夾,右鍵開啟終端執行bash Anaconda3-2020.02- Linux -x86_64.sh

按下回車鍵,一直按住回車鍵,直到出現下圖所示



輸入yes:



到這裡已經完成安裝。


anaconda無法用ROOT身分執行

改檔案start.py找到路徑
nano /root/anaconda3/pkgs/anaconda-navigator-2.5.3-py311h06a4308_0/lib/python3.11/site-packages/anaconda_navigator/app/start.py進入start.py文件,點選鍵盤按鈕i 進入編輯模式,找到文件的114行,將原本的if (MAC or LINUX) and os.environ.get('SUDO_UID', None) is not None :
刪除not來手動修改啟動條件,修改後:if (MAC or LINUX) and os.environ.get('SUDO_UID', None) is None:
下一步安裝pycharm
下載網址:https://www.jetbrains.com/zh-cn/pycharm/download/#section=linux
進入新建立的目錄並把PYCHARM解壓縮放入:cd /opt/pycharm/
安裝JRE,jdksudo apt install default-jre
sudo apt-get install openjdk-17-jdk
sudo apt install openjdk-17-source

export PYCHARM_JDK=/usr/lib/jvm/java-17-openjdk-amd64
如果安裝太舊的JDK,會出現下列錯誤,換新版JDK即可,重複上述動作
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/baeldung/MajorMinorApp
has been compiled by a more recent version of the Java Runtime (class file version 55.0),
this version of the Java Runtime only recognizes class file versions up to 52.0

參考文章https://developer.aliyun.com/article/806602https://blog.csdn.net/qq_36468195/article/details/115256211


頁: [1]
查看完整版本: 在 Ubuntu 20.04 安装 Anaconda, pycharm 並啟用圖形化界面