install WAFO

742 views
Skip to first unread message

Renaud Laborbe

unread,
May 22, 2013, 2:54:29 PM5/22/13
to wa...@googlegroups.com
Hello,

I am trying to install WAFO on ubuntu 13.04 64bits.

However I have the following error message

Using /usr/lib/python2.7/dist-packages
Searching for scipy==0.11.0
Best match: scipy 0.11.0
Adding scipy 0.11.0 to easy-install.pth file

Using /usr/lib/python2.7/dist-packages
Finished processing dependencies for wafo==0.1.2
running develop
Checking .pth file support in build/bdist.linux-x86_64/egg
/usr/bin/python -E -c pass
TEST FAILED: build/bdist.linux-x86_64/egg does NOT support .pth files
error: bad install directory or PYTHONPATH

You are attempting to install a package to a directory that is not
on PYTHONPATH and which Python does not read ".pth" files from.  The
installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    build/bdist.linux-x86_64/egg

and your PYTHONPATH environment variable currently contains:

    ''

Here are some of your options for correcting the problem:

* You can choose a different installation directory, i.e., one that is
  on PYTHONPATH or supports .pth files

* You can add the installation directory to the PYTHONPATH environment
  variable.  (It must then also be on PYTHONPATH whenever you run
  Python and want to use the package(s) you are installing.)

* You can set up the installation directory to support ".pth" files by
  using one of the approaches described here:


Please make the appropriate changes for your system and try again.


I try to add the current directory to my PYTHONPATH but nothing happend
Thank you in advance for your help

Renaud Laborbe

unread,
Jun 3, 2013, 9:28:31 AM6/3/13
to wa...@googlegroups.com

I would be very pleased to find a way to install pywafo on ubuntu.
Does anyone know what is the workaround  for the my error message ?


Le mercredi 22 mai 2013 20:54:29 UTC+2, Renaud Laborbe a écrit :
Hello,

I am trying to install pyWAFO on ubuntu 13.04 64bits.

pab

unread,
Jun 4, 2013, 2:20:11 AM6/4/13
to wa...@googlegroups.com
Try to uncomment the "sys.argv.append("develop")" in the setup.py file. Then issue the install command: "python setup.py install"

Best regards Per A. Brodtkorb

Renaud Laborbe

unread,
Jun 4, 2013, 6:36:02 AM6/4/13
to wa...@googlegroups.com
Thank you for your help.

I was using the svn version of the toolbox.
After the performing the following command :
svn checkout http://pywafo.googlecode.com/svn/trunk/ pywafo-read-only

 the setup.py comes with the line sys.argv.append("develop") uncommented.
In this case I still have the following error :

Installed /usr/local/lib/python2.7/dist-packages/wafo-0.1.2-py2.7.egg
Processing dependencies for wafo==0.1.2
Searching for Numdifftools==0.4.0
Best match: Numdifftools 0.4.0
Processing Numdifftools-0.4.0-py2.7.egg
Numdifftools 0.4.0 is already the active version in easy-install.pth
Using /usr/local/lib/python2.7/dist-packages/Numdifftools-0.4.0-py2.7.egg
Searching for numpy==1.7.1
Best match: numpy 1.7.1
Adding numpy 1.7.1 to easy-install.pth file


So reading your post, I thought I was not using the right version so I have dowloaded the file under the "download button :

In this case the file is commented.

It complains of a syntax error I could not reproduce here, probably because the library have been overwrited.

Thanks again


 
Le mercredi 22 mai 2013 20:54:29 UTC+2, Renaud Laborbe a écrit :

Per Andreas Brodtkorb

unread,
Jun 4, 2013, 12:02:44 PM6/4/13
to wa...@googlegroups.com
Sorry, I meant comment out or delete the sys.argv.append("develop") statement.

Per A.


--
Du mottar denne meldingen fordi du abonnerer på Google-gruppen «wafo».
For å melde seg av denne gruppen og slutte å motta e-poster fra den, send en e-post til wafo+uns...@googlegroups.com.
Hvis du vil legge inn en melding i denne gruppen, kan du sende e-post til wa...@googlegroups.com.
Besøk denne gruppen på http://groups.google.com/group/wafo?hl=no.
Du finner flere alternativer på https://groups.google.com/groups/opt_out.
 
 

Renaud Laborbe

unread,
Jun 4, 2013, 2:15:44 PM6/4/13
to wa...@googlegroups.com
Thank you for your comment.

I have started from scratch on a new computer deleting the sys.argv.append("develop") statement

