Unable to install Python without sudo access

前端 未结 4 987
孤城傲影
孤城傲影 2020-12-04 06:51

I extracted, configured and used make for the installation package in my server.

However, I could not use make install. I get the error

[~/w         


        
4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-04 07:20

    Extending bobince answer, there is an issue if you don't have the readline development package installed in your system, and you don't have root access.

    When Python is compiled without readline, your arrow keys won't work in the interpreter. However, you can install the readline standalone package as follows: Adding Readline Functionality Without Recompiling Python

    On the other hand, if you prefer to compile python using a local installation of readline, here's how.

    Before doing as bobince was telling, compile and install readline. These are the steps to do so:

    • wget ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz
    • tar -zxvf readline-6.2.tar.gz
    • cd readline-6.2
    • ./configure --with-prefix=$HOME/.local
    • make
    • make install

    Then, add this line to your .bash_profile script:

    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/.local/lib
    

    Last, but not least, execute the following command

    export LDFLAGS="-L$HOME/.local"
    

    I hope this helps someone!

提交回复
热议问题