berteh / ScribusGenerator

Create beautiful documents with data. Open source pdf (and Scribus) template and mail-merge alternative.
http://berteh.github.io/ScribusGenerator/
MIT License
247 stars 37 forks source link

Module Not Found Error, Windows 10 #165

Closed cummingsrob closed 3 years ago

cummingsrob commented 3 years ago

Traceback (most recent call last): File "", line 11, in File "", line 24, in ModuleNotFoundError: No module named 'Tkinter'

I had this working about a year ago, but I'm struggling to get it working again. What am I missing?

berteh commented 3 years ago

Maybe you are running Python3 but with the Python version 2 ScribusGenerator.... or maybe your flavour of Python does not include the TKinter GUI library?

For the first try downloading (or ''git checkout python3'') the python 3 branch.

For the second kindly run the Scribus internal script editor and check python version and try running the Scribus Generator from there on, checking for version and TKinter import. If that is not satisfactory play check with the staff and forum of Scribus., Add I have no me Henk

Good luck!

B.

Le mar. 12 janv. 2021 à 23:13, Rob notifications@github.com a écrit :

Traceback (most recent call last): File "", line 11, in File "", line 24, in ModuleNotFoundError: No module named 'Tkinter'

I had this working about a year ago, but I'm struggling to get it working again. What am I missing?

cummingsrob commented 3 years ago

I am running Python 3.8.7. It appears that it's 'tkinter' (lower case) not 'Tkinter' in this version.

berteh commented 3 years ago

Yes indeed, and the Python3 code for ScribusGenerator does indeed use that syntax:

import tkinter
from tkinter import Frame, LabelFrame, Label, Entry, Button, StringVar, OptionMenu, Checkbutton, IntVar, DISABLED, NORMAL, PhotoImage
import tkinter.messagebox
import tkinter.filedialog

Just make sure you download the python3 version, used for Scribus 1.5.6+: https://github.com/berteh/ScribusGenerator/archive/python3.zip (or ''git checkout python3'' if you use the git repository)

and not the default Python2 version, that is used for Python2 shipped in (stable) Scribus 1.4.x up to 1.5.5 series... as there are a few other syntactic changes between these versions.

berteh commented 3 years ago

did it work for you by installing the python3 version of Scribus Generator? https://github.com/berteh/ScribusGenerator/archive/python3.zip

cummingsrob commented 3 years ago

I have not tried it yet. The client project I needed it for has been put on hold.

Thanks for following up!

.................................................... rob cummings 313 530 8002

On Tue, Mar 2, 2021 at 4:33 PM Berteh notifications@github.com wrote:

did it work for you by installing the python3 version of Scribus Generator? https://github.com/berteh/ScribusGenerator/archive/python3.zip

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/berteh/ScribusGenerator/issues/165#issuecomment-789232500, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPJXVATDLUYCBLQHTGSX5LTBVKSLANCNFSM4V735JKA .

berteh commented 3 years ago

ok, you're welcome. Should be fine so I'll close the issue for now. Feel free to reopen or start a new one if you need help on this.

cummingsrob commented 3 years ago

The good news is that this version seems to be working. It no longer crashes and appears to work.

I do have what I think is an unrelated issue, though. I'm printing multiple records on a sheet, but I can't get record 1 to print. It always starts with record 2. It does not seem to matter where I put the %SG_NEXT-RECORD% tag. If I remove the next record from the first record, it prints the second record twice. Is there an order that the variables are read & replaced? Left to right? Top to bottom? Level by level?

image

cummingsrob commented 3 years ago

I removed the %SG_NEXT-RECORD% tag and it still starts with record 2.

UltraSalem commented 3 years ago

In my experience tags are read in level order, lowest to top. So I design a single piece of my layout, put a new box with the %SG_NEXT-RECORD% tag as the last thing in that layout, and then duplicate the layout (including tag) multiple times to fill up the document if I want multiple records per page. I then remove the tag from the last copy of the layout on the page as the script already knows that at the end of the page you go to the next record.

On Thu, 29 Apr 2021 at 06:45, Rob @.***> wrote:

I removed the %SG_NEXT-RECORD% tag and it still starts with record 2.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

berteh commented 3 years ago

using this NEXT-RECORD feature really works, but is so error prone I just compiled available info in a dedicated page:

https://github.com/berteh/ScribusGenerator/wiki/How-to-use-%25SG_NEXT-RECORD%25

please have a look, try see if it helps and improve its content of others to struggle less. Thanks !

@cummingsrob I could have a quick look at your template if you care to share SLA and (sample) CSV.

cummingsrob commented 3 years ago

The problem I'm seeing s that with 384 rows of data, it starts with record

  1. When I reduce that to only 36 rows of data for testing, it starts with row 1 like it should.
cummingsrob commented 3 years ago

Oops, you can ignore this for now. It somehow fixed itself. I think the problem was either in LibreOffice calc or my CSV. ¯_(ツ)_/¯

berteh commented 3 years ago

Congrats on finding your problem. Enjoy SG.