View Issue Details

IDProjectCategoryView StatusLast Update
0001848Slicer4Core: Building (CMake, Superbuild)public2014-03-06 05:57
Reporterdomibel Assigned Tojcfr  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionunable to reproduce 
Product Version 
Target VersionSlicer 4.4.0Fixed in VersionSlicer 4.3.1-1 
Summary0001848: ImportError: No module named site
Description

I am using a non-standard build environment

I have problems starting Slicer

$ ./Slicer-build/Slicer
ImportError: No module named site

$ ./Slicer-build/Slicer --version
Slicer 4.1.0-rc2-2012-04-01
ImportError: No module named site

The following is working, a xterm windows appears
$ ./Slicer-build/Slicer --xterm

Any idea what that means? How can I generate more useful debug output?

Thanks,
Dominique

TagsNo tags attached.

Relationships

related to 0003268 closedjcfr Cannot set PYTHON_DIR 

Activities

jcfr

jcfr

2012-04-02 06:46

administrator   ~0003946

From Jc email - April 2d:

Folks,

Considering that PythonQt exposed the flag PythonQt::IgnoreSiteModule, this one is now used.

See https://github.com/Slicer/Slicer/blob/master/Base/QTCore/qSlicerCorePythonManager.cxx#L40

The associated CTK commit is the following: https://github.com/commontk/CTK/commit/dde2498274b9fc115838fcb5757ec5b1577975ea

Within PythonQt it self, we can also observe that Py_NoSiteFlag code is used: https://github.com/commontk/PythonQt/blob/patched/src/PythonQt.cpp#L164

Using Py_NoSiteFlag is the conventional python way to disable/enable (if not set) the loading of the site module. See http://hg.python.org/cpython/file/d3a82a26c705/Python/pythonrun.c#l79
and more particularly the method initSite: http://hg.python.org/cpython/file/d3a82a26c705/Python/pythonrun.c#l717

I also noticed that there is the python flag: Py_NoUserSiteDirectory, some research will have to be made to find out what the proper use of this flag.

All of that said, adding a try/catch may is probably not the appropriate solution, indeed the module is 'site.py' is by default available on properly installed Slicer python. It's part of the standard list of module. See http://hg.python.org/cpython/file/d3a82a26c705/Lib/site.py

Considering that Dominique already reported on issue associated with python on Debian Testing platform (similar to Ubuntu 12.04), I would suggest to push investigation into that direction. See http://na-mic.org/Bug/view.php?id=1850

The issue probably related to an incorrect python path ... or mis-installed Slicer python or ...

jcfr

jcfr

2013-02-23 19:39

administrator   ~0008024

Is this still an issue ? Could you provide more details allowing to reproduce the problem ?

domibel

domibel

2013-11-03 07:52

developer   ~0010263

I am not able to reproduce this behaviour anymore. I am closing this issue.

Issue History

Date Modified Username Field Change
2012-04-01 11:33 domibel New Issue
2012-04-01 11:33 domibel Status new => assigned
2012-04-01 11:33 domibel Assigned To => jcfr
2012-04-02 06:46 jcfr Note Added: 0003946
2012-08-21 12:24 jcfr Target Version => Slicer 4.3.0
2013-02-23 19:39 jcfr Note Added: 0008024
2013-02-23 19:39 jcfr Status assigned => feedback
2013-08-02 07:49 jcfr Relationship added related to 0003268
2013-08-30 12:50 jcfr Target Version Slicer 4.3.0 => Slicer 4.4.0
2013-11-03 07:52 domibel Note Added: 0010263
2013-11-03 07:52 domibel Status feedback => closed
2013-11-03 07:52 domibel Resolution open => unable to reproduce
2014-03-06 05:57 jcfr Fixed in Version => Slicer 4.3.1-1