FEMxDEM saveGauss.py has python2 file() function
I'm building custom image from registry.
Some python3-xxx packages were installed into a container image.
When I run FEMxDEM example, I got some warnings and a error related to python version:
/usr/lib/
par.add_
/usr/lib/
prompt_in1='Yade [\#]: ',
/usr/lib/
prompt_in2=' .\D.: ',
/usr/lib/
prompt_out=" -> [\#]: ",
/usr/lib/
+(['"\e[24~": "\C-Uyade.
/usr/lib/
+(['"\e[24~": "\C-Uyade.
/usr/lib/
+(['"\e[24~": "\C-Uyade.
/usr/lib/
+(['"\e[24~": "\C-Uyade.
/usr/lib/
+['"\e[19~": "\C-Uimport yade.plot; yade.plot.
/usr/lib/
'"\e[A": history-
/usr/lib/
'"\e[A": history-
Warning: no X rendering available (see https:/
Kokkos:
In general, for best performance with OpenMP 4.0 or better set OMP_PROC_
For best performance with OpenMP 3.1 set OMP_PROC_BIND=true
For unit testing set OMP_PROC_BIND=false
Not converged after 0 iteration(s)! Relative error: 1.000000e+00
Not converged after 1 iteration(s)! Relative error: 3.711288e-02
Not converged after 2 iteration(s)! Relative error: 2.028988e-02
Convergence reached after 3 iteration(s)! Relative error: 8.690760e-03
Traceback (most recent call last):
File "/usr/bin/yade", line 336, in runScript
execfile(
File "/usr/lib/
exec_(code, myglobals, mylocals)
File "./biaxialSmoot
saveGauss2D
File "/usr/lib/
fout = file(name,'w')
NameError: name 'file' is not defined
Because the file() builtin function is removed in Python 3. Does it means I can install only python2.7 into the container image if I want to use FEMxDEM?
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Last query:
- 2021-03-31
- Last reply:
- 2021-03-31
Robert Caulk (rcaulk) said : | #1 |
>Because the file() builtin function is removed in Python 3. Does it means I can install only python2.7 into the container image if I want to use FEMxDEM?
Maybe, but it's probably best to convert the script to Python3, which shouldn't be hard [1].
[1]http://
Can you help with this problem?
Provide an answer of your own, or ask quanm qiu for more information if necessary.