我需要一些幫助並澄清 Python 環境應與 SDK 的腳本安裝程式進行通信

我需要一些幫助並澄清 Python 環境應與 SDK 的腳本安裝程式進行通信

Ubuntu 22.04(像所有其他以前的版本一樣)預設已經安裝了 Python,事實上,如果我打開終端機並輸入:

cris@cris:~$ python3 -V
Python 3.10.6

所以,Phyton 就在那裡!

當我嘗試透過腳本安裝建置應用程式所需的控制台 SDK 時,出現了我的疑問和問題。

如果我透過 a 開始安裝 SDK script.sh,在終端機中會出現以下錯誤:

Package python is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or is only available from another source.
However the following packages replace it:
2to3 python2-minimal:i386 python2:i386 python2-minimal python2 dh-python python-is-python3

事實上,在腳本中它被稱為

Python

而不是作為

蟒蛇3

所以,我的問題是,但是pythonpython3不是相同的功能/環境嗎?

或者,因為腳本確實會查找python並且因為它在系統中python調用而未安裝?phyton3

我在這裡真的很困惑......

答案1

好的,我解決了,我將名稱更改為script.shfrom pythonpython3腳本安裝工作正常。

我從它說安裝包的錯誤中得到了解決方案的靈感python-is-python3;我得知該包,它將創建一個符號連結來指向兩個 python 咒語之間;由於 Ubuntu 的所有 python 軟體包都使用明確的 python3 或 python2 解釋器。

但即使我安裝了它,應該可以解決這個小問題代碼拼字;就我而言,最終沒有,但我手動更改了以sript.sh讓它找到正確的 python (python3) 名稱。

誰有興趣可以在這裡檢查類似的內容: Ubuntu 20.04 中的 python-is-python3 軟體包 - 它是什麼以及它實際做什麼?

現在,我對預設 Python 環境更加清楚了。

相關內容