I have created a script where we are using multiple imports as:
import re
import time
import easygui
import can
import threading
On Converting the script to exe using pyinstaller, it fails to include the can module and hence we get error as 'CAN module not found.
Need your inputs on how to resolve this
Related
Im trying to use vimbapython. every time I run anything that imports vimba import vimba the following error occurs:
from .c_binding import call_vimba_c, VIMBA_C_VERSION, VIMBA_IMAGE_TRANSFORM_VERSION, \
ImportError: attempted relative import with no known parent package
modules and drivers are all freshly installed.
Did anybody encountered something like that?
I am converting a python file to .exe using pyinstaller v5.0.1, but I got this error when I run the exe file:
ModuleNotFoundError: No module named 'reportlab.graphics.barcode.code93'
Note that the python file is working perfectly and I'm not even using code93 in my code.
I have fixed this issue by adding an import for all this libs even if I don't use them:
from reportlab.graphics.barcode import code93
from reportlab.graphics.barcode import code39
from reportlab.graphics.barcode import usps
from reportlab.graphics.barcode import usps4s
from reportlab.graphics.barcode import ecc200datamatrix
I wrote a python script to use in C#, but when I run my project this error occurs: "No module named Linq". what should I do? I took the import part from another part of project from TFS and it works well there, so what is going on?
import System
import clr
import sys
clr.AddReference(''System.Core'')
from System import Array
from System import DateTime
from System.Linq import Enumerable
from System import Func
Check your single vs double quotes.
But try "ImportExtensions"
clr.AddReference("System.Core")
import System
clr.ImportExtensions(System.Linq)
I am doing a small game in which I use "from tl.testing.thread import ThreadJoiner" to execute threads when executing from console the program as such works but when creating the executable with the help of cx_freeze I have the problem that when executing the program I get an error respect tl tells me that the module tl is not found and the program is not executed.
the error is this:
C:\Users\The.hacker\AppData\Local\Programs\Python\Python36-32\lib\site-packgages\cx_freeze\initscripts\_startup_.py",line 14,in run
module.run()
file:
C:\Users\The.hacker\AppData\Local\Programs\Python\Python36-32\lib\site-packgages\cx_freeze\initscripts\Console.py",line 26,in run
exec(code,m._dict_))
file "the_last_warrior",line 11,in <module>
Modulenotfounderror:no module named tl
on line 11 is the from tl.testing.thread import ThreadJoiner
now the image:
my file main is "the_last_warrior.py"
from tkinter import *
from tkinter import ttk
import tkinter as tk
import tkinter
from tl.testing.thread import ThreadJoiner
import threading
import datetime
from threading import Thread
has more than 1600 lines,In itself, how would the correct import of this module be? (from tl.testing.thread import ThreadJoiner)
picture of error:
console_vs_exe.jpg
After trying many things, I solved by copying the package directly from the folder "Lib \ site-packages" my package "tl" and paste it into the Lib folder of my program already ready after using the setup.py the program executes runs as I expected.
I want to import a color module but I am getting the error:
ImportError: No module named 'scripts.UltraColor'
Import code:
from scripts.UltraColor import *
The import code is in pygameTest.py
The problem here, as far as I can see on that screenshot is UltraColor file doesn't have the .py extension, for import to work properly you'll need to rename it from UltraColor to UltraColor.py, otherwise will raise an ImportError exception.
For more information, take a look to this one. Import a python module without the .py extension