scieloorg / PC-Programs

SciELO PC Programs
7 stars 24 forks source link

[xpm] erro ModuleNotFoundError: No module named 'Tkinter' executando via linha de comando com `pyenv` #3095

Open lpanebr opened 5 years ago

lpanebr commented 5 years ago

Oi @robertatakenaka hoje fui tentar usar o xpm via linha de comando e tive este erro quando executo via pyenv.

O erro ocorre nas versões 2.7.14 e 3.6.3 via pyenv mesmo após eu instalar os pacotes python-tk:

sudo apt-get install python3-tk
sudo apt-get install python-tk
$ pyenv local 3.6.3
$ python xml_package_maker.py ~/Downloads/1677-5449-jvb-14-02_20180814/scielo_package/
no Tkinter
source "/home/lpanebr/Dropbox/work/SciELO_XPM/xml/app_modules/../../xml/app_data/venv/scielo-programs/bin/activate";python "/home/lpanebr/Dropbox/work/SciELO_XPM/xml/app_modules/../../xml/run_app.py" xml_package_maker.py /home/lpanebr/Downloads/1677-5449-jvb-14-02_20180814/scielo_package/
sh: 1: source: not found
no Tkinter
Traceback (most recent call last):
  File "/home/lpanebr/Dropbox/work/SciELO_XPM/xml/app_modules/app/interface.py", line 6, in <module>
    import tkinter as tk
  File "/home/lpanebr/.pyenv/versions/3.6.3/lib/python3.6/tkinter/__init__.py", line 36, in <module>
    import _tkinter # If this fails your Python may not be configured for Tk
ModuleNotFoundError: No module named '_tkinter'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/lpanebr/Dropbox/work/SciELO_XPM/xml/app_modules/../../xml/run_app.py", line 61, in <module>
    main(sys.argv)
  File "/home/lpanebr/Dropbox/work/SciELO_XPM/xml/app_modules/../../xml/run_app.py", line 42, in main
    from app_modules.app import xpm
  File "/home/lpanebr/Dropbox/work/SciELO_XPM/xml/app_modules/app/xpm.py", line 6, in <module>
    from . import interface
  File "/home/lpanebr/Dropbox/work/SciELO_XPM/xml/app_modules/app/interface.py", line 9, in <module>
    import Tkinter as tk
ModuleNotFoundError: No module named 'Tkinter'
lpanebr commented 5 years ago

Mudei o título e descrição pois percebi que o problema ocorre quando roda com versões do python via pyenv.

Depois que rodei usando o python do sistema rodou certin!

Seria interesante se pudesse executar via python pyenv