Help needed with compiling python

Zachary Ware zachary.ware+pylist at gmail.com
Wed Nov 25 15:49:16 EST 2015


On Wed, Nov 25, 2015 at 2:23 PM, Cecil Westerhof <Cecil at decebal.nl> wrote:
> I wanted to install python myself. I started with 2.7.10. If that
> works I also will install 3.5.0.
>
> I did:
>     ./configure --prefix=/usr
>     make
>     make altinstall
>
> I have:
>     /usr/bin/python2.7
>
> But when I execute this, I get:
>     Could not find platform dependent libraries <exec_prefix>
>     Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
>     Python 2.7.10 (default, Nov 25 2015, 20:58:29)
>     [GCC 4.8.5] on linux2
>     Type "help", "copyright", "credits" or "license" for more information.
>     Traceback (most recent call last):
>       File "/etc/pythonstart", line 7, in <module>
>         import readline
>     ImportError: No module named readline
>
> What do I need to do to get it working?

First off, I strongly suggest not using --prefix=/usr.  Stick with
--prefix=/usr/local (the default) to avoid overwriting the system
Python, which may differ from a source build (and, in fact,
overwriting your system Python may be what's causing some of your
problems; those first two lines are worrying).

Secondly, there are several optional modules that are not compiled
unless particular libraries are found to link against, including
readline.  You'll need the readline development package (probably
readline-dev or readline-devel, depending on your distribution).  You
can quickly pull in the dependencies for all optional modules by doing
something like the following for an apt-based system: `apt-get
build-dep python3`.

Hope this helps,
-- 
Zach



More information about the Python-list mailing list