Author |
Topic |
|
tteemu
Finland
2 Posts |
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 |
Edited by - tteemu on 06/11/2021 10:27:00 AM |
|
YimingChen
1621 Posts |
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 |
|
|
YimingChen
1621 Posts |
Posted - 06/11/2021 : 09:29:21 AM
|
As a reference, the jira id is ORG-23735.
James
|
|
|
tteemu
Finland
2 Posts |
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 |
|
|
minimax
351 Posts |
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? |
|
|
i.reuter
12 Posts |
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? |
|
|
YimingChen
1621 Posts |
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?
|
Edited by - YimingChen on 10/04/2021 2:12:07 PM |
|
|
i.reuter
12 Posts |
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
1621 Posts |
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 |
|
|
minimax
351 Posts |
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? |
|
|
i.reuter
12 Posts |
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 |
|
|
|
Topic |
|
|
|