ValueError: Value must be one of {'doubleAccounting', 'double', 'singleAccounting', 'single'} - python

After writing the following code I get the following error. Help would be appreciated in understanding why openpyxl which is designed to work with EXCEL cannot open a basic excel file. Thank you in advance for your help.
import openpyxl
from openpyxl import workbook
from openpyxl import load_workbook
wb = load_workbook(file_name, read_only= True)
ValueError Traceback (most recent call last)
<ipython-input-7-9ebd7e3bdd2c> in <module>()
4
5
----> 6 wb = load_workbook(file_name, read_only= True)
C:\Users\Gaston\Anaconda3\lib\site-packages\openpyxl\reader\excel.py in load_workbook(filename, read_only, keep_vba, data_only, guess_types, keep_links)
199 wb.loaded_theme = archive.read(ARC_THEME)
200
--> 201 apply_stylesheet(archive, wb) # bind styles to workbook
202
203 # get worksheets
C:\Users\Gaston\Anaconda3\lib\site-packages\openpyxl\styles\stylesheet.py in apply_stylesheet(archive, wb)
171 return wb
172 node = fromstring(src)
--> 173 stylesheet = Stylesheet.from_tree(node)
174
175 wb._cell_styles = stylesheet.cell_styles
C:\Users\Gaston\Anaconda3\lib\site-packages\openpyxl\styles\stylesheet.py in from_tree(cls, node)
97 for k in attrs:
98 del node.attrib[k]
---> 99 return super(Stylesheet, cls).from_tree(node)
100
101
C:\Users\Gaston\Anaconda3\lib\site-packages\openpyxl\descriptors\serialisable.py in from_tree(cls, node)
70 if hasattr(desc, 'from_tree'):
71 #descriptor manages conversion
---> 72 obj = desc.from_tree(el)
73 else:
74 if hasattr(desc.expected_type, "from_tree"):
C:\Users\Gaston\Anaconda3\lib\site-packages\openpyxl\descriptors\sequence.py in from_tree(self, node)
84
85 def from_tree(self, node):
---> 86 return [self.expected_type.from_tree(el) for el in node]
C:\Users\Gaston\Anaconda3\lib\site-packages\openpyxl\descriptors\sequence.py in <listcomp>(.0)
84
85 def from_tree(self, node):
---> 86 return [self.expected_type.from_tree(el) for el in node]
C:\Users\Gaston\Anaconda3\lib\site-packages\openpyxl\descriptors\serialisable.py in from_tree(cls, node)
87 attrib[tag] = obj
88
---> 89 return cls(**attrib)
90
91
C:\Users\Gaston\Anaconda3\lib\site-packages\openpyxl\styles\fonts.py in __init__(self, name, sz, b, i, charset, u, strike, color, scheme, family, size, bold, italic, strikethrough, underline, vertAlign, outline, shadow, condense, extend)
85 if underline is not None:
86 u = underline
---> 87 self.u = u
88 if strikethrough is not None:
89 strike = strikethrough
C:\Users\Gaston\Anaconda3\lib\site-packages\openpyxl\descriptors\nested.py in __set__(self, instance, value)
34
35 value = self.from_tree(value)
---> 36 super(Nested, self).__set__(instance, value)
37
38
C:\Users\Gaston\Anaconda3\lib\site-packages\openpyxl\descriptors\base.py in __set__(self, instance, value)
143 if value == 'none':
144 value = None
--> 145 super(NoneSet, self).__set__(instance, value)
146
147
C:\Users\Gaston\Anaconda3\lib\site-packages\openpyxl\descriptors\base.py in __set__(self, instance, value)
128 def __set__(self, instance, value):
129 if value not in self.values:
--> 130 raise ValueError(self.__doc__)
131 super(Set, self).__set__(instance, value)
132
ValueError: Value must be one of {'single', 'double', 'singleAccounting', 'doubleAccounting'}
I have tried taking out the read_only part etc. The error has to do with Excel styles. I am using Excel 2016 and the file type is xlxs.

