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

TOPIC: Error when building the Python API

Error when building the Python API 1 year 5 months ago #42683

  • wsy9208
  • wsy9208's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 37
  • Thank you received: 3
Hello everyone!

I have been using version v8p4r0 of TELEMAC2D on a Linux system, and now I need to install it on a Windows system. I followed the steps provided at gitlab.pam-retd.fr/otm/wintel, but I encountered an error during the compilation process while building the Python API (see attached screenshot). I have included the configuration files and the bat script in the attachments.

I would greatly appreciate any suggestions or advice you can provide.

Thank you!
WSY
The administrator has disabled public write access.

Error when building the Python API 1 year 5 months ago #42740

  • borisb
  • borisb's Avatar
  • OFFLINE
  • Admin
  • Posts: 128
  • Thank you received: 64
I don't know what could be causing this problem. If you don't intend to develop in TELEMAC, you can try using the new automatic installer which should be much easier to install.
The administrator has disabled public write access.
The following user(s) said Thank You: wsy9208

Error when building the Python API 1 year 5 months ago #42753

  • wsy9208
  • wsy9208's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 37
  • Thank you received: 3
Hello borisb,

Thank you for your response! In fact, I downloaded the new automatic installer right away. When I enter 'telemac2d.py t2d_breach.cas' in the TELEMAC Command Prompt, a window pops up asking me to choose a program to open the file (see attached image). After selecting 'Python', a new window appears briefly and then closes. Additionally, when I enter 'python compile_telemac.py', I encounter the same issue as above during the building of the Python API. I have previously installed version v7p0, and I'm unsure if this is related to the current problem.

I apologize for my limited understanding of the internal configuring mechanisms. I would greatly appreciate your insights and suggestions.

Regards,
WSY
Attachments:
The administrator has disabled public write access.

Error when building the Python API 1 year 5 months ago #42764

  • borisb
  • borisb's Avatar
  • OFFLINE
  • Admin
  • Posts: 128
  • Thank you received: 64
Hello,

Your issue comes from the fact that the old TELEMAC V7P0 installer used to tweak the registry settings to open Python files with TELEMAC Python. Before Python 3 and the release of the Python Launcher for Windows, this was the only way to run TELEMAC Python scripts directly, i.e. without preceding the script with a call to the Python executable.

But now, this old registry trick prevents the Python Launcher from working properly. I'm going to help you fix it though. Could you open your registry (by entering "registry" in a command prompt) and go to the following key:
HKEY_CURRENT_USER\SOFTWARE\Classes\Python.File\Shell\open\command

And could you paste here the line that's written in the right panel?
The administrator has disabled public write access.

Error when building the Python API 1 year 5 months ago #42765

  • wsy9208
  • wsy9208's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 37
  • Thank you received: 3
Hello borisb,

The distribution of file paths in my registry editor seems to be somewhat different from what you said, I've attached the screenshot.

Regards,
WSY
Attachments:
The administrator has disabled public write access.

Error when building the Python API 1 year 5 months ago #42776

  • borisb
  • borisb's Avatar
  • OFFLINE
  • Admin
  • Posts: 128
  • Thank you received: 64
Could you check the same path in HKEY_LOCAL_MACHINE ?
The administrator has disabled public write access.

Error when building the Python API 1 year 5 months ago #42780

  • wsy9208
  • wsy9208's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 37
  • Thank you received: 3
Hello borisb,

I went to the following key as you said:
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Python.File\Shell\open\command

I've attached the screenshot.

Regards,
WSY
Attachments:
The administrator has disabled public write access.

Error when building the Python API 1 year 5 months ago #42782

  • borisb
  • borisb's Avatar
  • OFFLINE
  • Admin
  • Posts: 128
  • Thank you received: 64
Thanks, that is the problematic registry key. Could you enter this command in a shell and attach the result here:
where py
The administrator has disabled public write access.

Error when building the Python API 1 year 5 months ago #42783

  • wsy9208
  • wsy9208's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 37
  • Thank you received: 3
When I entered the command the shell displayed:
C:\Windows\py.exe
The administrator has disabled public write access.

Error when building the Python API 1 year 5 months ago #42785

  • borisb
  • borisb's Avatar
  • OFFLINE
  • Admin
  • Posts: 128
  • Thank you received: 64
Great, all you need to do to fix your registry is edit the line pointing to python27 and replace it with the following (quotes are mandatory):
"C:\Windows\py.exe" "%L" %*

After that, TELEMAC scripts should work.
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.