brainvisa / brainvisa.github.io

Source of BrainVISA developers site
2 stars 2 forks source link

Sip modules may need specific compilation or launch options for Python 3 #18

Closed sapetnioc closed 4 years ago

sapetnioc commented 4 years ago

Some projects that uses pyaims (e.g. QualiCATI) cannot be run on Python 3 because of the following error :

ImportError: version mismatch: you are running Python 3.5.2 but the soma.aims module was likely compiled for Python 2.

Is there a way to work around this problem (at least with casa_distro) ?

sapetnioc commented 4 years ago

Another question on the same topic. How to start Axon with Python 3 ? Because, simply using python3 lead to the same aims related error.

ylep commented 4 years ago

You basically need to have 2 compilation trees, or two build workflows: one for Python 2, and one for Python 3. This is because sip will compile a module that is only compatible with the version of Python. You have to pass -DPYTHON_EXECUTABLE=/usr/bin/python3 as cmake_options in bv_maker.cfg in order to compile a compatible module…

Another possibility would be to compile a module for both Python 2 and Python 3, but this would require extensive changes to the CMake configuration…

sapetnioc commented 4 years ago

It is what I thought. It may be necessary to make a little readme somewhere to explain how to setup a Python 3 development environment and how to use it (if there is some Python 3 specific options to run some programs).

sapetnioc commented 4 years ago

Here is a reciepe that I have not been able to test (because I locked my BioProj account) to create a CATI build workflow for Python3.

First create a build workflow :

casa_distro create distro_source=cati_platform distro_name=python3 system=ubuntu-16.04 branch=bug_fix

And then edit the svn.secret to put your BioProj credentials and also edit bv_maker.cfg to add the following line :

cmake_options = -DPYTHON_EXECUTABLE=/usr/bin/python3

Then you can start to build : casa_distro bv_maker distro=python3

denisri commented 4 years ago

I have added instructions in brainvisa-cmake doc (https://github.com/brainvisa/brainvisa-cmake/commit/178d3aa643b87a7728e8ad602fc81b84964cc96e) and added the automatic generation of docs on gh-pages (https://github.com/brainvisa/brainvisa-cmake/pull/49). Is it enough to close this issue ?