Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #99482 > unrolled thread
| Started by | Cecil Westerhof <Cecil@decebal.nl> |
|---|---|
| First post | 2015-11-25 21:23 +0100 |
| Last post | 2015-11-26 23:48 -0600 |
| Articles | 13 — 6 participants |
Back to article view | Back to comp.lang.python
Help needed with compiling python Cecil Westerhof <Cecil@decebal.nl> - 2015-11-25 21:23 +0100
Re: Help needed with compiling python Zachary Ware <zachary.ware+pylist@gmail.com> - 2015-11-25 14:49 -0600
Re: Help needed with compiling python Cecil Westerhof <Cecil@decebal.nl> - 2015-11-25 22:52 +0100
Re: Help needed with compiling python Zachary Ware <zachary.ware+pylist@gmail.com> - 2015-11-25 16:39 -0600
Re: Help needed with compiling python Cecil Westerhof <Cecil@decebal.nl> - 2015-11-26 07:55 +0100
Re: Help needed with compiling python Laura Creighton <lac@openend.se> - 2015-11-25 23:58 +0100
Re: Help needed with compiling python Cecil Westerhof <Cecil@decebal.nl> - 2015-11-26 08:00 +0100
Re: Help needed with compiling python Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-11-26 19:29 +1100
Re: Help needed with compiling python Cecil Westerhof <Cecil@decebal.nl> - 2015-11-26 22:33 +0100
Re: Help needed with compiling python Kev Dwyer <kevin.p.dwyer@gmail.com> - 2015-11-27 06:46 +0000
Re: Help needed with compiling python Dave Farrance <df@see.replyto.invalid> - 2015-11-26 11:07 +0000
Re: Help needed with compiling python Cecil Westerhof <Cecil@decebal.nl> - 2015-11-26 22:39 +0100
Re: Help needed with compiling python Zachary Ware <zachary.ware+pylist@gmail.com> - 2015-11-26 23:48 -0600
| From | Cecil Westerhof <Cecil@decebal.nl> |
|---|---|
| Date | 2015-11-25 21:23 +0100 |
| Subject | Help needed with compiling python |
| Message-ID | <877fl596c6.fsf@Equus.decebal.nl> |
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?
--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
[toc] | [next] | [standalone]
| From | Zachary Ware <zachary.ware+pylist@gmail.com> |
|---|---|
| Date | 2015-11-25 14:49 -0600 |
| Message-ID | <mailman.94.1448484579.20593.python-list@python.org> |
| In reply to | #99482 |
On Wed, Nov 25, 2015 at 2:23 PM, Cecil Westerhof <Cecil@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
[toc] | [prev] | [next] | [standalone]
| From | Cecil Westerhof <Cecil@decebal.nl> |
|---|---|
| Date | 2015-11-25 22:52 +0100 |
| Message-ID | <8737vt927c.fsf@Equus.decebal.nl> |
| In reply to | #99486 |
On Wednesday 25 Nov 2015 21:49 CET, Zachary Ware wrote:
> On Wed, Nov 25, 2015 at 2:23 PM, Cecil Westerhof <Cecil@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).
My system python was all-ready damaged: that is why I wanted to build
myself.
> 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`.
It is an openSUSE system. I installed the readline with:
zypper install readline-devel
The strange thing is that it does mot compile anymore now. I get:
Python build finished, but the necessary bits to build these modules were not found:
_bsddb _tkinter bsddb185
dbm dl gdbm
imageop sunaudiodev
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
I have to look into that.
I still can install it, but get the same errors.
I think I need a bit more time to solve it.
--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
[toc] | [prev] | [next] | [standalone]
| From | Zachary Ware <zachary.ware+pylist@gmail.com> |
|---|---|
| Date | 2015-11-25 16:39 -0600 |
| Message-ID | <mailman.101.1448491194.20593.python-list@python.org> |
| In reply to | #99493 |
On Wed, Nov 25, 2015 at 3:52 PM, Cecil Westerhof <Cecil@decebal.nl> wrote: > My system python was all-ready damaged: that is why I wanted to build > myself. Then you should try to repair the system Python install via the system package manager. It's not worth the hassle to try to replace it; it almost certainly won't work for some strange corner case that won't bite you until 3 months from now. It's perfectly OK to have a second Python install in /usr/local, even of the same version as the system Python. > It is an openSUSE system. I installed the readline with: > zypper install readline-devel > > The strange thing is that it does mot compile anymore now. I get: > Python build finished, but the necessary bits to build these modules were not found: > _bsddb _tkinter bsddb185 > dbm dl gdbm > imageop sunaudiodev > To find the necessary bits, look in setup.py in detect_modules() for the module's name. Before you installed readline-devel, readline would have been listed there as well. It's ok to have modules listed there if you don't need those particular modules. Most of those are actually deprecated, and have been removed from Python 3. Of those that remain, _tkinter requires tcl-devel and tk-devel; dbm and gdbm require similarly named development packages (I have no experience with using dbm/gdbm). -- Zach
[toc] | [prev] | [next] | [standalone]
| From | Cecil Westerhof <Cecil@decebal.nl> |
|---|---|
| Date | 2015-11-26 07:55 +0100 |
| Message-ID | <87lh9ldzbc.fsf@Equus.decebal.nl> |
| In reply to | #99500 |
On Wednesday 25 Nov 2015 23:39 CET, Zachary Ware wrote:
> On Wed, Nov 25, 2015 at 3:52 PM, Cecil Westerhof <Cecil@decebal.nl> wrote:
>> My system python was all-ready damaged: that is why I wanted to
>> build myself.
>
> Then you should try to repair the system Python install via the
> system package manager. It's not worth the hassle to try to replace
> it; it almost certainly won't work for some strange corner case that
> won't bite you until 3 months from now. It's perfectly OK to have a
> second Python install in /usr/local, even of the same version as the
> system Python.
I tried that. It did install things in /usr/lib and /usr/lib64, but
nothing in /usr/bin. Thought to solve it this way, but I suppose I
have to delve deeper in it.
>> It is an openSUSE system. I installed the readline with:
>> zypper install readline-devel
>>
>> The strange thing is that it does mot compile anymore now. I get:
>> Python build finished, but the necessary bits to build these
>> modules were not found: _bsddb _tkinter bsddb185 dbm dl gdbm
>> imageop sunaudiodev To find the necessary bits, look in setup.py in
>> detect_modules() for the module's name.
>
> Before you installed readline-devel, readline would have been listed
> there as well. It's ok to have modules listed there if you don't
I did not look good the first time then, because I do not remember
having those messages.
But I still get:
ImportError: No module named readline
--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
[toc] | [prev] | [next] | [standalone]
| From | Laura Creighton <lac@openend.se> |
|---|---|
| Date | 2015-11-25 23:58 +0100 |
| Message-ID | <mailman.102.1448492328.20593.python-list@python.org> |
| In reply to | #99493 |
In a message of Wed, 25 Nov 2015 22:52:23 +0100, Cecil Westerhof writes: > >My system python was all-ready damaged: that is why I wanted to build >myself. Your Suse system probably wants to use python for something. If your system python is damaged, you badly need to fix that, using the system package managers tools, before Suse does some sort of update on you, using the broken python, which damages more of your system. Laura
[toc] | [prev] | [next] | [standalone]
| From | Cecil Westerhof <Cecil@decebal.nl> |
|---|---|
| Date | 2015-11-26 08:00 +0100 |
| Message-ID | <87h9k9dz2t.fsf@Equus.decebal.nl> |
| In reply to | #99503 |
On Wednesday 25 Nov 2015 23:58 CET, Laura Creighton wrote: > In a message of Wed, 25 Nov 2015 22:52:23 +0100, Cecil Westerhof > writes: >> >> My system python was all-ready damaged: that is why I wanted to >> build myself. > > Your Suse system probably wants to use python for something. If your > system python is damaged, you badly need to fix that, using the > system package managers tools, before Suse does some sort of update > on you, using the broken python, which damages more of your system. I tried that. But it installs only things in /usr/lib and /usr/lib64, nothing in /usr/bin, but at the same time it is adamant that it installed python. I wanted a quick fix, but it looks like that is not going to work. :'-( I'll have to find a way to get things fixed. -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof
[toc] | [prev] | [next] | [standalone]
| From | Steven D'Aprano <steve+comp.lang.python@pearwood.info> |
|---|---|
| Date | 2015-11-26 19:29 +1100 |
| Message-ID | <5656c2e0$0$11120$c3e8da3@news.astraweb.com> |
| In reply to | #99534 |
On Thursday 26 November 2015 18:00, Cecil Westerhof wrote: > On Wednesday 25 Nov 2015 23:58 CET, Laura Creighton wrote: > >> In a message of Wed, 25 Nov 2015 22:52:23 +0100, Cecil Westerhof >> writes: >>> >>> My system python was all-ready damaged: that is why I wanted to >>> build myself. >> >> Your Suse system probably wants to use python for something. If your >> system python is damaged, you badly need to fix that, using the >> system package managers tools, before Suse does some sort of update >> on you, using the broken python, which damages more of your system. > > I tried that. But it installs only things in /usr/lib and /usr/lib64, > nothing in /usr/bin, but at the same time it is adamant that it > installed python. I wanted a quick fix, but it looks like that is not > going to work. :'-( I'll have to find a way to get things fixed. > On the assumption that you are more interested in fixing your broken system than learning how to compile Python, what happens if you use the Suse package manager to re-install Python? e.g. zypper python or equivalent. -- Steve
[toc] | [prev] | [next] | [standalone]
| From | Cecil Westerhof <Cecil@decebal.nl> |
|---|---|
| Date | 2015-11-26 22:33 +0100 |
| Message-ID | <87d1uwe99e.fsf@Equus.decebal.nl> |
| In reply to | #99539 |
On Thursday 26 Nov 2015 09:29 CET, Steven D'Aprano wrote: > On Thursday 26 November 2015 18:00, Cecil Westerhof wrote: > >> On Wednesday 25 Nov 2015 23:58 CET, Laura Creighton wrote: >> >>> In a message of Wed, 25 Nov 2015 22:52:23 +0100, Cecil Westerhof >>> writes: >>>> >>>> My system python was all-ready damaged: that is why I wanted to >>>> build myself. >>> >>> Your Suse system probably wants to use python for something. If >>> your system python is damaged, you badly need to fix that, using >>> the system package managers tools, before Suse does some sort of >>> update on you, using the broken python, which damages more of your >>> system. >> >> I tried that. But it installs only things in /usr/lib and >> /usr/lib64, nothing in /usr/bin, but at the same time it is adamant >> that it installed python. I wanted a quick fix, but it looks like >> that is not going to work. :'-( I'll have to find a way to get >> things fixed. >> > > On the assumption that you are more interested in fixing your broken > system than learning how to compile Python, what happens if you use > the Suse package manager to re-install Python? > > e.g. zypper python It installs things in /usr/lib and /usr/lib64, but nothing in /usr/bin. So it installs libraries, but not programs. By the way: I am of-course most interested to fix my system, but I would not mind to have python compiled also, so I (can) work with the latest stable version. ;-) -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof
[toc] | [prev] | [next] | [standalone]
| From | Kev Dwyer <kevin.p.dwyer@gmail.com> |
|---|---|
| Date | 2015-11-27 06:46 +0000 |
| Message-ID | <mailman.167.1448606793.20593.python-list@python.org> |
| In reply to | #99601 |
Cecil Westerhof wrote: > On Thursday 26 Nov 2015 09:29 CET, Steven D'Aprano wrote: > >> On Thursday 26 November 2015 18:00, Cecil Westerhof wrote: >> >>> On Wednesday 25 Nov 2015 23:58 CET, Laura Creighton wrote: >>> >>>> In a message of Wed, 25 Nov 2015 22:52:23 +0100, Cecil Westerhof >>>> writes: >>>>> >>>>> My system python was all-ready damaged: that is why I wanted to >>>>> build myself. >>>> >>>> Your Suse system probably wants to use python for something. If >>>> your system python is damaged, you badly need to fix that, using >>>> the system package managers tools, before Suse does some sort of >>>> update on you, using the broken python, which damages more of your >>>> system. >>> >>> I tried that. But it installs only things in /usr/lib and >>> /usr/lib64, nothing in /usr/bin, but at the same time it is adamant >>> that it installed python. I wanted a quick fix, but it looks like >>> that is not going to work. :'-( I'll have to find a way to get >>> things fixed. >>> >> >> On the assumption that you are more interested in fixing your broken >> system than learning how to compile Python, what happens if you use >> the Suse package manager to re-install Python? >> >> e.g. zypper python > > It installs things in /usr/lib and /usr/lib64, but nothing in > /usr/bin. So it installs libraries, but not programs. > > > By the way: I am of-course most interested to fix my system, but I > would not mind to have python compiled also, so I (can) work with the > latest stable version. ;-) > FWIW, I'm running OpenSuse 13.2 on a number of machines. Pythons built with make altinstall have the python executable placed in /usr/local/bin. e.g.: kev@pluto ~ which python3.5 /usr/local/bin/python3.5 kev@pluto ~ which python2.7 /usr/local/bin/python2.7 NB due to http://bugs.python.org/issue15631 I find I have to symlink lib-dynload to get a working python: kev@pluto ~ ls -l /usr/local/lib/python3.5/lib-dynload lrwxrwxrwx 1 root root 38 Sep 26 19:51 /usr/local/lib/python3.5/lib-dynload -> /usr/local/lib64/python3.5/lib-dynload Having said that, I'd still recommend that you follow everyone else's advice and fix your system python/rebuild your OS. Opensuse has not attempted to install python 2.7.9 on any of my (fully patched) machines, so something is wrong with your install, unless you're using Tumbleweed. Cheers, Kev
[toc] | [prev] | [next] | [standalone]
| From | Dave Farrance <df@see.replyto.invalid> |
|---|---|
| Date | 2015-11-26 11:07 +0000 |
| Message-ID | <pdpd5b9nn14apgog6pie58lhr2ivfo9i57@4ax.com> |
| In reply to | #99534 |
Cecil Westerhof <Cecil@decebal.nl> wrote: >On Wednesday 25 Nov 2015 23:58 CET, Laura Creighton wrote: >> >> Your Suse system probably wants to use python for something. If your >> system python is damaged, you badly need to fix that, using the >> system package managers tools, before Suse does some sort of update >> on you, using the broken python, which damages more of your system. > >I tried that. But it installs only things in /usr/lib and /usr/lib64, >nothing in /usr/bin, but at the same time it is adamant that it >installed python. I wanted a quick fix, but it looks like that is not >going to work. :'-( I'll have to find a way to get things fixed. A complete reinstall of Suse (after saving your home directory and work) might be quickest if you're in the dark about what's broken. But you might be able to fix it. If you can figure out which packages contain the damaged files, then do forced reinstalls of those. I've not used Suse, but a quick Google tells me that the syntax is: zypper in -f <package-name> So you'll want to try package names like "python" and "python2.7".
[toc] | [prev] | [next] | [standalone]
| From | Cecil Westerhof <Cecil@decebal.nl> |
|---|---|
| Date | 2015-11-26 22:39 +0100 |
| Message-ID | <878u5ke8zu.fsf@Equus.decebal.nl> |
| In reply to | #99553 |
On Thursday 26 Nov 2015 12:07 CET, Dave Farrance wrote: > Cecil Westerhof <Cecil@decebal.nl> wrote: > >> On Wednesday 25 Nov 2015 23:58 CET, Laura Creighton wrote: >>> >>> Your Suse system probably wants to use python for something. If >>> your system python is damaged, you badly need to fix that, using >>> the system package managers tools, before Suse does some sort of >>> update on you, using the broken python, which damages more of your >>> system. >> >> I tried that. But it installs only things in /usr/lib and >> /usr/lib64, nothing in /usr/bin, but at the same time it is adamant >> that it installed python. I wanted a quick fix, but it looks like >> that is not going to work. :'-( I'll have to find a way to get >> things fixed. > > A complete reinstall of Suse (after saving your home directory and > work) might be quickest if you're in the dark about what's broken. > > But you might be able to fix it. If you can figure out which > packages contain the damaged files, then do forced reinstalls of > those. I've not used Suse, but a quick Google tells me that the > syntax is: > > zypper in -f <package-name> > > So you'll want to try package names like "python" and "python2.7". Sadly that also only installs only libraries and no applications. -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof
[toc] | [prev] | [next] | [standalone]
| From | Zachary Ware <zachary.ware+pylist@gmail.com> |
|---|---|
| Date | 2015-11-26 23:48 -0600 |
| Message-ID | <mailman.166.1448603339.20593.python-list@python.org> |
| In reply to | #99602 |
On Thu, Nov 26, 2015 at 3:39 PM, Cecil Westerhof <Cecil@decebal.nl> wrote: > On Thursday 26 Nov 2015 12:07 CET, Dave Farrance wrote: >> zypper in -f <package-name> >> >> So you'll want to try package names like "python" and "python2.7". > > Sadly that also only installs only libraries and no applications. Try "python-base". (See `zypper wp /usr/bin/python`). -- Zach
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web