Adrian, Success! I have managed to execute Networkx programs from Spyder.
The sys.path from the Spyder IPython console is currently Out[2]: ['', '/Applications/Spyder-Py2.app/Contents/Resources/lib/python2.7/spyderlib/utils/external', '/Library/Python/2.7', '/Library/Python/2.7/site-packages/networkx-1.9.1-py2.7.egg', '/Library/Python/2.7/site-packages/decorator-3.4.0-py2.7.egg', '/Library/Python/2.7/site-packages', '/Library/Python/2.7/site-packages/pyvtk', '/Library/Python/2.7/site-packages/graphviz', '/Library/Python/2.7/site-packages/py-1.4.26-py2.7.egg-info', '/Library/Python/2.7/site-packages/pytools-2014.3.5-py2.7.egg-info', '/Library/Python/2.7/site-packages/pytest-2.6.4-py2.7.egg-info', '/Library/Python/2.7/site-packages/MeshPy-2014.1-py2.7.egg-info', '/Library/Python/2.7/site-packages/PyVTK-0.4.85-py2.7.egg-info', '/Library/Python/2.7/site-packages/PyMetis-2014.1-py2.7.egg-info', '/Library/Python/2.7/site-packages/networkx-1.9.1-py2.7.egg/networkx', '/Users/cbhe/scripts', '/Users/cbhe/Documents/Python User Files 2015/Development Code', '/Applications/Spyder-Py2.app/Contents/Resources', '/Applications/Spyder-Py2.app/Contents/Resources/lib/python27.zip', '/Applications/Spyder-Py2.app/Contents/Resources/lib/python2.7', '/Applications/Spyder-Py2.app/Contents/Resources/lib/python2.7/plat-darwin', '/Applications/Spyder-Py2.app/Contents/Resources/lib/python2.7/plat-mac', '/Applications/Spyder-Py2.app/Contents/Resources/lib/python2.7/plat-mac/lib-scriptpackages', '/Applications/Spyder-Py2.app/Contents/Resources/lib/python2.7/lib-tk', '/Applications/Spyder-Py2.app/Contents/Resources/lib/python2.7/lib-old', '/Applications/Spyder-Py2.app/Contents/Resources/lib/python2.7/lib-dynload', '/Applications/Spyder-Py2.app/Contents/Resources/lib/python2.7/site-packages.zip', '/Applications/Spyder-Py2.app/Contents/Resources/lib/python2.7/site-packages', '/Applications/Spyder-Py2.app/Contents/Resources/lib/python2.7/IPython/extensions', '/Users/cbhe/.ipython'] In [3]: Any comments on the above are welcome. I am having some difficulty in installing Graphviz and Pygraph but that is for another day. Thank you for your help. It has been a learning experience for me. Chris > On 26 Mar 2015, at 1:00 am, Adrian Klaver <[email protected]> wrote: > > On 03/25/2015 12:20 AM, Chris Edwards wrote: >> Adrian, >> > >> >> _Check paths for presence of Networkx_ >> _ >> _ >> >> a. From the OS X Terminal the path below shows reference to Pymetis, >> Networkx and Metis. I thought that is what I had sent previously but >> apologise for any misunderstanding that I may have caused. >> >> Fl1cker:site-packages cbhe$ python >> Python 2.7.9rc1 (v2.7.9rc1:40eada278702, Nov 25 2014, 17:25:50) >> [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin >> Type "help", "copyright", "credits" or "license" for more information. >> >>> import sys >> >>> sys.path >> ['', >> '/Library/Python/2.7/site-packages/PyMetis-2014.1-py2.7-macosx-10.10-intel.egg', >> '/Library/Python/2.7/site-packages/networkx-1.9.1-py2.7.egg', >> '/Library/Python/2.7/site-packages/decorator-3.4.0-py2.7.egg', >> '/Library/Python/2.7/site-packages/metis-0.1a-py2.7.egg', >> '/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', >> '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', >> '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', >> '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', >> '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', >> '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', >> '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', >> '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', >> '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages', >> '/Library/Python/2.7/site-packages'] >> >>> >> >> > >> >> c. From the Spyder IPython console (this time there was no error >> message) the following path was shown. Again no reference to the three >> external packages that I want to use. >> >> ——————————————————————————————— >> IPython 3.0.0 -- An enhanced Interactive Python. >> ? -> Introduction and overview of IPython's features. >> %quickref -> Quick reference. >> help -> Python's own help system. >> object? -> Details about 'object', use 'object??' for extra details. >> %guiref -> A brief reference about the graphical user interface. >> >> In [1]: import sys >> >> In [2]: sys.path >> Out[2]: >> ['', >> >> '/Applications/Spyder-Py2.app/Contents/Resources/lib/python2.7/spyderlib/utils/external', >> '/Users/cbhe/scripts', >> '/Users/cbhe/Documents/Python User Files 2015/Development Code', >> '/Applications/Spyder-Py2.app/Contents/Resources', >> '/Applications/Spyder-Py2.app/Contents/Resources/lib/python27.zip', >> '/Applications/Spyder-Py2.app/Contents/Resources/lib/python2.7', >> '/Applications/Spyder-Py2.app/Contents/Resources/lib/python2.7/plat-darwin', >> '/Applications/Spyder-Py2.app/Contents/Resources/lib/python2.7/plat-mac', >> >> '/Applications/Spyder-Py2.app/Contents/Resources/lib/python2.7/plat-mac/lib-scriptpackages', >> '/Applications/Spyder-Py2.app/Contents/Resources/lib/python2.7/lib-tk', >> '/Applications/Spyder-Py2.app/Contents/Resources/lib/python2.7/lib-old', >> '/Applications/Spyder-Py2.app/Contents/Resources/lib/python2.7/lib-dynload', >> >> '/Applications/Spyder-Py2.app/Contents/Resources/lib/python2.7/site-packages.zip', >> >> '/Applications/Spyder-Py2.app/Contents/Resources/lib/python2.7/site-packages', >> >> '/Applications/Spyder-Py2.app/Contents/Resources/lib/python2.7/IPython/extensions', >> '/Users/cbhe/.ipython'] >> In [3]: >> ——————————————————————————————— >> >> _Source of Python package_ >> >> I downloaded the Python package from >> >> https://www.python.org/downloads/source/ >> >> _Starting again from scratch_ >> _ >> _ >> If you recommend that I do this would you be able to outline the steps >> required. > > Now that IPython seems to work and the paths are clearer I would hold off. > >> >> _Summary_ >> >> What I find odd is the fact that I can execute a python program that >> imports Networkx from the OS X Terminal, but that package is not >> recognised by Spyder. I can’t help wondering if the problem could be >> solved by adding to the Spyder system path (if that is possible). > > It is possible. In Spyder go to Tools-->PYTHONPATH manager and add the system > path for packages. From the looks of it, that is: > > /Library/Python/2.7/site-packages/ > > if that does not work, you could get specific: > > /Library/Python/2.7/site-packages/networkx-1.9.1-py2.7.egg > >> >> Thanks for your patience. >> >> Chris >> > > > > -- > Adrian Klaver > [email protected] > > -- > You received this message because you are subscribed to a topic in the Google > Groups "spyder" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/spyderlib/RxXRhb2pQOI/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/spyderlib. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "spyder" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/spyderlib. For more options, visit https://groups.google.com/d/optout.