I've found a bug in an Excel processing library called RubyXL, which writes an invalid value to the .xslx file: https://github.com/weshatheleopard/rubyXL/issues/405
Excel tolerates the invalid underline style ement <u val="1"/> written by RubyXL, by interpreting it as a single-underline style, but openpyxl does not tolerate it.
Maybe your file has been corrupted by RubyXL or by another tool with a similar problem?

I've resolved this temporarily by comment the two lines in
"python3.8/site-packages/openpyxl/descriptors/base.py"" file
I just run the code in debug mode, so I can save the change forcedly.

Related

create_collection() got an unexpected keyword argument 'embedding_fn'

I was trying to use the langchain library to create a question answering system. But when I try to search in the document using the chromadb library it gives this error:
TypeError: create_collection() got an unexpected keyword argument 'embedding_fn'
Here's the code am working on
from langchain.embeddings.openai import OpenAIEmbeddings
from langchain.text_splitter import CharacterTextSplitter
from langchain.document_loaders import TextLoader
from langchain.vectorstores import Chroma
loader = TextLoader('./info.txt')
documents = loader.load()
text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)
texts = text_splitter.split_documents(documents)
embeddings = OpenAIEmbeddings()
docsearch = Chroma.from_documents(texts, embeddings).
The last line generates the error.
This is the complete error message:
TypeError Traceback (most recent call last)
Input In [36], in <cell line: 1>()
----> 1 docsearch = Chroma.from_documents(texts, embeddings)
File ~\anaconda3\lib\site-packages\langchain\vectorstores\chroma.py:212, in Chroma.from_documents(cls, documents, embedding, ids, collection_name, persist_directory, **kwargs)
210 texts = [doc.page_content for doc in documents]
211 metadatas = [doc.metadata for doc in documents]
--> 212 return cls.from_texts(
213 texts=texts,
214 embedding=embedding,
215 metadatas=metadatas,
216 ids=ids,
217 collection_name=collection_name,
218 persist_directory=persist_directory,
219 )
File ~\anaconda3\lib\site-packages\langchain\vectorstores\chroma.py:178, in Chroma.from_texts(cls, texts, embedding, metadatas, ids, collection_name, persist_directory, **kwargs)
151 #classmethod
152 def from_texts(
153 cls,
(...)
160 **kwargs: Any,
161 ) -> Chroma:
162 """Create a Chroma vectorstore from a raw documents.
163
164 If a persist_directory is specified, the collection will be persisted there.
(...)
176 Chroma: Chroma vectorstore.
177 """
--> 178 chroma_collection = cls(
179 collection_name=collection_name,
180 embedding_function=embedding,
181 persist_directory=persist_directory,
182 )
183 chroma_collection.add_texts(texts=texts, metadatas=metadatas, ids=ids)
184 return chroma_collection
File ~\anaconda3\lib\site-packages\langchain\vectorstores\chroma.py:65, in Chroma.__init__(self, collection_name, embedding_function, persist_directory)
60 logger.warning(
61 f"Collection {collection_name} already exists,"
62 " Do you have the right embedding function?"
63 )
64 else:
---> 65 self._collection = self._client.create_collection(
66 name=collection_name,
67 embedding_fn=self._embedding_function.embed_documents
68 if self._embedding_function is not None
69 else None,
70 )
TypeError: create_collection() got an unexpected keyword argument 'embedding_fn'
The create_collection method of chromadb.Client was changed 2 days ago and the embedding_fn parameter was renamed to embedding_function:
https://github.com/chroma-core/chroma/commit/6ce2388e219d47048e854be72be54617df647224
The source code for the langchain.vectorstores.chroma.Chroma class as of version 0.0.87 seems to have been updated already (3 hours before you asked the question) to match the chromadb library:
https://github.com/hwchase17/langchain/commit/34cba2da3264ccc9100f7efd16807c8d2a51734c
So you should be able to fix the problem by installing the newest version of LangChain.

VAR time series error - "4-th leading minor of the array is not positive definite"

