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
 All Forums
 Origin Forum for Programming
 Forum for Python
 Unable to close Origin2021

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
tteemu Posted - 06/11/2021 : 05:42:25 AM
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
10   L A T E S T    R E P L I E S    (Newest First)
i.reuter Posted - 10/08/2021 : 06:12:36 AM
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
minimax Posted - 10/08/2021 : 05:47:40 AM
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?
YimingChen Posted - 10/06/2021 : 5:25:39 PM
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
i.reuter Posted - 10/05/2021 : 02:25:14 AM
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()


YimingChen Posted - 10/04/2021 : 2:11:52 PM
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?

i.reuter Posted - 10/04/2021 : 07:40:26 AM
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?
minimax Posted - 09/18/2021 : 01:39:02 AM
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?
tteemu Posted - 09/17/2021 : 09:31:39 AM
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
YimingChen Posted - 06/11/2021 : 09:29:21 AM
As a reference, the jira id is ORG-23735.

James
YimingChen Posted - 06/11/2021 : 09:16:23 AM
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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000