Hello,
thanks for this information. If I do the search for Python 3 it goes into the default 3.5 directory.
Code: Select all
python3 -c "import sys; print('\n'.join(sys.path))"
which gives me these lines:
|usr/lib/python35.zip
/usr/lib/python3.5
/usr/lib/python3.5/plat-arm-linux-gnueabihf
/usr/lib/python3.5/lib-dynload
/usr/local/lib/python3.5/dist-packages
/usr/lib/python3/dist-packages
If I look for the specific 3.4 version
Code: Select all
python3.4 -c "import sys; print('\n'.join(sys.path))"
then the result is:
/usr/lib/python3.4
/usr/lib/python3.4/plat-arm-linux-gnueabihf
/usr/lib/python3.4/lib-dynload
/home/pi/.local/lib/python3.4/site-packages
/usr/local/lib/python3.4/dist-packages
/usr/lib/python3/dist-packages
which seems to be correct, because a tkinter package is also located in the python3.4/dist-packages directory. However if I start Python 3.4 and import tkinter, then I get the error message. I try to find out how to set the Pythonpath (after back-up)...but I guess that the cause for the issue is somewhere else.
Code: Select all
~ $ python3.4
Python 3.4.4 (default, Apr 17 2016, 16:02:33)
[GCC 5.3.1 20160409] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tkinter
Traceback (most recent call last):
File "/usr/lib/python3.4/tkinter/__init__.py", line 39, in <module>
import _tkinter
ImportError: No module named '_tkinter'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.4/tkinter/__init__.py", line 41, in <module>
raise ImportError(str(msg) + ', please install the python3-tk package')
ImportError: No module named '_tkinter', please install the python3-tk package
>>>
the same error occurs, when I run the __init__.py directly in its directory with:
Code: Select all
/usr/lib/python3.4/tkinter $ python3.4 ./__init__.py
Traceback (most recent call last):
File "./__init__.py", line 39, in <module>
import _tkinter
ImportError: No module named '_tkinter'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./__init__.py", line 41, in <module>
raise ImportError(str(msg) + ', please install the python3-tk package')
ImportError: No module named '_tkinter', please install the python3-tk package
instead, if I do the same with
Code: Select all
/usr/lib/python3.4/tkinter $ python3.5 ./__init__.py
then the little test window pops up and no error occurs. Therefore my guess would be, that python3.4 routes to the correct package directory, but the tkinter package version which is installed in the 3.4 lib directory is a 3.5 package version.
Maybe I should copy an old tkinter package from another Raspberry Pi with only python 3.4 installed.
I'll try this first.
Greetings and have a good start into the new week!
Oliver