之前有安裝了 python2,最近因為 python3 已經推出很久,就來安裝一下。
先更新資料庫:
#pkg update Updating FreeBSD_latest repository catalogue... pkg: repository meta has wrong version 2 pkg: Repository FreeBSD_latest load error: meta cannot be loaded No error: 0 Fetching meta.txz: 100% 916 B 0.9kB/s 00:01 pkg: repository meta has wrong version 2 repository FreeBSD_latest has no meta file, using default settings Fetching packagesite.txz: 100% 6 MiB 1.1MB/s 00:06 pkg: repository meta has wrong version 2 pkg: Repository FreeBSD_latest load error: meta cannot be loaded No error: 0 Unable to open created repository FreeBSD_latest Unable to update repository FreeBSD_latest Error updating repositories!
結果出現錯誤,查了一下,原來是 pkg 版本太舊。
更新一下 pkg:
#pkg bootstrap -f
再更新一次 pkg 資料庫後才能安裝 python3:
#pkg update #pkg install python3
執行居然會有錯誤:
#python3 Shared object "libdl.so.1" not found, required by "python3"
爬了一下文章,把相關檔案複製過來(後來發現,用 ln -s 好像比較好):
#cp /lib/libc.so.7 /lib/libdl.so.1
再來安裝 pip 跟相關套件
#python3 -m ensurepip #pip3 install --upgrade setuptools #python3 -m pip install --upgrade pip #pip3 search BeautifulSoup4
Please follow and like us: