On 12/24/2015 9:59 AM, eryk sun wrote:
On Thu, Dec 24, 2015 at 5:06 AM, Nicky Mac <nmcelwa...@gmail.com> wrote:
not sure what you mean by "my profile".
following your suggestion, looks normal:
I meant your profile directory, "C:\Users\Nick". But printing the
package path showed the problem is in your Python 3 installation
itself.
C:\Users\Nick> python -c "import importlib;
print(importlib.find_loader('idlelib').path)"
C:\Python\Python35\lib\idlelib\__init__.pyc
This file should not exist. Python 3 stores .pyc files in a
__pycache__ subdirectory. It won't even run "idlelib\__init__.pyc" if
"idlelib\__init__.py" exists, so your installation is incomplete and
damaged. I suggest that you uninstall Python 3.5 and then completely
remove "C:\Python\Python35" before reinstalling.
'python -m xyz', where xyz is a package name (directory on disk), runs
xyx/__main__.py (or the xyz/__pycache__/__main__...34.py compiled
version). This file currently contains the following implementation,
subject to change.
"""
IDLE main entry point
Run IDLE as python -m idlelib
"""
import idlelib.PyShell
idlelib.PyShell.main()
# This file does not work for 2.7; See issue 24212.
The errant __init__.pyc should not directly be a problem, but does
indicate something wrong, such as 2.7 files mixed into your 3.5 install
(__cache__ is *not* used in 2.7). Based on my experience with this
happening, you might try running chkdsk, from an elevated Command Prompt.
'python -m idlelib.idle' runs idlelib/idle.py (or the cached version) to
mostly the same effect. The alternate entry has adjustments so it
works in an uninstalled development repository, while still working in
an installation.
From a python program, 'import idlelib.idle' needed as 'import idlelib'
would run idlelib/__init__.py, which is empty.
--
Terry Jan Reedy
--
https://mail.python.org/mailman/listinfo/python-list