[Slackbuilds-users] Problem with python3

Audrius Kažukauskas audrius at neutrino.lt
Fri Feb 26 08:25:59 UTC 2010


On Fri, 2010-02-26 at 12:58:24 +1100, Kevin Pulo wrote:
> Hi,
> 
> This builds and installs fine, but I get the following when I try to
> run the python3.1 interpreter:
> 
>     $ python3.1
>     Could not find platform independent libraries <prefix>
>     Could not find platform dependent libraries <exec_prefix>
>     Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
>     Fatal Python error: Py_Initialize: can't initialize sys standard streams
>     ImportError: No module named encodings.utf_8
>     Aborted
>     $ 
> 
> Even when I try setting $PYTHONHOME to /usr, or /usr:/usr/bin, I still
> get the same error, minus the first 3 lines.

Looks like Python can't find its standard libraries.  And $PYTHONHOME
var should point to them if set, not to Python executable.  According to
the man page, standard libraries are searched in
${prefix}/lib/python<version> and ${exec_prefix}/lib/python<version> by
default (and both ${prefix} and ${exec_prefix} would be '/usr' in this
case if I'm not mistaken).  I wonder if the problem you're experiencing
is related to x86_64, where Python libraries are placed in
/usr/lib64/python<version>.

> This is on Slackware64 13.0, with alienBob's -current multilib
> compilers.
> 
> Any ideas?

Unfortunately, I don't have any 64bit system to test this, so I'm really
not sure how to remedy this properly.  One way would be to use
$PYTHONHOME, but there should be something better.

BTW, does Python 2.x from Slackware work well?  (I guess it does.)  I'll
look into its SlackBuild later today to see what it does for x86_64.

> I'm also wondering if copying the subdirectories of Tools/, most of
> which are standalone scripts, into the site-packages/ directory, is
> correct, since site-packages is supposed to be for python modules that
> are imported into the interpreter.  Probably these files belong in
> /usr/doc/python3-3.1.1, instead of just being symlinked there.

I was basing my SlackBuild on the official one, so I believe I've copied
this bit from there.

-- 
Audrius Kažukauskas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.slackbuilds.org/pipermail/slackbuilds-users/attachments/20100226/73e918b5/attachment.sig>


More information about the SlackBuilds-users mailing list