While trying to fix wildcard imports I come across a few problems.
You can reproduce it by changing src/sas/sasgui/guiframe/local_perspectives/plotting/init.py to:
from .plotting import Plugin
However when you do this you see the following. I think it's due to a circular import. For whatever reason it doesn't appear with wildcard imports.
(sasview) p0006m:sasview anz$ pythonw run.py
13:55:21 - INFO : sas.sasview.sasview: 26: --- !SasView session started ---
13:55:21 - INFO : sas.sasview.sasview: 28: Python: 2.7.13 |Continuum Analytics, Inc.| (default, Dec 20 2016, 23:05:08)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]
13:55:21 - INFO : sas.sasview.sasview: 46: You have not set the SASVIEW_WX_VERSION environment variable, so using default version of wxPython.
13:55:22 - INFO : sas.sasview.sasview: 51: Wx version: 3.0.0.0
Traceback (most recent call last):
File "run.py", line 158, in
from sas.sasview.sasview import run
File "/Users/anz/Documents/Andy/programming/sasview/sasview/sasview.py", line 71, in
from sas.sasgui.guiframe import gui_manager
File "/Users/anz/Documents/Andy/programming/sasview/src/sas/sasgui/guiframe/gui_manager.py", line 40, in
from sas.sasgui.guiframe.data_panel import !DataPanel
File "/Users/anz/Documents/Andy/programming/sasview/src/sas/sasgui/guiframe/data_panel.py", line 31, in
from sas.sasgui.guiframe.local_perspectives.plotting.!SimplePlot
File "/Users/anz/Documents/Andy/programming/sasview/src/sas/sasgui/guiframe/local_perspectives/plotting/init.py", line 2, in
from .plotting import Plugin
File "/Users/anz/Documents/Andy/programming/sasview/src/sas/sasgui/guiframe/local_perspectives/plotting/plotting.py", line 23, in
from sas.sasgui.guiframe.gui_manager import MDIFrame
ImportError: cannot import name MDIFrame
Migrated from http://trac.sasview.org/ticket/949
{
"status": "new",
"changetime": "2017-10-26T20:11:14",
"_ts": "2017-10-26 20:11:14.333924+00:00",
"description": "While trying to fix wildcard imports I come across a few problems.\nYou can reproduce it by changing src/sas/sasgui/guiframe/local_perspectives/plotting/__init__.py to:\n\nfrom .plotting import Plugin\n\nHowever when you do this you see the following. I think it's due to a circular import. For whatever reason it doesn't appear with wildcard imports.\n\n(sasview) p0006m:sasview anz$ pythonw run.py\n13:55:21 - INFO : sas.sasview.sasview: 26: --- !SasView session started ---\n13:55:21 - INFO : sas.sasview.sasview: 28: Python: 2.7.13 |Continuum Analytics, Inc.| (default, Dec 20 2016, 23:05:08) \n[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]\n13:55:21 - INFO : sas.sasview.sasview: 46: You have not set the SASVIEW_WX_VERSION environment variable, so using default version of wxPython.\n13:55:22 - INFO : sas.sasview.sasview: 51: Wx version: 3.0.0.0\nTraceback (most recent call last):\n File \"run.py\", line 158, in <module>\n from sas.sasview.sasview import run\n File \"/Users/anz/Documents/Andy/programming/sasview/sasview/sasview.py\", line 71, in <module>\n from sas.sasgui.guiframe import gui_manager\n File \"/Users/anz/Documents/Andy/programming/sasview/src/sas/sasgui/guiframe/gui_manager.py\", line 40, in <module>\n from sas.sasgui.guiframe.data_panel import !DataPanel\n File \"/Users/anz/Documents/Andy/programming/sasview/src/sas/sasgui/guiframe/data_panel.py\", line 31, in <module>\n from sas.sasgui.guiframe.local_perspectives.plotting.!SimplePlot \\\n File \"/Users/anz/Documents/Andy/programming/sasview/src/sas/sasgui/guiframe/local_perspectives/plotting/__init__.py\", line 2, in <module>\n from .plotting import Plugin\n File \"/Users/anz/Documents/Andy/programming/sasview/src/sas/sasgui/guiframe/local_perspectives/plotting/plotting.py\", line 23, in <module>\n from sas.sasgui.guiframe.gui_manager import MDIFrame\nImportError: cannot import name MDIFrame",
"reporter": "andyfaff",
"cc": "",
"resolution": "",
"workpackage": "SasView Bug Fixing",
"time": "2017-04-11T03:57:41",
"component": "SasView",
"summary": "Wildcard import",
"priority": "minor",
"keywords": "",
"milestone": "SasView 5.0.0",
"owner": "",
"type": "defect"
}
While trying to fix wildcard imports I come across a few problems.
You can reproduce it by changing src/sas/sasgui/guiframe/local_perspectives/plotting/init.py to:
from .plotting import Plugin
However when you do this you see the following. I think it's due to a circular import. For whatever reason it doesn't appear with wildcard imports.
(sasview) p0006m:sasview anz$ pythonw run.py
13:55:21 - INFO : sas.sasview.sasview: 26: --- !SasView session started ---
13:55:21 - INFO : sas.sasview.sasview: 28: Python: 2.7.13 |Continuum Analytics, Inc.| (default, Dec 20 2016, 23:05:08)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]
13:55:21 - INFO : sas.sasview.sasview: 46: You have not set the SASVIEW_WX_VERSION environment variable, so using default version of wxPython.
13:55:22 - INFO : sas.sasview.sasview: 51: Wx version: 3.0.0.0
Traceback (most recent call last):
File "run.py", line 158, in
from sas.sasview.sasview import run
File "/Users/anz/Documents/Andy/programming/sasview/sasview/sasview.py", line 71, in
from sas.sasgui.guiframe import gui_manager
File "/Users/anz/Documents/Andy/programming/sasview/src/sas/sasgui/guiframe/gui_manager.py", line 40, in
from sas.sasgui.guiframe.data_panel import !DataPanel
File "/Users/anz/Documents/Andy/programming/sasview/src/sas/sasgui/guiframe/data_panel.py", line 31, in
from sas.sasgui.guiframe.local_perspectives.plotting.!SimplePlot
File "/Users/anz/Documents/Andy/programming/sasview/src/sas/sasgui/guiframe/local_perspectives/plotting/init.py", line 2, in
from .plotting import Plugin
File "/Users/anz/Documents/Andy/programming/sasview/src/sas/sasgui/guiframe/local_perspectives/plotting/plotting.py", line 23, in
from sas.sasgui.guiframe.gui_manager import MDIFrame
ImportError: cannot import name MDIFrame
Migrated from http://trac.sasview.org/ticket/949
{ "status": "new", "changetime": "2017-10-26T20:11:14", "_ts": "2017-10-26 20:11:14.333924+00:00", "description": "While trying to fix wildcard imports I come across a few problems.\nYou can reproduce it by changing src/sas/sasgui/guiframe/local_perspectives/plotting/__init__.py to:\n\nfrom .plotting import Plugin\n\nHowever when you do this you see the following. I think it's due to a circular import. For whatever reason it doesn't appear with wildcard imports.\n\n(sasview) p0006m:sasview anz$ pythonw run.py\n13:55:21 - INFO : sas.sasview.sasview: 26: --- !SasView session started ---\n13:55:21 - INFO : sas.sasview.sasview: 28: Python: 2.7.13 |Continuum Analytics, Inc.| (default, Dec 20 2016, 23:05:08) \n[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]\n13:55:21 - INFO : sas.sasview.sasview: 46: You have not set the SASVIEW_WX_VERSION environment variable, so using default version of wxPython.\n13:55:22 - INFO : sas.sasview.sasview: 51: Wx version: 3.0.0.0\nTraceback (most recent call last):\n File \"run.py\", line 158, in <module>\n from sas.sasview.sasview import run\n File \"/Users/anz/Documents/Andy/programming/sasview/sasview/sasview.py\", line 71, in <module>\n from sas.sasgui.guiframe import gui_manager\n File \"/Users/anz/Documents/Andy/programming/sasview/src/sas/sasgui/guiframe/gui_manager.py\", line 40, in <module>\n from sas.sasgui.guiframe.data_panel import !DataPanel\n File \"/Users/anz/Documents/Andy/programming/sasview/src/sas/sasgui/guiframe/data_panel.py\", line 31, in <module>\n from sas.sasgui.guiframe.local_perspectives.plotting.!SimplePlot \\\n File \"/Users/anz/Documents/Andy/programming/sasview/src/sas/sasgui/guiframe/local_perspectives/plotting/__init__.py\", line 2, in <module>\n from .plotting import Plugin\n File \"/Users/anz/Documents/Andy/programming/sasview/src/sas/sasgui/guiframe/local_perspectives/plotting/plotting.py\", line 23, in <module>\n from sas.sasgui.guiframe.gui_manager import MDIFrame\nImportError: cannot import name MDIFrame", "reporter": "andyfaff", "cc": "", "resolution": "", "workpackage": "SasView Bug Fixing", "time": "2017-04-11T03:57:41", "component": "SasView", "summary": "Wildcard import", "priority": "minor", "keywords": "", "milestone": "SasView 5.0.0", "owner": "", "type": "defect" }