Hello Iassoan,
Thank you for your help these days. My work nearly finishes, just 2 problems left.
I have built the custom project partly successful (include some new python packages like PyQt5 and Matplotlib).
While I met 2 problems. One is about the custom building, the other one is about the build-installer-package.
1、Problem about custom building.
I followed the step in https://blog.kitware.com/slicercat-creating-custom-applications-based-on-3d-slicer/
The building process is successful. I got an “AB.exe” file in the “Slicer-build” folder.
When I open it(AB.exe), I found some of my custom configs( such as rename the title from ‘AB’ to ‘Reader’) in my extension module (I set it as the default startup module) work well at the beginning. And then my custom configs(the title “Reader”) were replaced by system original configs(“AB”) rapidly. So most of my custom configs were failed. (this problem just affect outlook, so I can still work on it)
2、Problem about the “build-installer-package”
When I start to build installer-package as the follow instruct. even though the installer-package was built successfully, but after I install and open it some problems will happen.
On one of my computers, it can’t be started.
On another computer, I started, but some bugs about the Python package raised. Shows below.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "D:\Program Files\AB 0.1.0-0000-00-00\lib\Python\Lib\imp.py", line 170, in load_source
module = _exec(spec, sys.modules[name])
File "<frozen importlib._bootstrap>", line 618, in _exec
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "D:/Program Files/AB 0.1.0-0000-00-00/bin/../lib/AB-4.13/qt-scripted-modules/Reader.py", line 22, in <module>
from PyQt5 import QtCore,Qt,QtGui
ImportError: DLL load failed: The specified module could not be found.
So, for Problem 1, I guess it may about the starting sequence.
for Problem 2, I have no idea. It might about the method of built installer_package. I want to assure, I have a new module in slicer, then the create install_package process show start by “Slicer.exe --VisualStudioProject” is it right? maybe something wrong in here?
It is not only the problem with the PyQt5 package. (I have tried to move code “from PyQt5 import QtCore,Qt,QtGui” to back of other code, another package got a problem)
Traceback (most recent call last):
File “”, line 1, in
File “D:\Program Files\AB 0.1.0-0000-00-00\lib\Python\Lib\imp.py”, line 170, in load_source
module = _exec(spec, sys.modules[name])
File “”, line 618, in _exec
File “”, line 678, in exec_module
File “”, line 219, in _call_with_frames_removed
File “D:/Program Files/AB 0.1.0-0000-00-00/bin/…/lib/AB-4.13/qt-scripted-modules/Reader.py”, line 45, in
from matplotlib import pyplot as pp
File “D:\Program Files\AB 0.1.0-0000-00-00\lib\Python\Lib\site-packages\matplotlib\pyplot.py”, line 115, in
_backend_mod, new_figure_manager, draw_if_interactive, show = pylab_setup()
File "D:\Program Files\AB 0.1.0-0000-00-00\lib\Python\Lib\site-packages\matplotlib\backends_init.py", line 62, in pylab_setup
[backend_name], 0)
File “D:\Program Files\AB 0.1.0-0000-00-00\lib\Python\Lib\site-packages\matplotlib\backends\backend_tkagg.py”, line 4, in
from . import tkagg # Paint image to Tk photo blitter extension.
File “D:\Program Files\AB 0.1.0-0000-00-00\lib\Python\Lib\site-packages\matplotlib\backends\tkagg.py”, line 5, in
from six.moves import tkinter as Tk
File “D:\Program Files\AB 0.1.0-0000-00-00\lib\Python\Lib\site-packages\six.py”, line 92, in get
result = self._resolve()
File “D:\Program Files\AB 0.1.0-0000-00-00\lib\Python\Lib\site-packages\six.py”, line 115, in _resolve
return _import_module(self.mod)
File “D:\Program Files\AB 0.1.0-0000-00-00\lib\Python\Lib\site-packages\six.py”, line 82, in import_module
import(name)
File "D:\Program Files\AB 0.1.0-0000-00-00\lib\Python\Lib\tkinter_init.py", line 36, in
import _tkinter # If this fails your Python may not be configured for Tk
ModuleNotFoundError: No module named ‘_tkinter’
Could you give me some advice to solve these problems?
Thanks again~