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
 Connector attribute not available in originpro err
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

bharath2k4er

Germany
1 Posts

Posted - 01/08/2023 :  12:47:24 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi,
I am using originpro 2021 version. I am executing sample python program to import an excel sheet in origin. I am getting the following error.
https://www.originlab.com/doc/python/Examples/Worksheet --> Import CSV with Selected Rows
dc = op.Connector(wks)
AttributeError: module 'originpro' has no attribute 'Connector'


when i checked the attributes of originpro, i don't see "Connector" attribute. I have upgraded my originpro package and i still don't see it. However, i see the class "Connector"

attributes = dir(op)

['Axis', 'BaseLayer', 'BaseObject', 'BasePage', 'DBook', 'DSheet', 'GLayer', 'GPage', 'Label', 'List', 'MBook', 'MSheet', 'PATHSEP', 'Plot', 'Union', 'WBook', 'WSheet', '__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', 'active_obj', 'base', 'basename', 'check_convert_py_time_to_tdlt', 'color_col', 'config', 'date', 'dirname', 'dt', 'exit', 'file_dialog', 'find_book', 'find_graph', 'find_sheet', 'from_series', 'get_file_ext', 'get_file_parts', 'get_lt_str', 'get_page', 'get_show', 'glob', 'graph', 'graph_list', 'isfile', 'join', 'last_backslash', 'load_book', 'lt_exec', 'lt_float', 'lt_int', 'make_DataRange', 'matrix', 'modules', 'new', 'new_book', 'new_graph', 'new_sheet', 'np', 'ocolor', 'oext', 'open', 'origin_class', 'os', 'path', 'po', 'project', 'save', 'set_lt_str', 'set_lt_var', 'set_show', 'tdlt', 'time', 'to_rgb', 'utils', 'wait', 'worksheet']

Same happens to some of the other sample codes.


( model = op.NLFit('Gaussian')
AttributeError: module 'originpro' has no attribute 'NLFit')

Operating System:Windows
Pls help.

Edited by - bharath2k4er on 01/08/2023 12:50:52 PM

cpyang

USA
1406 Posts

Posted - 01/08/2023 :  3:52:25 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Support for Connector was added after 2021b, so you need at Origin 2022 or later to use the connector class.

CP
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