How to install and run PyMetis in Spyder

382 views
Skip to first unread message

Chris

unread,
Jan 29, 2015, 4:28:39 AM1/29/15
to spyd...@googlegroups.com
Hi,

I am trying to install and run PyMetis from within Spyder and am having trouble importing from PyMesh.
If anyone successfully achieved an execution of PyMetis from within Spyder I would be exceedingly grateful to hear if there are any traps that I might be missing. I suspect Paths may be a problem but am not sure.
I have spent many hours spinning my wheels in what seems to me to be a Unix jungle when all I want to do is partition graphs.

Chris


Carlos Córdoba

unread,
Jan 29, 2015, 8:24:02 AM1/29/15
to spyd...@googlegroups.com
Hi,

A couple of questions:

1. Have you successfully ran PyMetis outside Spyder?

2. How did you install PyMetis?

Cheers,
Carlos

El 29/01/15 a las 04:28, Chris escribió:
--
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 spyderlib+...@googlegroups.com.
To post to this group, send email to spyd...@googlegroups.com.
Visit this group at http://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/d/optout.

Chris Edwards

unread,
Jan 29, 2015, 8:06:43 PM1/29/15
to spyd...@googlegroups.com
Hi Carlos,

Thank you for answering my plea. The short answer is No, I have not succeeded in running PyMetis yet.

I have an iMac with OS X 10.10.2 installed and am currently running Spyder2 on both the iMac and on a Parallels virtual machine with Windows 7.  I have other python code running on both instances of Spyder.

I asked Andreas Kloeckner for guidance on how to install Pymetis and he sent me the following

Here are some generic instructions (that are for a different
package but should work with minor adaptations):

http://documen.tician.de/pyublas/installing.html

I tried to follow the instructions and have managed to create directories in /Users/cbhe/Documents/"Python User Files 2015" containing what appears to be the full software. Below are the contents of those directories. In the interim I decided to run Spyder from Windows as I had concluded that getting PyMetis to run from the terminal window was beyond my current capabilities.

/Users/cbhe/Documents/Python User Files 2015/PyMetis-2014.1
total 192
 8 -rw-r--r--@ 1 cbhe  staff   1829 12 Sep 05:53 LICENSE
 8 -rw-r--r--@ 1 cbhe  staff    391 12 Sep 12:11 MANIFEST.in
 8 -rw-r--r--@ 1 cbhe  staff    225  8 Jun  2013 Makefile.in
 8 -rw-r--r--@ 1 cbhe  staff   2182 12 Sep 12:36 PKG-INFO
 0 drwxr-xr-x@ 8 cbhe  staff    272 26 Jan 14:25 PyMetis.egg-info
 8 -rw-r--r--@ 1 cbhe  staff    310 12 Sep 05:53 README
 8 -rw-r--r--@ 1 cbhe  staff    754 12 Sep 12:23 README.rst
 8 -rw-r--r--  1 cbhe  staff   1090 12 May  2014 README_SETUP.txt
56 -rw-r--r--@ 1 cbhe  staff  26083 12 May  2014 aksetup_helper.py
56 -rw-r--r--  1 cbhe  staff  26724 20 Jan 20:42 aksetup_helper.pyc
 0 drwxr-xr-x@ 4 cbhe  staff    136 21 Jan 10:43 bpl-subset
 8 -rwxr-xr-x@ 1 cbhe  staff     91 12 May  2014 configure.py
 0 drwxr-xr-x@ 3 cbhe  staff    102 12 Sep 12:36 pymetis
 8 -rw-r--r--@ 1 cbhe  staff    134 12 Sep 12:36 setup.cfg
 8 -rw-r--r--@ 1 cbhe  staff   3606 12 Sep 12:22 setup.py
 0 drwxr-xr-x@ 5 cbhe  staff    170 21 Jan 10:34 src
 0 drwxr-xr-x@ 4 cbhe  staff    136 29 Jan 21:39 test

16 -rw-r--r--@  1 cbhe  staff   6512  8 Jun  2013 LICENSE
 8 -rw-r--r--@  1 cbhe  staff    568 11 Jun  2013 MANIFEST.in
 8 -rw-r--r--   1 cbhe  staff    524 29 Jan 20:39 Makefile
 8 -rw-r--r--@  1 cbhe  staff    337  8 Jun  2013 Makefile.in
 0 drwxr-xr-x@  7 cbhe  staff    238  7 Jul  2014 MeshPy.egg-info
 8 -rw-r--r--@  1 cbhe  staff   2613  7 Jul  2014 PKG-INFO
 8 -rw-r--r--   1 cbhe  staff   3117  8 Jun  2013 README
 8 -rw-r--r--@  1 cbhe  staff   1291 14 Jun  2014 README.rst
 8 -rw-r--r--@  1 cbhe  staff   1090 12 May  2014 README_SETUP.txt