I am trying to develop a VAR model to predict some 4 timeseries in a dataframe, althought whenever I try to get the otpimal number of lags to use in the model, or see the mode summaryI get that error - "4-th leading minor of the array is not positive definite". I have tried to reduce or limit the max_lags but nothing worked. I can do model.fit and forecast but I cannot discover the number os lags to use.
LinAlgError Traceback (most recent call last)
<ipython-input-56-979715efd6e1> in <module>()
1 model = VAR(train_diff)
2 model_fitted = model.fit()
----> 3 model_fitted.summary()
9 frames
/usr/local/lib/python3.7/dist-packages/statsmodels/tsa/vector_ar/var_model.py in summary(self)
1687 summary : VARSummary
1688 """
-> 1689 return VARSummary(self)
1690
1691 def irf(self, periods=10, var_decomp=None, var_order=None):
/usr/local/lib/python3.7/dist-packages/statsmodels/tsa/vector_ar/output.py in __init__(self, estimator)
67 def __init__(self, estimator):
68 self.model = estimator
---> 69 self.summary = self.make()
70
71 def __repr__(self):
/usr/local/lib/python3.7/dist-packages/statsmodels/tsa/vector_ar/output.py in make(self, endog_names, exog_names)
79
80 buf.write(self._header_table() + '\n')
---> 81 buf.write(self._stats_table() + '\n')
82 buf.write(self._coef_table() + '\n')
83 buf.write(self._resid_info() + '\n')
/usr/local/lib/python3.7/dist-packages/statsmodels/tsa/vector_ar/output.py in _stats_table(self)
126 'FPE:',
127 'Det(Omega_mle):')
--> 128 part2Ldata = [[model.neqs], [model.nobs], [model.llf], [model.aic]]
129 part2Rdata = [[model.bic], [model.hqic], [model.fpe], [model.detomega]]
130 part2Lheader = None
/usr/local/lib/python3.7/dist-packages/statsmodels/tools/decorators.py in __get__(self, obj, type)
91 _cachedval = _cache.get(name, None)
92 if _cachedval is None:
---> 93 _cachedval = self.fget(obj)
94 _cache[name] = _cachedval
95
/usr/local/lib/python3.7/dist-packages/statsmodels/tsa/vector_ar/var_model.py in llf(self)
1423 def llf(self):
1424 "Compute VAR(p) loglikelihood"
-> 1425 return var_loglike(self.resid, self.sigma_u_mle, self.nobs)
1426
1427 #cache_readonly
/usr/local/lib/python3.7/dist-packages/statsmodels/tsa/vector_ar/var_model.py in var_loglike(resid, omega, nobs)
325 \left(\ln\left|\Omega\right|-K\ln\left(2\pi\right)-K\right)
326 """
--> 327 logdet = logdet_symm(np.asarray(omega))
328 neqs = len(omega)
329 part1 = - (nobs * neqs / 2) * np.log(2 * np.pi)
/usr/local/lib/python3.7/dist-packages/statsmodels/tools/linalg.py in logdet_symm(m, check_symm)
26 if not np.all(m == m.T): # would be nice to short-circuit check
27 raise ValueError("m is not symmetric.")
---> 28 c, _ = linalg.cho_factor(m, lower=True)
29 return 2*np.sum(np.log(c.diagonal()))
30
/usr/local/lib/python3.7/dist-packages/scipy/linalg/decomp_cholesky.py in cho_factor(a, lower, overwrite_a, check_finite)
153 """
154 c, lower = _cholesky(a, lower=lower, overwrite_a=overwrite_a, clean=False,
--> 155 check_finite=check_finite)
156 return c, lower
157
/usr/local/lib/python3.7/dist-packages/scipy/linalg/decomp_cholesky.py in _cholesky(a, lower, overwrite_a, clean, check_finite)
38 if info > 0:
39 raise LinAlgError("%d-th leading minor of the array is not positive "
---> 40 "definite" % info)
41 if info < 0:
42 raise ValueError('LAPACK reported an illegal value in {}-th argument'
LinAlgError: 4-th leading minor of the array is not positive definite
That's the traceback I get.
Thanks for some help it would be much needed.

Azure ML - How do I fix this Snapshot Exception?

I'm doing a pipeline in Azure ML SDK. After I had run the pipeline for some amount of times it reported I had reached the Snapshot limit of 300MB. I followed some of the fixes that was proposed:
Each step script is moved to a separate subfolder
I added a datastore to the pipeline
This line was added: azureml._restclient.snapshots_client.SNAPSHOT_MAX_SIZE_BYTES = 1000
But then a new Snapshot error occurred after I submitted my pipeline:
pipeline1 = Pipeline(default_source_directory=".", default_datastore=def_blob_store, workspace=ws, steps=[prep_step, hd_step, register_model_step])
THE ERROR MESSAGE:
WARNING:root:If 'script' has been provided here and a script file name has been specified in 'run_config', 'script' provided in ScriptRunConfig initialization will take precedence.
---------------------------------------------------------------------------
SnapshotException Traceback (most recent call last)
<ipython-input-14-05c5aa4991aa> in <module>
----> 1 pipeline1 = Pipeline(default_source_directory=".", default_datastore=def_blob_store, workspace=ws, steps=[prep_step, hd_step, register_model_step])
2 pipeline1.validate()
3 pipeline_run = Experiment(ws, 'health_insuarance').submit(pipeline1, regenerate_outputs=False)
4 RunDetails(pipeline_run).show()
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azureml/core/_experiment_method.py in wrapper(self, *args, **kwargs)
95 """
96 ExperimentSubmitRegistrar.register_submit_function(self.__class__, submit_function)
---> 97 return init_func(self, *args, **kwargs)
98 return wrapper
99 return real_decorator
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azureml/pipeline/core/pipeline.py in __init__(self, workspace, steps, description, default_datastore, default_source_directory, resolve_closure, _workflow_provider, _service_endpoint, **kwargs)
175 raise ValueError('parameter %s is not recognized for Pipeline ' % key)
176 self._enable_email_notification = enable_email_notification
--> 177 self._graph = self._graph_builder.build(self._name, steps, finalize=False)
178
179 def _set_experiment_name(self, name):
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azureml/pipeline/core/builder.py in build(self, name, steps, finalize, regenerate_outputs)
1479 pass
1480
-> 1481 graph = self.construct(name, steps)
1482 if finalize:
1483 graph.finalize(regenerate_outputs=regenerate_outputs)
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azureml/pipeline/core/builder.py in construct(self, name, steps)
1501 self._graph = Graph(name, self._context)
1502 self._nodeStack.append([])
-> 1503 self.process_collection(steps)
1504 for builder in self._builderStack[::-1]:
1505 builder.apply_rules()
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azureml/pipeline/core/builder.py in process_collection(self, collection)
1537 self._nodeStack.append([])
1538 self._builderStack.append(builder)
-> 1539 builder.process_collection(collection)
1540 added_nodes = self._nodeStack.pop()
1541 self._nodeStack[-1].extend(added_nodes)
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azureml/pipeline/core/builder.py in process_collection(self, collection)
1828 """
1829 for item in collection:
-> 1830 self._base_builder.process_collection(item)
1831
1832 def apply_rules(self):
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azureml/pipeline/core/builder.py in process_collection(self, collection)
1531 # just a step?
1532 if isinstance(collection, PipelineStep):
-> 1533 return self.process_step(collection)
1534
1535 # delegate to correct builder
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azureml/pipeline/core/builder.py in process_step(self, step)
1575 return self._step2node[step]
1576
-> 1577 node = step.create_node(self._graph, self._default_datastore, self._context)
1578 self.assert_node_valid(step, self._graph, node)
1579
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azureml/pipeline/steps/hyper_drive_step.py in create_node(self, graph, default_datastore, context)
247 """
248 hyperdrive_config, reuse_hashable_config = self._get_hyperdrive_config(context._workspace,
--> 249 context._experiment_name)
250 self._params[HyperDriveStep._run_config_param_name] = json.dumps(hyperdrive_config)
251 self._params[HyperDriveStep._run_reuse_hashable_config] = json.dumps(reuse_hashable_config)
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azureml/pipeline/steps/hyper_drive_step.py in _get_hyperdrive_config(self, workspace, experiment_name)
323
324 hyperdrive_dto = _search._create_experiment_dto(self._hyperdrive_config, workspace,
--> 325 experiment_name, telemetry_values)
326
327 hyperdrive_config = hyperdrive_dto.as_dict()
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azureml/train/hyperdrive/_search.py in _create_experiment_dto(hyperdrive_config, workspace, experiment_name, telemetry_values, activity_logger, **kwargs)
41 if hyperdrive_config.source_directory is not None:
42 snapshot_client = SnapshotsClient(workspace.service_context)
---> 43 snapshot_id = snapshot_client.create_snapshot(hyperdrive_config.source_directory)
44
45 if activity_logger is not None:
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azureml/_restclient/snapshots_client.py in create_snapshot(self, file_or_folder_path, retry_on_failure, raise_on_validation_failure)
83 exclude_function = ignore_file.is_file_excluded
84
---> 85 self._validate_snapshot_size(file_or_folder_path, exclude_function, raise_on_validation_failure)
86
87 # Get the previous snapshot for this project
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azureml/_restclient/snapshots_client.py in _validate_snapshot_size(self, file_or_folder_path, exclude_function, raise_on_validation_failure)
61 "\n".format(file_or_folder_path, SNAPSHOT_MAX_SIZE_BYTES / ONE_MB)
62 if raise_on_validation_failure:
---> 63 raise SnapshotException(error_message)
64 else:
65 self._logger.warning(error_message)
SnapshotException: SnapshotException:
Message: ====================================================================
While attempting to take snapshot of ./train/
Your total snapshot size exceeds the limit of 0.00095367431640625 MB.
Please see http://aka.ms/aml-largefiles on how to work with large files.
====================================================================
InnerException None
ErrorResponse
{
"error": {
"message": "====================================================================\n\nWhile attempting to take snapshot of ./train/\nYour total snapshot size exceeds the limit of 0.00095367431640625 MB.\nPlease see http://aka.ms/aml-largefiles on how to work with large files.\n\n====================================================================\n\n"
}
}
Any idea how I fix this?
The fulls script is here: Script at Github
Alright, so I found the fix.
I changed this line by adding a number equvilant to 1GB: azureml._restclient.snapshots_client.SNAPSHOT_MAX_SIZE_BYTES = 1000000000
For some reason, you have to define the size in BYTES and not megabytes even though the default is 300 MB. Not especially intuitive.

