View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003894 | Slicer4 | Core: Scripting (Wrapping, Python) | public | 2014-11-13 12:58 | 2016-01-26 12:19 |
Reporter | pinter | Assigned To | pinter | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | |||||
Target Version | Slicer 4.6.0 | Fixed in Version | Slicer 4.5.0-1 | ||
Summary | 0003894: Python wrapped classes not loaded when starting from Visual Studio for debugging | ||||
Description | This error message shows up in the python interactor if starting Slicer without the launcher (from Visual Studio or Xcode):
DICOM loading is not possible afterwards, because the python-wrapped module logic classes are not loaded due to a wrong sys.path (qt-loadable-modules folder is in the list, but the qt-loadable-modules/Debug is not) | ||||
Additional Information | Discussion thread: | ||||
Tags | No tags attached. | ||||
I'm leaning towards thinking that this problem is not specific to SliceViewAnnotations. Traceback (most recent call last): Digging deeper, it seems that many python modules are out of reach. For example if I want to explicitly import volumes logic, then I get this:
Same happens with logic and MRML for other loadable modules too. The reason of this is beyond my knowledge. |
|
Suspicion: wrong SlicerLauncherSettings.ini file is found, or wrong launcher is executed. |
|
It may be worth adding print statement and/or break point to qSlicerCoreApplicationPrivate::discoverSlicerHomeDirectory() |
|
The issue came back with a clean build, and cannot fix it with the steps I did before. |
|
qSlicerCoreApplicationPrivate::discoverSlicerHomeDirectory() returns the proper Slicer-build directory |
|
Can your start Slicer outside of Visual Studio using the launcher ? |
|
Yes, and it works as expected. Somehow the sys.path is different if I start it from VS (launching the Slicer-App project after starting VS with the launcher). The difference that causes the problems is that Slicer-build/lib/Slicer-4.4/qt-loadable-modules/Debug is missing (or Release, because it doesn't work with release either) |
|
Also there is a very strange entry in the faulty sys.path: Apparently it's constructed in a wrong way, there is no single quota and comma, but a colon. Strange... |
|
Sorry, I commented to the wrong ticket. I'm removing it and reopening this one. |
|
The problem is that PYTHONPATH is made empty by the function qSlicerExtensionsManagerModelPrivate::removeExtensionPathFromLauncherSettings at line 565. This should not be done, as empty is never good. Also I'm not sure this variable should be saved in the Slicer-NNNNN.ini, but there might be some legitim reason. Second, the "strange" invalid merged one-line path comes from qSlicerCoreApplicationPrivate::setPythonEnvironmentVariables(), where this variable is constructed at line 527, and it is done linux-style. I understand that many core developers use linux, but most users use Windows, so that platform should be considered at all times. All this is done because Slicer "thinks" I removed an extension (due to my own ini file magic that I do to make my life easier by not manually adding all the module paths when changing Slicer revision that happens awfully often), this is why I set it related to 0003876, which is basically the same issue. Jc, can you please comment on these? Thanks! |
|
Fixed the "extension removed" issue (just locally so that it doesn't occur, not the root cause), but the sys.path is still corrupt, so not the same issue as 0003876, still related. Investigating why the path is wrong |
|
This problem has not occurred in the last few months. I'm pretty sure it was due to the extension removal problem (and maybe some old windows disease too). |
|
The problem seems to be gone now, closing the issue |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2014-11-13 12:58 | pinter | New Issue | |
2014-11-13 13:27 | fedorov | Status | new => assigned |
2014-11-13 13:27 | fedorov | Assigned To | => mehrtash |
2014-11-14 06:06 | pinter | Note Added: 0012697 | |
2014-11-24 14:07 | pinter | Note Added: 0012726 | |
2014-11-24 14:07 | pinter | Status | assigned => closed |
2014-11-24 14:07 | pinter | Resolution | open => no change required |
2014-11-25 09:59 | jcfr | Note Added: 0012727 | |
2014-12-02 06:04 | pinter | Assigned To | mehrtash => |
2014-12-02 06:04 | pinter | Note Added: 0012744 | |
2014-12-02 06:04 | pinter | Status | closed => feedback |
2014-12-02 06:04 | pinter | Resolution | no change required => reopened |
2014-12-02 06:06 | pinter | Category | Module DataProbe => Core: Scripting (Wrapping, Python) |
2014-12-02 06:06 | pinter | Summary | Python error messages related to SliceViewAnnotations when starting without launcher => Python wrapped classes not loaded when starting from Visual Studio for debugging |
2014-12-02 06:06 | pinter | Description Updated | |
2014-12-02 06:10 | pinter | Note Added: 0012745 | |
2014-12-02 06:14 | jcfr | Note Added: 0012746 | |
2014-12-02 06:20 | pinter | Note Added: 0012747 | |
2014-12-02 06:23 | pinter | Note Added: 0012748 | |
2014-12-02 09:25 | pinter | Status | feedback => resolved |
2014-12-02 09:25 | pinter | Fixed in Version | => Slicer 4.4.1 |
2014-12-02 09:25 | pinter | Resolution | reopened => fixed |
2014-12-02 09:25 | pinter | Assigned To | => pinter |
2014-12-02 10:29 | jcfr | Status | resolved => closed |
2014-12-02 10:29 | jcfr | Target Version | => Slicer 4.4.1 |
2014-12-02 10:44 | pinter | Note Added: 0012753 | |
2014-12-02 10:45 | pinter | Status | closed => feedback |
2014-12-02 10:45 | pinter | Resolution | fixed => reopened |
2014-12-02 11:50 | pinter | Relationship added | related to 0003876 |
2014-12-02 11:54 | pinter | Note Added: 0012761 | |
2014-12-02 12:07 | pinter | Note Added: 0012762 | |
2014-12-03 06:30 | pinter | Note Edited: 0012762 | |
2015-04-23 07:04 | pinter | Note Added: 0013017 | |
2015-09-09 08:29 | jcfr | Fixed in Version | Slicer 4.4.1 => Slicer 4.5.0-1 |
2015-09-09 08:29 | jcfr | Target Version | Slicer 4.4.1 => Slicer 4.5.0-1 |
2015-11-02 11:27 | jcfr | Target Version | Slicer 4.5.0-1 => Slicer 4.6.0 |
2016-01-26 12:19 | pinter | Note Added: 0013752 | |
2016-01-26 12:19 | pinter | Status | feedback => assigned |
2016-01-26 12:19 | pinter | Status | assigned => closed |
2016-01-26 12:19 | pinter | Resolution | reopened => fixed |