But is does not seems to be working.
Herethe end of the install process output :

creating build/bdist.linux-x86_64/egg/EGG-INFO
copying src/wafo.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying src/wafo.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying src/wafo.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying src/wafo.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying src/wafo.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
writing build/bdist.linux-x86_64/egg/EGG-INFO/native_libs.txt
zip_safe flag not set; analyzing archive contents...
wafo.data.info: module references __file__
creating dist
creating 'dist/wafo-0.1.2-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing wafo-0.1.2-py2.7.egg
creating /usr/local/lib/python2.7/dist-packages/wafo-0.1.2-py2.7.egg
Extracting wafo-0.1.2-py2.7.egg to /usr/local/lib/python2.7/dist-packages
SyntaxError: ('unknown encoding: mbcs', ('/usr/local/lib/python2.7/dist-packages/wafo-0.1.2-py2.7.egg/wafo/MSPPT.py', 0, 0, None))

SyntaxError: ('unknown encoding: mbcs', ('/usr/local/lib/python2.7/dist-packages/wafo-0.1.2-py2.7.egg/wafo/MSO.py', 0, 0, None))

Adding wafo 0.1.2 to easy-install.pth file


Installed /usr/local/lib/python2.7/dist-packages/wafo-0.1.2-py2.7.egg
Processing dependencies for wafo==0.1.2
Searching for numdifftools>=0.2
Reading http://pypi.python.org/simple/numdifftools/
Reading http://code.google.com/p/numdifftools/
Best match: Numdifftools 0.4.0
Downloading http://pypi.python.org/packages/source/N/Numdifftools/Numdifftools-0.4.0.zip#md5=944981e22d56ff299f73124ea1e62edc
Processing Numdifftools-0.4.0.zip
Writing /tmp/easy_install-2_8eBK/Numdifftools-0.4.0/setup.cfg
Running Numdifftools-0.4.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-2_8eBK/Numdifftools-0.4.0/egg-dist-tmp-4xxRtP
zip_safe flag not set; analyzing archive contents...
Adding Numdifftools 0.4.0 to easy-install.pth file

Installed /usr/local/lib/python2.7/dist-packages/Numdifftools-0.4.0-py2.7.egg
Searching for numpy==1.6.2
Best match: numpy 1.6.2
Adding numpy 1.6.2 to easy-install.pth file

Using /usr/lib/python2.7/dist-packages
Searching for scipy==0.10.1
Best match: scipy 0.10.1
Adding scipy 0.10.1 to easy-install.pth file


Using /usr/lib/python2.7/dist-packages
Finished processing dependencies for wafo==0.1.2



And here is what I get when I run the test script :

python nose_all.py
Please wait, this may take a while
Traceback (most recent call last):
  File "nose_all.py", line 6, in <module>
    sub.check_call('nosetests', stderr=sub.STDOUT)
  File "/usr/lib/python2.7/subprocess.py", line 506, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 493, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1259, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

And finally the error message when I import wafo from the console
ipython
Python 2.7.3 (default, Sep 26 2012, 21:51:14)
Type "copyright", "credits" or "license" for more information.

IPython 0.13.1.rc2 -- 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.

In [1]: import wafo
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-e151eca7ef1d> in <module>()
----> 1 import wafo

/usr/local/lib/python2.7/dist-packages/wafo-0.1.2-py2.7.egg/wafo/__init__.py in <module>()
      4 import data
      5 import demos
----> 6 import kdetools
      7 import objects
      8 import spectrum

/usr/local/lib/python2.7/dist-packages/wafo-0.1.2-py2.7.egg/wafo/kdetools.py in <module>()
     25 from wafo.dctpack import dct, dctn, idctn
     26 from wafo.plotbackend import plotbackend as plt
---> 27 from wafo import fig
     28
     29 _TINY = np.finfo(float).machar.tiny

/usr/local/lib/python2.7/dist-packages/wafo-0.1.2-py2.7.egg/wafo/fig.py in <module>()
     37 from __future__ import division
     38 #import win32api
---> 39 import win32gui
     40 import win32con
     41 import msvcrt

ImportError: No module named win32gui


looking forward hearing from you
Du mottar denne meldingen fordi du abonnerer på et emne i Google-gruppen «wafo».
For å avslutte abonnementet på dette emnet, gå til https://groups.google.com/d/topic/wafo/gu55Up8m4nI/unsubscribe?hl=no.
For å melde deg av denne gruppen og alle emner, send en e-post til wafo+uns...@googlegroups.com.

