The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Python
 NLFit error with python code sample
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

ThemannJ

Germany
3 Posts

Posted - 11/02/2023 :  11:18:26 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. 2021 (64-bit) and Service Release (Select Help-->About Origin): 9.8.0.200
Operating System: Windows 10 Pro

Hello,
When I'm trying to excecute the batch fitting example provided by Origin (first example at https://www.originlab.com/doc/en/python/Examples/Analysis) I get the following Error:

Traceback (most recent call last):
File "C:\ProgramData\OriginLab\98\PyPackage\Py3\originpro\analysis.py", line 21, in __init__
self._trfdf = ET.fromstring(po.LT_get_str(f'GetFDFAsXML("{self.func}")$'))
File "C:\Program Files\OriginLab\Origin2021\Python38.zip\xml\etree\ElementTree.py", line 1321, in XML
xml.etree.ElementTree.ParseError: no element found: line 1, column 0

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "<string>", line 6, in <module>
File "C:\Users\Phd02\Documents\OriginLab\Anwenderdateien\batchfittingexample.py", line 30, in <module>
model = op.NLFit('Gaussian')
File "C:\ProgramData\OriginLab\98\PyPackage\Py3\originpro\analysis.py", line 23, in __init__
raise ValueError(f'Invalid fitting function: {func}') from e
ValueError: Invalid fitting function: Gaussian

It seems to me that the Programm can't find the fdf file, but i could'nt find a solution to the Problem.

Edit: the same sample code worked on a different PC. So the Problem turned out to be an installation issue. Upgrading Origin, repairing files and a complete reinstallation did not solve the issue on the first PC though. Any help would still be appreciated.

Thanks for any help in advance.

Edited by - ThemannJ on 11/03/2023 06:17:51 AM

ChaoC

USA
174 Posts

Posted - 11/03/2023 :  09:15:27 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

It seems you may be missing the Gaussian.fdf file from C:\Program Files\OriginLab\Origin2021\FitFunc\Gaussian.fdf.

You could try copying the Gaussian.fdf from the working computer to the first PC.

Best,
Chao
Go to Top of Page

ThemannJ

Germany
3 Posts

Posted - 11/03/2023 :  09:28:45 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

the Gaussian.fdf file is present in my directory. I also tried to change to different fdf files/fit methods in that same directory with possible case sensitivity in mind.
I also tried to place the Gaussian.fdf file into the directory .../Samples/Batch2 as well as where the .py file is located.

Edited by - ThemannJ on 11/03/2023 09:31:29 AM
Go to Top of Page

ChaoC

USA
174 Posts

Posted - 11/03/2023 :  1:42:24 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

I'm thinking this may be an issue specific to 2021. Is the other computer also 2021?

If not, are you able to upgrade your Origin?

Best,
Chao
Go to Top of Page

ThemannJ

Germany
3 Posts

Posted - 11/03/2023 :  3:07:59 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello Chao,

you were right. I could upgrade to ver. 2021b which resolved my issue. Thank you!
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000