Python version in Yade 2021.01a

Asked by mohsen

In the name god
Hi everyone
I use KUbuntu 20.04 LTS. I compile YADE 2021.01 a and run it. the terminal shows yade uses python version of 3.8.10:

Using python version: 3.8.10 (default. Sep 28 2021, 16:10:42)

However all of my script are based on the python 2. what can i do?!
Please note that my default python version is 2.7.18 although the 3.8 is installed too.


Question information

English Edit question
Yade Edit question
No assignee Edit question
Last query:
Last reply:

This question was reopened

Revision history for this message
Jan Stránský (honzik) said :


> what can i do?!

The most reasonable approach is IMO convert the scripts to version 3, either manually or e.g. using [1].

Alternatively (although I would strongly discourage this approach), for the compiled version, you can try to set PYTHON_VERSION cmake variable to 2 (see [2], search PYTHON_VERSION)



Revision history for this message
Robert Caulk (rcaulk) said :

>>what can i do?!

Consider also that we've written a doc specifically for this:

Revision history for this message
mohsen (agha-mohsena) said :

Thanks Jan Stránský, that solved my question.

Revision history for this message
mohsen (agha-mohsena) said :

Dear Ian
about using Ref. [2] i think in that case we need the python 2 modules; however the prerequisites in the web page are now set for python3 [3]. how can i access the prerequisites for python2. is there any archive?

Revision history for this message
Jérôme Duriez (jduriez) said :

Starting from, and its 1st paragraph, if you follow the "backward compatibility for Python 2" link, you will eventually access that archive:

with a dedicated paragraph about Python2 dependencies.

(Personal note: living in the computers' past could sometimes be painful ?)

Revision history for this message
mohsen (agha-mohsena) said :

Dear Jérôme:
thank you very much! I think you addressed me a cmake file, how ever i needed a revision of these commands compatible for python2:

sudo apt install cmake git freeglut3-dev libloki-dev libboost-all-dev fakeroot \
dpkg-dev build-essential g++ python3-dev python3-ipython python3-matplotlib \
libsqlite3-dev python3-numpy python3-tk gnuplot libgts-dev python3-pygraphviz \
libvtk6-dev libeigen3-dev python3-xlib python3-pyqt5 pyqt5-dev-tools python3-mpi4py \
python3-pyqt5.qtwebkit gtk2-engines-pixbuf python3-pyqt5.qtsvg libqglviewer-dev-qt5 \
python3-pil libjs-jquery python3-sphinx python3-git libxmu-dev libxi-dev libcgal-dev \
help2man libbz2-dev zlib1g-dev libopenblas-dev libsuitesparse-dev \
libmetis-dev python3-bibtexparser python3-future coinor-clp coinor-libclp-dev \
python3-mpmath libmpfr-dev libmpfrc++-dev libmpc-dev

And about the personal note: you are right; but i am at the middle of a work and should finish it. Hence i should try that!
Indeed i use new version of YADE for my new projects.

Revision history for this message
Launchpad Janitor (janitor) said :

This question was expired because it remained in the 'Open' state without activity for the last 15 days.