Per Andreas Brodtkorb

unread,
Jun 4, 2013, 2:40:09 PM6/4/13
to wa...@googlegroups.com
Sorry about all that. The errors you get here are related to toolboxes only available on windows. The solution is to remove all dependencies on fig.py , MSPPT.py, MSO.py, ie. remove thes files and all import statements using them.

Best regards Per A

David Verelst

unread,
Jun 4, 2013, 4:33:27 PM6/4/13
to wa...@googlegroups.com
I would propose to put the Window dependencies in try...except blocks, so a Linux install will work properly. I'll do that tomorrow, test it and push the changes.

Regards,
David

David Verelst

unread,
Jun 4, 2013, 6:30:05 PM6/4/13
to wa...@googlegroups.com
And changes made. Now you should be able to install on Linux again. I tested here in a virtualenv (Arch Linux).

Per A: can you agree with those changes? Should have asked first before committing, sorry for that... I don't think windows installations are affected, and changes are minimal.

Regards,
David

Per Andreas Brodtkorb

unread,
Jun 5, 2013, 12:34:42 AM6/5/13
to wa...@googlegroups.com
Yes, I agree. Good job. 

Renaud Laborbe

unread,
Jun 5, 2013, 7:02:53 AM6/5/13
to wa...@googlegroups.com
Hello,


Thank you for your help.

Did you commit the changes ? How can I get access to them ? I have used the svn command few minutes ago. It des not seems to be working.



svn checkout http://pywafo.googlecode.com/svn/trunk/ pywafo-read-only


and then installing. Here is the output.



zip_safe flag not set; analyzing archive contents...
wafo.data.info: module references __file__
creating 'dist/wafo-0.1.2-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing wafo-0.1.2-py2.7.egg
creating /usr/local/lib/python2.7/dist-packages/wafo-0.1.2-py2.7.egg
Extracting wafo-0.1.2-py2.7.egg to /usr/local/lib/python2.7/dist-packages
SyntaxError: ('unknown encoding: mbcs', ('/usr/local/lib/python2.7/dist-packages/wafo-0.1.2-py2.7.egg/wafo/MSPPT.py', 0, 0, None))

I had a look to the fig.py file.
It imports win32gui and win32con.

Are those libraries for windows only ?

Per Andreas Brodtkorb

unread,
Jun 5, 2013, 10:06:45 AM6/5/13
to wa...@googlegroups.com
Yes, win32gui and win32con are windows libraries only.

To install on linux:
svn checkout http://pywafo.googlecode.com/svn/trunk/ pywafo-read-only
Remove MSPPT.py and MSO.py from checked out library

Then do the install by the command: python setup.py install

Best regards Per A.

Renaud Laborbe

unread,
Jun 5, 2013, 2:36:30 PM6/5/13
to wa...@googlegroups.com
I think we are getting close !!


Here is what I have done following your advices.

  1. Choose a recent ubuntu with numpy >= 1.7 ( ubuntu 12.04 LTS comes with numpy 1.6)
  2. get the last sources   svn checkout http://pywafo.googlecode.com/svn/trunk/ pywafo-read-only
  3. comment the statement #sys.argv.append("develop") in setup.py
  4. go to the src/wafo directory and remove MSPPT.py and MSO.py
  5. come back to the package directory and run : sudo python setup.py install
The install process went fine. !!!

