osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

execfile and import not working



On 06.09.2017 10:55, Thomas Jollans wrote:
> On 2017-09-06 10:14, Friedrich Rentsch wrote:
>> Hi, I am setting up Python 2.7 after an upgrade to Ubuntu 16.04, a
>> thorough one, leaving no survivors. Everything is fine, IDLE opens,
>> ready to go. Alas, execfile and import commands don't do my bidding, but
>> hang IDLE. All I can do is kill the process named "python" from a bash
>> terminal. IDLE then is still open, says "=== RESTART: Shell ===" and is
>> again ready for action. It works interactively, but no imports . . .
>> What could be the problem?
> Some debugging ideas:
>
> - Do imports work if you start "python" from the terminal, rather than
> using IDLE? If not, is there an error message?
> - If python (in the terminal) hangs, and you press Ctrl+C, what happens?
> - If you start idle from the terminal and do what you've been doing so
> far, are there any error messages?
> - What if you kill idle instead of python?
>
>
It works now! Even from the launcher. Looks like the new installation 
sets PYTHONPATH to something wrong. I set it to nothing on Peter's 
advice and that may have cured the problem. I didn't read the setting 
before I erased it. So I don't know what it was. Next I'll have to find 
out which configuration file needs to be edited.

Thank you all for your help

Frederic