Altair: NoMatchingVersions when saving maps with selenium

I am trying to create a series and save them iteratively.
The creation works well but while saving I get the following error:
---------------------------------------------------------------------------
NoMatchingVersions Traceback (most recent call last)
<ipython-input-103-e75c3f4b4fa5> in <module>
29 chart=(background + chart).configure_view(stroke='white')
30 filename = f"{scenario}.svg"
---> 31 save(chart, filename, method='selenium', webdriver=driver)
~\Anaconda3\lib\site-packages\altair_saver\_core.py in save(chart, fp, fmt, mode, method, **kwargs)
75 saver = Saver(spec, mode=mode, **kwargs)
76
---> 77 saver.save(fp=fp, fmt=fmt)
78
79
~\Anaconda3\lib\site-packages\altair_saver\savers\_saver.py in save(self, fp, fmt)
86 raise ValueError(f"Got fmt={fmt}; expected one of {self.valid_formats}")
87
---> 88 content = self.mimebundle(fmt).popitem()[1]
89 if isinstance(content, dict):
90 with maybe_open(fp, "w") as f:
~\Anaconda3\lib\site-packages\altair_saver\savers\_saver.py in mimebundle(self, fmts)
66 f"invalid fmt={fmt!r}; must be one of {self.valid_formats}."
67 )
---> 68 bundle.update(self._mimebundle(fmt))
69 return bundle
70
~\Anaconda3\lib\site-packages\altair_saver\savers\_selenium.py in _mimebundle(self, fmt)
249
250 def _mimebundle(self, fmt: str) -> Mimebundle:
--> 251 out = self._extract(fmt)
252 mimetype = fmt_to_mimetype(
253 fmt,
~\Anaconda3\lib\site-packages\altair_saver\savers\_selenium.py in _extract(self, fmt)
209 js_resources = {
210 "vega.js": get_bundled_script("vega", self._vega_version),
--> 211 "vega-lite.js": get_bundled_script("vega-lite", self._vegalite_version),
212 "vega-embed.js": get_bundled_script(
213 "vega-embed", self._vegaembed_version
~\Anaconda3\lib\site-packages\altair_viewer\_scripts.py in get_bundled_script(package, version)
36 f"package {package!r} not recognized. Available: {list(listing)}"
37 )
---> 38 version_str = find_version(version, listing[package])
39 content = pkgutil.get_data("altair_viewer", f"scripts/{package}-{version_str}.js")
40 if content is None:
~\Anaconda3\lib\site-packages\altair_viewer\_utils.py in find_version(version, candidates, strict_micro)
190 if not matches:
191 raise NoMatchingVersions(
--> 192 f"No matches for version={version!r} among {candidates}"
193 )
194 return str(matches[-1])
NoMatchingVersions: No matches for version='4.8.1' among ['4.0.2']
I am using selenium and altair_saver:
from altair_saver import save
from selenium import webdriver
driver = webdriver.Chrome(executable_path=r'pathtochromedriver/chromedriver_win32/chromedriver.exe')
for i, scenario in enumerate(scenario_columns):
chart=makechart(scenario, i)
filename = f"{scenario}.svg"
save(chart, filename, method='selenium', webdriver=driver)
Here `scenario` is a string without special characters.
You need to update the altair_viewer package to a newer version:
$ pip install -U altair_viewer
(This error was improved in https://github.com/altair-viz/altair_viewer/pull/33, so shouldn't be as mysterious when it comes up in the future).

what is the problem ?: application.connect() error

I am a beginner developer who started to study automation by using pywinauto.
An overflow error occurs when using application.connect () to connect to an already open program.
But application.start() works fine....
Please help me if someone know this part.
The source code and error contents are as follows.
Source code:
import pywinauto
app = pywinauto.application.Application()
app.connect(title_re='Calculator')
Error:
OverflowError Traceback (most recent call last)
in
1 import pywinauto
2 app = pywinauto.application.Application()
----> 3 app.connect(title_re='Calculator')
d:\Anaconda3\lib\site-packages\pywinauto\application.py in connect(self, **kwargs)
972 ).process_id
973 else:
--> 974 self.process = findwindows.find_element(**kwargs).process_id
975 connected = True
976
d:\Anaconda3\lib\site-packages\pywinauto\findwindows.py in find_element(**kwargs)
82 so please see :py:func:find_elements for the full parameters description.
83 """
---> 84 elements = find_elements(**kwargs)
85
86 if not elements:
d:\Anaconda3\lib\site-packages\pywinauto\findwindows.py in find_elements(class_name, class_name_re, parent, process, title, title_re, top_level_only, visible_only, enabled_only, best_match, handle, ctrl_index, found_index, predicate_func, active_only, control_id, control_type, auto_id, framework_id, backend, depth)
279 return title_regex.match(t)
280 return False
--> 281 elements = [elem for elem in elements if _title_match(elem)]
282
283 if visible_only:
d:\Anaconda3\lib\site-packages\pywinauto\findwindows.py in (.0)
279 return title_regex.match(t)
280 return False
--> 281 elements = [elem for elem in elements if _title_match(elem)]
282
283 if visible_only:
d:\Anaconda3\lib\site-packages\pywinauto\findwindows.py in _title_match(w)
275 def _title_match(w):
276 """Match a window title to the regexp"""
--> 277 t = w.rich_text
278 if t is not None:
279 return title_regex.match(t)
d:\Anaconda3\lib\site-packages\pywinauto\win32_element_info.py in rich_text(self)
81 def rich_text(self):
82 """Return the text of the window"""
---> 83 return handleprops.text(self.handle)
84
85 name = rich_text
d:\Anaconda3\lib\site-packages\pywinauto\handleprops.py in text(handle)
86 length += 1
87
---> 88 buffer_ = ctypes.create_unicode_buffer(length)
89
90 ret = win32functions.SendMessage(
d:\Anaconda3\lib\ctypes_init_.py in create_unicode_buffer(init, size)
286 return buf
287 elif isinstance(init, int):
--> 288 buftype = c_wchar * init
289 buf = buftype()
290 return buf
OverflowError: cannot fit 'int' into an index-sized integer
import pywinauto
app = pywinauto.Application(backend='uia').start('calc.exe')
try this if you are having problem you have to say the backennd is a uia it working fine for me.

Categories

Resources