< Back to IRCAM Forum

ircamAlign error

Hello !! :slight_smile:

After an apparently fine installation on MacOS, I am simply trying to run
“ircamAlign -h”

and I get the following errors:
Traceback (most recent call last):
File “/xxx/yyy/Library/ircamAlign/py_scripts/ircamAlign.py”, line 10, in
import ircamAlign_func
File “/xxx/yyy/Library/ircamAlign/py_scripts/ircamAlign_func.py”, line 17, in
sys.stdout = open(sys.stdout.fileno(), mode=‘w’, encoding=‘utf8’, buffering=1)
TypeError: file() takes at most 3 arguments (4 given)

Running “python ircamAlign_func.py” directly also gives me the same errors.
I am using Python 2.7.18.

Thank you !!

O.

Hello Olivier,

I am using Python 2.7.18.

That’s most likely the problem. After a few years of keeping compatibility between python 2 and python 3 there are now a rather large number of very important projects not supporting python2 anymore (https://python3statement.org/) and at some point I did stop to support python2 as well.

The main problem for me here is the important change between python 2 and python 3 when it comes to utf8. Now this is crucial for ircamAlign because ifcamAlign uses liaphon, which requires all input to be latin1 encoded. On the other hand today UTF8 is used more or less everywhere and so most texts are utf8 encoded. To avoid having to maintain all texts in two encodings I invested quite some time to transparently recode whatever you provide to ircamAlign (which reads everything in UTF8) such that liaphon is happy. Making these changes such that they were compatible with python2 that internally does not use utf8 did require more time I was able to invest.

Could you not install an anaconda python3 somewhere and then change the 1st line of the scripts from

#! /usr/bin/env python

into

#! /usr/bin/env python3

As long as you don’t need to call the scripts from python yourself that should do it.

Best
Axel

Dear Axel,

That was simply it !!
I am using python 3.9 from macport and version 1.1.9 seems to work fine.
This is a really cool tool !!!

Thank you very much for your prompt answer !!