anuga_core icon indicating copy to clipboard operation
anuga_core copied to clipboard

compile the anuga with python3.6

Open Dongxueyang opened this issue 5 years ago • 11 comments

Hi everyone:

Also @stoiver . Can I compile the anuga with python3.6 under ubuntu18.04? I see the python version of python is 2.7 almostly. If I use python 3.6, is there any problem? I will try and hope to get your experiences.

Best reagards dongxueyang

Dongxueyang avatar Dec 06 '19 08:12 Dongxueyang

We are in the process of porting anuga over to python 3. You will find a new branch anuga_py3 in which we are currently moving to python 3. At present we are converting the glue code to using cython.

stoiver avatar Dec 09 '19 07:12 stoiver

@Dongxueyang We are currently porting over to python 3. The current work is in teh branch anuga_py3. But we have currently only worked on the connection between teh C code and python via cython.

stoiver avatar Dec 09 '19 07:12 stoiver

Thank you so much @stoiver So now I can download the anuga_py3. and compile with python3,right? Is there any problems I will get when I run the new version anuga_py3.?

I have tried to converse python2 to python3 one file by one file. It is difficult and tired of so many files.

dong

Dongxueyang avatar Dec 09 '19 08:12 Dongxueyang

@stoiver I have downloaded the code of anuga_core_py3. And I want to know what is the differences ? I check the tools/install_ubuntu.sh and can not find any differences. The contents related to python verison are still python2 not python3.

Dongxueyang avatar Dec 09 '19 09:12 Dongxueyang

@Dongxueyang No you can't use python 3 yet.

In the branch anuga_py3 we are doing preparatory work before doing the porting to python 3. We are hoping to get the work finished in the next month.

stoiver avatar Dec 09 '19 11:12 stoiver

@stoiver Ok thanks a lot.

Dongxueyang avatar Dec 09 '19 11:12 Dongxueyang

@stoiver I try to use 2to3.py a script with python to convert anuga from python2 to python3. And I make some adjustments with file install_ubuntu.sh and build_all.py so that I can compile anuga only using python3. And now I got error like this:

捕获

I have install python3-dev ,but no use. So can you give me some advice? Best regards dong

Dongxueyang avatar Dec 13 '19 08:12 Dongxueyang

@stoiver How about your work on porting from python2 to python3? I am trying to modify the code to porte to python3. But I got so many errors and one error was solved while some new errors come soon.

Dongxueyang avatar Dec 17 '19 17:12 Dongxueyang

See also: 2to3, which can automate the process of converting code from Python 2 to Python 3.

sbrl avatar Feb 04 '20 18:02 sbrl

Hi, I have tried using the 2to3 tool. Does it really convert from python 2 to python 3 ? As I'm still getting some errors.

samcom12 avatar Oct 19 '20 06:10 samcom12

Hi @samcom12 , at present we have the old version of anuga which runs under python 2.7 (the master branch) and an alternative version in branch anuga_py3 which runs under python 3.8 (and probably 3.6) and almost under python 2.7. So you should checkout the anuga_py3 branch and follow the implicit instructions in the installation scripts in the tools directory. I suggest using the conda installation to ensure you have the correct python version and libraries.

stoiver avatar Oct 19 '20 07:10 stoiver

We now have the python 3 version available as the main (default) branch. The old python 2.7 version is available as the anuga_py2 branch. We are now only developing the python 3 version.

stoiver avatar Nov 02 '22 12:11 stoiver