Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: error runcode.py V7P0R1 cluster

error runcode.py V7P0R1 cluster 7 years 10 months ago #24787

  • huyquangtran
  • huyquangtran's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 271
  • Thank you received: 23
Hi,

I just got the same problem "No module named numpy" when running on my HPC cluster.

However, I tried to load python first before running the model, but with Python 3.5.2 where I found numpy has been installed. I got error:

File "/home/huyquangtran/telemac/v7p2/scripts/python27/runcode.py", line 303
if lang == 1: print ' +> simulation en Francais'
^
SyntaxError: Missing parentheses in call to 'print'


So, I wonder if I could run TELEMAC by using python V3.? and how could I solve the problem above (assumed that I am not able to use SUDO to install numpy on HPC)?

Thanks & Best Regards
Huy
The administrator has disabled public write access.

error runcode.py V7P0R1 cluster 7 years 10 months ago #24788

  • yugi
  • yugi's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 851
  • Thank you received: 244
TELEMAC-MASCARET is not working wiht Python 3.

So you'll need to install numpy locally.
I think there is an option --prefix when you run the numpy install to specify where to install it.

Hope it helps.
There are 10 types of people in the world: those who understand binary, and those who don't.
The administrator has disabled public write access.
The following user(s) said Thank You: huyquangtran

error runcode.py V7P0R1 cluster 7 years 10 months ago #24793

  • josekdiaz
  • josekdiaz's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 161
  • Thank you received: 48
Hello Huy,

Had a similar issue before I had admin rights in our rigs, the solution at that time was to manually download the numpy binaries for the plataform (or copy them from an existing similar machine) and add the folder to the local Python path variable (a.k.a PYTHONPATH).

Additionally, if you want to execute a local version of python (or a system Python2 or Python3) you could also add the shebang ( "#!") to top of the telemac *.py files using gedit or any editor pointing to the desired version of Python e.g.,:
#!/path/to/local/python python

Note that the "default recommended" line is:
#!/usr/bin/env python

To assure it gets the "default" python in the machine (not your case though).

Python nor its modules explicitly need to have root/admin rights to its installation or use.

regards,

José Díaz.
The administrator has disabled public write access.
The following user(s) said Thank You: huyquangtran

error runcode.py V7P0R1 cluster 7 years 10 months ago #24794

  • huyquangtran
  • huyquangtran's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 271
  • Thank you received: 23
Thank Yoann and Rosé,


Actually, I also got the same problem before when I installed TELEMAC on my virtual machine running on our university's structure, but the problem has been solved by installing NUMPY with SUDO command. However, this time I don't have admind right for it as this HPC machine is used by hundreds of users around the country (Australia).

Unfortunately, I exported a wrong PYTHONPATH, and now I am facing a new problem with bashrc file, normally it should be something like: [huyquangtran@spartan ~]$

but when I log in the account, I see: (it runs out of SSH)

-bash: /home/huyquangtran/.bashrc: line 130: syntax error: unexpected end of file
-bash-4.2$

Has anyone faced thhe same issue before?

Thanks & Best Regards
Huy
The administrator has disabled public write access.

error runcode.py V7P0R1 cluster 7 years 10 months ago #24795

  • josekdiaz
  • josekdiaz's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 161
  • Thank you received: 48
Dear Huy,

Could be a missing "fi" in the file or any similar typo (like commenting out lines that shouldnt be) or editing a file in windows and then saving it in linux (due to different end chars in txt between windows and linux, this could cause the issue)

Try comparing to the original bashrc file located at: /etc/skel/.bashrc and catch any issue.

regards,

José Díaz.
The administrator has disabled public write access.
The following user(s) said Thank You: huyquangtran

error runcode.py V7P0R1 cluster 7 years 10 months ago #24796

  • huyquangtran
  • huyquangtran's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 271
  • Thank you received: 23
Thanks Rosé :cheer:

I now come back the normal log-in mode! I will try to figure out over the weekend, and will post the solution after I done it.

Have a great weekend

Best Regards
Huy
The administrator has disabled public write access.

error runcode.py V7P0R1 cluster 7 years 10 months ago #24800

  • huyquangtran
  • huyquangtran's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 271
  • Thank you received: 23
Hi,

I have solved the problem by installing numpy without root permissions, using prefix (as suggested by Yoann). What I did:

1. Create a sub-directory at: /home/huyquangtran/telemac/v7p2/scripts

2. Set PYTHONPATH (using vim ~/.bashrc), then add:
PYTHONPATH=/home/huyquangtran/telemac/v7p2/scripts/prefix/lib64/python2.7/site-packages/
export PYTHONPATH

3. Build and Install numpy:
python setup.py build --fcompiler=gfortran
python setup.py install --prefix=/home/huyquangtran/telemac/v7p2/scripts/prefix

Hope this heps others

Best Regards
Huy
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: borisb

The open TELEMAC-MASCARET template for Joomla!2.5, the HTML 4 version.