
我的 suse-linux 機器 (SUSE Linux Enterprise Server 12 SP1) 上有 Python 2.9。我已經將其升級到Python 3.8.8。
當我嘗試使用安裝 pip 時
zypper install python3-pip
它說找不到 python3-pip。我擔心 python3 沒有正確安裝。
當我運行時python3.8 -m test
,我收到此錯誤:
AttributeError: module 'posix' has no attribute '_all_'
During handling above exception, another exception occured:
SystemError: <built-in function dir> returned NULL without setting an error.
以下是我安裝 Python 3.8.8 的方法,我以 root 身分執行這些命令:
wget https://www.python.org/ftp/python/3.8.8/Python-3.8.8.tgz
tar -xvzf Python-3.8.8.tgz
cd Python-3.8.8
./configure
make
make install
export PATH=/usr/local/bin:$PATH
我在 Stack Overflow 上讀了很多問題,但沒有什麼真正有幫助的。
有人可以幫我解決這個問題嗎?
答案1
安裝 Anaconda 解決了這個問題。