56 -rw-r--r--@  1 cbhe  staff  26083 14 Jun  2014 aksetup_helper.py
56 -rw-r--r--   1 cbhe  staff  26724 20 Jan 20:56 aksetup_helper.pyc
 0 drwxr-xr-x@  4 cbhe  staff    136 20 Jan 19:08 bpl-subset
 8 -rwxr-xr-x@  1 cbhe  staff     91 12 May  2014 configure.py
 0 drwxr-xr-x@  3 cbhe  staff    102  7 Jul  2014 doc
 0 drwxr-xr-x@  3 cbhe  staff    102  7 Jul  2014 examples
 0 drwxr-xr-x@ 16 cbhe  staff    544 29 Jan 20:13 meshpy
 8 -rw-r--r--@  1 cbhe  staff    134  7 Jul  2014 setup.cfg
16 -rw-r--r--@  1 cbhe  staff   4494 14 Jun  2014 setup.py
 8 -rw-r--r--   1 cbhe  staff   3918 20 Jan 20:59 setup.pyc
 8 -rw-r--r--   1 cbhe  staff    167 29 Jan 20:39 siteconf.py
 0 drwxr-xr-x@  4 cbhe  staff    136 25 Jan 22:26 src
 0 drwxr-xr-x@  3 cbhe  staff    102 29 Jan 20:52 test
/Users/cbhe/Documents/Python User Files 2015/MeshPy-2014.1

I have the run setup programs for both the PyMetis and MeshPy packages and (I think) these ran correctly.

When I run a “reduced" version test_metis.py (below) with embedded print statements

 import numpy as np
    print "line 2"
    from math import pi, cos, sin
    print "Line 3"
    from meshpy.tet import MeshInfo, build
    print "line 4"
    from meshpy.geometry import \
            GeometryBuilder, generate_surface_of_revolution, EXT_CLOSED_IN_RZ
    print "line 5"
    big_r = 3
    little_r = 1.5
    
    print "big_r = ", big_r

I get the following returned

----------------------------------

runfile('Y:/Documents/Python User Files 2015/PyMetis-2014.1/test/reduced_test_metis.py', wdir='Y:/Documents/Python User Files 2015/PyMetis-2014.1/test')
Line 1
line 2
Line 3
Traceback (most recent call last):

  File "<ipython-input-1-2f1f067ddd14>", line 1, in <module>
    runfile('Y:/Documents/Python User Files 2015/PyMetis-2014.1/test/reduced_test_metis.py', wdir='Y:/Documents/Python User Files 2015/PyMetis-2014.1/test')

  File "C:\Python27\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 601, in runfile
    execfile(filename, namespace)

  File "C:\Python27\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 66, in execfile
    exec(compile(scripttext, filename, 'exec'), glob, loc)

  File "Y:/Documents/Python User Files 2015/PyMetis-2014.1/test/reduced_test_metis.py", line 71, in <module>
    main()

  File "Y:/Documents/Python User Files 2015/PyMetis-2014.1/test/reduced_test_metis.py", line 7, in main
    from meshpy.tet import MeshInfo, build

  File "\\psf\Home\Documents\Python User Files 2015\MeshPy-2014.1\meshpy\tet.py", line 2, in <module>
    import meshpy._tetgen as internals

ImportError: No module named _tetgen

-------------------------------

When I run test_mesh.py I get

-----------------------------

runfile('Y:/Documents/Python User Files 2015/MeshPy-2014.1/test/test_meshpy.py', wdir='Y:/Documents/Python User Files 2015/MeshPy-2014.1/test')
Reloaded modules: meshpy, meshpy.common
Traceback (most recent call last):

  File "<ipython-input-4-d151e4026252>", line 1, in <module>
    runfile('Y:/Documents/Python User Files 2015/MeshPy-2014.1/test/test_meshpy.py', wdir='Y:/Documents/Python User Files 2015/MeshPy-2014.1/test')

  File "C:\Python27\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 601, in runfile
    execfile(filename, namespace)

  File "C:\Python27\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 66, in execfile
    exec(compile(scripttext, filename, 'exec'), glob, loc)

  File "Y:/Documents/Python User Files 2015/MeshPy-2014.1/test/test_meshpy.py", line 216, in <module>
    main([__file__])

TypeError: 'NoneType' object is not callable

