pyfpdf icon indicating copy to clipboard operation
pyfpdf copied to clipboard

fpdf not working with .pyw

Open Bagel94 opened this issue 5 years ago • 4 comments

Came across an issue where having fpdf as an import will not allow my .pyw file to open outside of an IDE (Pycharm).

Used this to single fpdf out as the one that would not let my file open so that I could get it to run.. try: from fpdf import FPDF except: tk.messagebox.showwarning("Failed to import.")

Bagel94 avatar Oct 20 '20 16:10 Bagel94

does it work on python without w? also does the same hold true for https://pypi.org/project/fpdf2/?

alexanderankin avatar Oct 20 '20 18:10 alexanderankin

does it work on python without w? Yes, as a .py it will open as normal.

also does the same hold true for https://pypi.org/project/fpdf2/? Not sure, installed it using pip install fpdf2 and also removed fpdf (did not know if they would conflict), followed the tuturial on the link you included and I can not get it to do the "from fpdf import FPDF" gives "importerror cannot import name "FPDF" from 'fpdf' (unknown location)"

Bagel94 avatar Oct 20 '20 19:10 Bagel94

So just uninstalled fpdf2 and tried again, its now finding the reference and still seems to be doing the same thing as before with fpdf. will not open under .pyw.

Using logger I got this" ERROR:root:Import Issue. Traceback (most recent call last): File "E:\Documents\mwp\weightprog\WeightProgramV3.pyw", line 26, in from fpdf import FPDF ImportError: No module named fpdf

Bagel94 avatar Oct 20 '20 19:10 Bagel94

Alright sorry then, I've never worked with that feature before.

On Tue, Oct 20, 2020, 3:55 PM Bagel94 [email protected] wrote:

So just unstilled fpdf2 and tried again, its now finding the reference and still seems to be doing the same thing as before with fpdf. will not open under .pyw.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/reingart/pyfpdf/issues/165#issuecomment-713102295, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACECGJERLQFLEFZ4X33R25TSLXTL7ANCNFSM4SYSQVZA .

alexanderankin avatar Oct 20 '20 20:10 alexanderankin