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
 Unable to close Origin2021
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

tteemu

Finland
2 Posts

Posted - 06/11/2021 :  05:42:25 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi,

I'm unable to close Origin2021 after I have accessed it from an external python. I get a following error "Origin cannot be closed because it is being controlled by another application". I was able to fix this issue in Origin2020 and some earlier version of originpro package by using op.CanClose = True in the code. However, this didn't work with Origin2021 and the most recent originpro package.

I have
- Origin2021 concurrent network license
- originpro 1.0.6
- OriginExt 1.1.5


Code to reproduce


import os
import originpro as op
import sys

def origin_shutdown_exception_hook(exctype, value, traceback):
op.exit()
sys.__excepthook__(exctype, value, traceback)
if op and op.oext:
sys.excepthook = origin_shutdown_exception_hook

# Set Origin instance visibility.
if op.oext:
op.set_show(True)

x_vals = [1,2,3,4,5,6,7,8,9,10]
y_vals = [23,45,78,133,178,199,234,278,341,400]
wks = op.new_sheet('w')
wks.from_list(0, x_vals, 'X Values')
wks.from_list(1, y_vals, 'Y Values')

# This enabled closing of Origin previously (Origin2020)
op.CanClose = True

Edited by - tteemu on 06/11/2021 10:27:00 AM

YimingChen

1621 Posts

Posted - 06/11/2021 :  09:16:23 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you for bringing this up. This is a known issue and we have improved it in 2021b SR2 which will be released within 1 or 2 weeks. We introduced op.release() to disconnect Python from Origin. Thank you

James
Go to Top of Page

YimingChen

1621 Posts

Posted - 06/11/2021 :  09:29:21 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
As a reference, the jira id is ORG-23735.

James
Go to Top of Page

tteemu

Finland
2 Posts

Posted - 09/17/2021 :  09:31:39 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I get an error "AttributeError: module 'originpro' has no attribute 'release' Exit Origin" when using op.release().

originpro 1.0.7
OriginExt 1.1.6
Go to Top of Page

minimax

351 Posts

Posted - 09/18/2021 :  01:39:02 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi tteemu,

After some checking, we found it is not necessary to introduce op.release() or any specific command.

With the new package, Origin should be able to be closed directly after your py script finishes running.

Would you mind to double check?
Go to Top of Page

i.reuter

12 Posts

Posted - 10/04/2021 :  07:40:26 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I'm having the same issue. I can't quit Origin after I've started a project in an external python script.

Unfortunately, my script has no defined "end time" or "exit state", because I use originpro in combination with interactive Python (in Jupyter Notebooks) to preprocess data and create Origin projects.

Is there a way to release Origin correctly when working with interactive python?
Go to Top of Page

YimingChen

1621 Posts

Posted - 10/04/2021 :  2:11:52 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Please try:
op.exit()



quote:
Originally posted by i.reuter

I'm having the same issue. I can't quit Origin after I've started a project in an external python script.

Unfortunately, my script has no defined "end time" or "exit state", because I use originpro in combination with interactive Python (in Jupyter Notebooks) to preprocess data and create Origin projects.

Is there a way to release Origin correctly when working with interactive python?


Edited by - YimingChen on 10/04/2021 2:12:07 PM
Go to Top of Page

i.reuter

12 Posts

Posted - 10/05/2021 :  02:25:14 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi YimingChen,

thanks for your fast response. I've tried op.exit(), but this closes Origin (completely). I want to release (without closing) Origin only.



quote:
Originally posted by YimingChen

Please try:
op.exit()


Go to Top of Page

YimingChen

1621 Posts

Posted - 10/06/2021 :  5:25:39 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
We'll address this issue. Right now you have to save the project file before closing the Origin instance using op.exit(). Then reopen the project file in a new Origin instance to further work on it. Thanks.

James
Go to Top of Page

minimax

351 Posts

Posted - 10/08/2021 :  05:47:40 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi i.reuter,

We just published a newer version (originpro 1.0.8 and OriginExt 1.1.7), and added a new method
op.detach()


You need to add it to the end of the script where does not involve Origin.

Would you mind to try if it works in your Jupyter Notebooks?
Go to Top of Page

i.reuter

12 Posts

Posted - 10/08/2021 :  06:12:36 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
HI minimax,

thank you for your fast response and the updated originpro package. Using op.detach() works like a charm (at least in my application context).

Best
Ingo
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