——————————————

At this point I am at a loss as to what to do next, and would very much appreciate any pointers/help/guidance.

Best regards

Chris











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/zFe6V43Gkqk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to spyderlib+...@googlegroups.com.

Chris

unread,
Feb 8, 2015, 12:50:27 AM2/8/15
to spyd...@googlegroups.com
Hello again,

I guess the lack of replies suggests that either PyMetis will not run from Spyder or no one has tried to do this before (hard to believe). For me this is a frustrating conclusion and I am not sure what to do next.

It is disappointing that products like PyMetis are made available without adequate instruction for installing them (or perhaps even providing a Launcher).

Spyder provides a great development environment.

Sad!

Adrian Klaver

unread,
Feb 8, 2015, 10:11:53 AM2/8/15
to spyd...@googlegroups.com
On 02/07/2015 09:50 PM, Chris wrote:
> Hello again,
>
> I guess the lack of replies suggests that either PyMetis will not run
> from Spyder or no one has tried to do this before (hard to believe). For
> me this is a frustrating conclusion and I am not sure what to do next.

What your error messages show is that the PyMetis install you have done
to date is incomplete. This is really nothing to do with Spyder, but is
on the folks who provide PyMetis. I went to the PyMetis page to see what
could be found out, that was not much. It is more confusing then
enlightening.

>
> It is disappointing that products like PyMetis are made available
> without adequate instruction for installing them (or perhaps even
> providing a Launcher).

Do you have pip installed on your machine?

>
> Spyder provides a great development environment.
>
> Sad!
>
> On Thursday, January 29, 2015 at 8:28:39 PM UTC+11, Chris wrote:
>
> Hi,
>
> I am trying to install and run PyMetis from within Spyder and am
> having trouble importing from PyMesh.
> If anyone successfully achieved an execution of PyMetis from within
> Spyder I would be exceedingly grateful to hear if there are any
> traps that I might be missing. I suspect Paths may be a problem but
> am not sure.
> I have spent many hours spinning my wheels in what seems to me to be
> a Unix jungle when all I want to do is partition graphs.
>
> Chris
>


--
Adrian Klaver
adrian...@aklaver.com

Adrian Klaver

unread,
Feb 8, 2015, 10:50:26 AM2/8/15
to spyd...@googlegroups.com
On 02/07/2015 09:50 PM, Chris wrote:
> Hello again,
>
> I guess the lack of replies suggests that either PyMetis will not run
> from Spyder or no one has tried to do this before (hard to believe). For
> me this is a frustrating conclusion and I am not sure what to do next.
>
> It is disappointing that products like PyMetis are made available
> without adequate instruction for installing them (or perhaps even
> providing a Launcher).

Well I tried to install it here on my Linux machine. First the pip
install is not helpful as it does not install the dependencies, in this
case MeshPy. Second the configure/install procedure uses a non standard
setup routine, aksetup. I went ahead and installed MeshPy and also
installed the development libraries of Boost as that seems to be a
requirement also. At this point I could build meshpy, but then it seg
faulted when I ran the test. Best guess this has to do with:
"
If you don't want to continue reading, just try the regular
./configure.py --help
./configure.py --some-options
make
sudo make install
That should do the trick. (By the way: If a config option says "several ok",
then you may specify several values, separated by commas.)"

from here. Since I could not find out that values you are supposed to
pass to the configure I gave up.

If you really need this program I would say a post to one of these lists
here:

http://lists.tiker.net/

is in order. Maybe someone there knows the necessary magic incantation.

>
> Spyder provides a great development environment.
>
> Sad!
>
> On Thursday, January 29, 2015 at 8:28:39 PM UTC+11, Chris wrote:
>
> Hi,
>
> I am trying to install and run PyMetis from within Spyder and am
> having trouble importing from PyMesh.
> If anyone successfully achieved an execution of PyMetis from within
> Spyder I would be exceedingly grateful to hear if there are any
> traps that I might be missing. I suspect Paths may be a problem but
> am not sure.
> I have spent many hours spinning my wheels in what seems to me to be
> a Unix jungle when all I want to do is partition graphs.
>
> Chris
>


--
Adrian Klaver
adrian...@aklaver.com

Chris Edwards

unread,
Feb 10, 2015, 3:59:33 AM2/10/15
to spyd...@googlegroups.com
Adrian,

Thank you for the attempt. I appreciate your effort.

At least I know it is not a direct Spyder problem. I will try the lists.tiker.net address as you suggest and see where that gets me.

Chris

Reply all
Reply to author
Forward
0 new messages