Problems with python3.6 on one system, but OK on another

Cecil Westerhof Cecil at decebal.nl
Sat Jan 21 06:56:28 EST 2017


I build python3.6 on two systems. On one system everything is OK:
Python 3.6.0 (default, Jan 21 2017, 11:19:56) 
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.


But on another I get:
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Python 3.6.0 (default, Jan 21 2017, 12:20:38) 
[GCC 4.8.5] on linux
Type "help", "copyright", "credits" or "license" for more information.

Probably not a big problem, but just wondering what is happening here.
On both systems PYTHONHOME is not set and with the old version (3.4.5)
I did/do not get this message.


Another is that I used PYTHONSTARTUP to point to the following script:
    # startup script for python to enable saving of interpreter history and
    # enabling name completion

    # import needed modules
    import atexit
    import os
    import readline
    import rlcompleter

    # where is history saved
    historyPath = os.path.expanduser("~/.pyhistory")

    # handler for saving history
    def save_history(historyPath=historyPath):
        import readline
        try:
            readline.write_history_file(historyPath)
        except:
            pass

    # read history, if it exists
    if os.path.exists(historyPath):
        readline.set_history_length(10000)
        readline.read_history_file(historyPath)

    # register saving handler
    atexit.register(save_history)

    # enable completion
    readline.parse_and_bind('tab: complete')

    # cleanup
    del os, atexit, readline, rlcompleter, save_history, historyPath


This works with 3.4.5, but with 3.6 it gives:
Traceback (most recent call last):
  File "/etc/pythonstart", line 7, in <module>
    import readline
ModuleNotFoundError: No module named 'readline'


Probably not a big problem because I will mostly work with ipython3 at
the moment I get it working with 3.6, but just wondering.

By the way all other import (including rlcompleter) do work in 3.6.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof



More information about the Python-list mailing list