However, when I import the module into a python console I have 2 warning (instead of only one expected from recent modification in fig.py


In [6]: import wafo
fig import only supported on Windows
/usr/local/lib/python2.7/dist-packages/wafo-0.1.2-py2.7.egg/wafo/spectrum/core.py:38: UserWarning: Compile the cov2mod.pyd again!
  warnings.warn('Compile the cov2mod.pyd again!')
fig import only supported on Windows


And here is the output of the
python nose_all.py which I think provides a way to test the library


 python nose_all.py
Please wait, this may take a while
/home/renaud/pywafo/src/wafo/spectrum/core.py:38: UserWarning: Compile the cov2mod.pyd again!
  warnings.warn('Compile the cov2mod.pyd again!')
../home/renaud/pywafo/src/wafo/spectrum/models.py:686: RuntimeWarning: invalid value encountered in true_divide
  return where(k1 == 0, 0, (k1 / k2) ** 3.0 * dw2 / dw1)
............F..F................../home/renaud/pywafo/src/wafo/stats/distributions.py:3115: RuntimeWarning: overflow encountered in double_scalars
  k = gd*g2c*g2cd - g1c**2 * g1cd**2
/home/renaud/pywafo/src/wafo/stats/distributions.py:3115: RuntimeWarning: invalid value encountered in double_scalars
  k = gd*g2c*g2cd - g1c**2 * g1cd**2
/home/renaud/pywafo/src/wafo/stats/distributions.py:2589: RuntimeWarning: invalid value encountered in double_scalars
  Lhat = muhat - Shat*mu
/home/renaud/pywafo/src/wafo/stats/distributions.py:5105: RuntimeWarning: overflow encountered in exp
  return exp(c*x-exp(x)-gamln(c))
/home/renaud/pywafo/src/wafo/stats/distributions.py:1610: RuntimeWarning: divide by zero encountered in log
  return log(self._pdf(x, *args))
/home/renaud/pywafo/src/wafo/stats/distributions.py:3017: RuntimeWarning: divide by zero encountered in true_divide
  return where(b > 1, a/(b-1.0), inf)
/home/renaud/pywafo/src/wafo/stats/distributions.py:3019: RuntimeWarning: divide by zero encountered in true_divide
  return where(b > 2, a*(a+1.0)/((b-2.0)*(b-1.0)), inf)
/home/renaud/pywafo/src/wafo/stats/distributions.py:2059: RuntimeWarning: invalid value encountered in subtract
  mu2 = mu2p - mu*mu
/usr/lib/python2.7/dist-packages/scipy/optimize/optimize.py:1605: RuntimeWarning: invalid value encountered in double_scalars
  tmp2 = (x - v)*(fx - fw)
/home/renaud/pywafo/src/wafo/stats/distributions.py:5618: RuntimeWarning: invalid value encountered in sqrt
  vals = 2*(bt+1.0)*sqrt(b-2.0)/((b-3.0)*sqrt(b))
/home/renaud/pywafo/src/wafo/stats/distributions.py:5556: RuntimeWarning: overflow encountered in double_scalars
  var -= nc*nc*df* val1**2 / 2.0 / val2**2
/home/renaud/pywafo/src/wafo/stats/distributions.py:6057: RuntimeWarning: invalid value encountered in log
  self.d = log(b*1.0 / a)
/usr/lib/python2.7/dist-packages/scipy/optimize/optimize.py:2105: RuntimeWarning: invalid value encountered in subtract
  if (fx2 - fval) > delta:
/home/renaud/pywafo/src/wafo/stats/distributions.py:6194: RuntimeWarning: divide by zero encountered in true_divide
  return where(x < c, 2*x/c, 2*(1-x)/(1-c))
/home/renaud/pywafo/src/wafo/stats/distributions.py:6328: RuntimeWarning: divide by zero encountered in power
  Px = Fx**(lam-1.0) + (asarray(1-Fx))**(lam-1.0)
.....................................................................................................................................................................................................................................................................................................................F..................................................
======================================================================
FAIL: test_specdata1d.test_moment
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/renaud/pywafo/src/wafo/spectrum/test/test_specdata1d.py", line 127, in test_moment
    assert(tv==v)
AssertionError

======================================================================
FAIL: test_specdata1d.test_normalize
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/renaud//pywafo/src/wafo/spectrum/test/test_specdata1d.py", line 150, in test_normalize
    assert(tv==v)
AssertionError

======================================================================
FAIL: wafo.transform.test.test_models.test_trochi
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/renaud/pywafo/src/wafo/transform/test/test_models.py", line 19, in test_trochi
    assert(g.dist2gauss()== 1.4106988010566603)
AssertionError

----------------------------------------------------------------------
Ran 396 tests in 99.459s

FAILED (failures=3)

Traceback (most recent call last):
  File "nose_all.py", line 6, in <module>
    sub.check_call('nosetests', stderr=sub.STDOUT)
  File "/usr/lib/python2.7/subprocess.py", line 542, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'nosetests' returned non-zero exit status 1




So do you think the library is properly working now ?

Thx,
Renaud

David Verelst

unread,
Jun 5, 2013, 4:37:54 PM6/5/13
to wa...@googlegroups.com
Try to recompile the modules by running build_all.py file in the root folder and then try installing again.

David

Renaud Laborbe

unread,
Jun 5, 2013, 5:21:01 PM6/5/13
to wa...@googlegroups.com
Hi David,

Your advice was quite good.

I run python build_all.py sucessfully

The python setup.py also went throught.
I could even import wafo from the python console.

One question left.
Is nose_all.py a test for  the toolbox ?

Because I still get those error :

~/pywafo-read-only/pywafo/src/wafo/stats/distributions.py:6194: RuntimeWarning: divide by zero encountered in true_divide

  return where(x < c, 2*x/c, 2*(1-x)/(1-c))
/home/renaud/Téléchargements/python/pywafo-read-only/pywafo/src/wafo/stats/distributions.py:6328: RuntimeWarning: divide by zero encountered in power

  Px = Fx**(lam-1.0) + (asarray(1-Fx))**(lam-1.0)
.....................................................................................................................................................................................................................................................................................................................F..................................................
======================================================================
FAIL: test_specdata1d.test_moment
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/renaud/Téléchargements/python/pywafo-read-only/pywafo/src/wafo/spectrum/test/test_specdata1d.py", line 127, in test_moment

    assert(tv==v)
AssertionError

======================================================================
FAIL: test_specdata1d.test_normalize
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/renaud/Téléchargements/python/pywafo-read-only/pywafo/src/wafo/spectrum/test/test_specdata1d.py", line 150, in test_normalize

    assert(tv==v)
AssertionError

======================================================================
FAIL: wafo.transform.test.test_models.test_trochi
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/renaud/Téléchargements/python/pywafo-read-only/pywafo/src/wafo/transform/test/test_models.py", line 19, in test_trochi
    assert(g.dist2gauss()== 1.4106988010566603)
AssertionError

----------------------------------------------------------------------
Ran 396 tests in 103.182s


FAILED (failures=3)
Traceback (most recent call last):
  File "nose_all.py", line 6, in <module>
    sub.check_call('nosetests', stderr=sub.STDOUT)
  File "/usr/lib/python2.7/subprocess.py", line 542, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'nosetests' returned non-zero exit status 1


Thank you.

David Verelst

unread,
Jun 5, 2013, 6:11:22 PM6/5/13
to wa...@googlegroups.com
Hi Renaud,

No problem, glad I could help. I also get those errors when running the nose_all.py. I haven't looked into them, since I never use those components of the library.

David


Renaud Laborbe

unread,
Jun 7, 2013, 11:59:52 AM6/7/13
to wa...@googlegroups.com
Hello,

First of all I would like to thanks you for helping me out.
Everything is working  fine now.
If you have an older python-numpy installed on your computer (if your are using ubuntu 12.04 LTS for instance, you can upgrade it using pip.
Finally the steps are the following :
  1. sudo pip install numpy==1.7.1 --upgrade
  1. svn checkout http://pywafo.googlecode.com/svn/trunk/ pywafo-read-only
  2. comment the statement #sys.argv.append("develop") in setup.py
  3. go to the src/wafo directory and remove MSPPT.py and MSO.py
  4. come back to the package directory and run : sudo python setup.py install

    We have noticed the documentation of the matlab toolbox do not always apply to pywafo.
    Do you know if there is a doc for the python toolbox ?

    When I run
    python gendocwafo.py


    I have the ffoolowing message
    sh: 1: epydoc.py: not found

    Any clue ?

    Per Andreas Brodtkorb

    unread,
    Jun 7, 2013, 12:16:46 PM6/7/13
    to wa...@googlegroups.com
    Unfortunately there is no documentation for pywafo other than the manual for the wafo toolbox for matlab.
    However, some of the examplescripts for each chapter of the matlab manual is translated into python and can be found here:
    This is work in progress and is not quite complete yet.


    In order to get gendocwafo.py to work, you have to install epydoc: http://epydoc.sourceforge.net/manual-install.html


    Renaud Laborbe

    unread,
    Jun 7, 2013, 12:35:40 PM6/7/13
    to wa...@googlegroups.com
    Thank you for this fast answer.

    I will have a look to the epydoc script. Is it worth installing it ? What does gendocwafo do ?

    The example scripts you indicate seems the best way to learn how to use the toolbox.
    How ever I have notice something quite weird.

    The 4 first codes chapter1.py .. chapter4.py are written in python.
    However the chapter5.py seems to be matlab statements.

    Is that what you mean by "ongoing work ?" or it might be a mistake ?


    Renaud

    Per Andreas Brodtkorb

    unread,
    Jun 7, 2013, 1:07:10 PM6/7/13
    to wa...@googlegroups.com
    gendocwafo.py makes a html documention of all modules of WAFO directly from the files. 
    If it is worth installing? Perhaps.
    Yes, chapter5.py is matlab statements and there are matlab statements in parts of the other chapterX.py files as well. These matlab statements are not translated yet.

    Per A
    Reply all
    Reply to author
    Forward
    0 new messages