Import yadeimport

Asked by Manikandan

Hai everyone!

I am a newbie to yade and OpenFOAM.
I tried to simulate the example of Yade-OpenFOAM coupling (youtube video mentioned on the yade website - https://www.youtube.com/watch?v=J_V1ffx71To ) and got a few errors.
Question 1 :
from yadeimport import *
ModuleNotFoundError: No module named 'yadeimport'
--------------------------------------------------------------------------
mpiexec was unable to find the specified executable file and therefore
did not launch the job. This error was first reported for process
rank 1; it may have occurred for other processes as well.

NOTE: A common cause for this error is misspelling a mpiexec command
      line parameter option (remember that mpiexec interprets the first
      unrecognized command line token as the executable).

Question 2:
When I tried to execute the command "sudo apt-get update", I got the following error.

Ign:6 https://ppa.launchpadcontent.net/yade-users/external/ubuntu jammy InRelease
Hit:7 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Err:8 https://ppa.launchpadcontent.net/yade-users/external/ubuntu jammy Release
  404 Not Found [IP: 185.125.190.52 443]

E: The repository 'https://ppa.launchpadcontent.net/yade-users/external/ubuntu jammy Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

Please help me to fix the above mentioned errors.
I am using WSL2.
Ubuntu 22.04.1 LTS
Codename: jammy

Yade: Yade 2023.02a
Python: 3.10.6
OpenFoam: V1912
mpiexec (OpenRTE) 4.1.2

Thanks in advance,
Regards,
Manikandan

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Manikandan
Solved:
Last query:
Last reply:
Revision history for this message
Jérôme Duriez (jduriez) said :
#1

Hi,

Please do not ask several questions in one Launchpad question, even though they may seem related to one unique goal of yours. A more meaningful title could help as well, since there is no discussion about OpenFOAM here (yet ?).

Regarding Q1, is this 'yadeimport' the one described at https://yade-dem.org/doc/user.html#importing-yade-in-other-python-applications ?

Did you follow exactly this § of the doc ?

Revision history for this message
Manikandan (mk18) said :
#2

Hi,

When I simulate the example file using the command "mpiexec -n 1 python3 scriptYade.py : -n NUMPROCS icoFoamYade -parallel"
It fails to execute and shows the following error.

Traceback (most recent call last):
  File "/mnt/c/Users/mk/Documents/Yade/working_directory/Yade-OpenFOAM-coupling/example_icoFoamYade/scriptYade.py", line 101, in <module>
    from yadeimport import *
ModuleNotFoundError: No module named 'yadeimport'
--------------------------------------------------------------------------
mpiexec was unable to find the specified executable file, and therefore
did not launch the job. This error was first reported for process
rank 1; it may have occurred for other processes as well.

NOTE: A common cause for this error is misspelling a mpiexec command
      line parameter option (remember that mpiexec interprets the first
      unrecognized command line token as the executable).

Node: eschenfelden
Executable: icoFoamYade

Regards,
MK
--------------------------------------------------------------------------

Revision history for this message
Manikandan (mk18) said :
#3

Hi,
And also, when I run the command " yadeimport import *" separately in yade.
It shows the following error,

ModuleNotFoundError: No module named 'yadeimport'

Regards,
MK

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#4

Hi,
"yadeimport" used to be a symlink to the yade executable, created locally by the user.
If you run, let's say, the "yadedaily" package, then the executable "yadedaily" is a python script (or "module"), but python will not import it because there is no ".py" postfix.
The solution is "ln -s yadedaily yadeimport.py".
If you run a stable version, "ln -s yade yadeimport.py".
A compiled version: "ln -s yade-myversion yadeimport.py".
Etc.

I hope it helps.

Bruno

Revision history for this message
Manikandan (mk18) said :
#5

Thanks to you, my problem has been resolved.