簡體   English   中英

無法在 linux 上安裝 python 3.6

[英]unable to install python 3.6 on linux

解壓縮該 python 3.6 tar.xz 文件后,我運行以下命令。

./configure
make
make install

錯誤日志:

ranlib libpython3.6m.a
gcc -pthread   -Xlinker -export-dynamic -o python Programs/python.o libpython3.6m.a -lpthread -ldl  -lutil -lrt   -lm  
if test "no-framework" = "no-framework" ; then \
        /usr/bin/install -c python /usr/local/bin/python3.6m; \
    else \
        /usr/bin/install -c -s Mac/pythonw /usr/local/bin/python3.6m; \
    fi
/usr/bin/install: cannot create regular file `/usr/local/bin/python3.6m': Read-only file system
make: *** [altbininstall] Error 1

當我運行 ./configure 后跟 make ,然后 make install 時,我遇到了這個錯誤!

您是否嘗試過使用sudo權限運行上述命令?

原答案: https : //askubuntu.com/q/865554/667903

sudo make install

如果您使用的是 Ubuntu 16.10 或 17.04,則 Python 3.6 位於 Universe 存儲庫中,因此您只需運行

sudo apt-get update
sudo apt-get install python3.6

您的文件系統似乎是只讀的。 您必須重新掛載/usr/local/bin/所在的分區並具有寫入權限

mount的語法是

mount -o remount,rw /partition/identifier /mount/point

假設您在/dev/sda2上有/

mount -o remount,rw / /dev/sda2

應該可以解決您的問題。

要檢查您的掛載點: cat /etc/fstabdf

檢查權限: cat /proc/mounts

在安裝包含編譯器、軟件包開發工具和庫的構建要點后嘗試: sudo apt-get install build-essential

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM