|
1 | | -#Copyright 2014-2022 MathWorks, Inc. |
| 1 | +#Copyright 2014-2023 MathWorks, Inc. |
2 | 2 |
|
3 | 3 | """ |
4 | 4 | The MATLAB Engine enables you to call any MATLAB statement either synchronously |
|
44 | 44 | firstExceptionMessage = '' |
45 | 45 | secondExceptionMessage = '' |
46 | 46 | try: |
47 | | - pythonengine = importlib.import_module("matlabengineforpython"+_PYTHONVERSION) |
| 47 | + if _PYTHONVERSION != '3_9' and _PYTHONVERSION != '3_10': |
| 48 | + pythonengine = importlib.import_module("matlabengineforpython_abi3") |
| 49 | + else: |
| 50 | + pythonengine = importlib.import_module("matlabengineforpython" + _PYTHONVERSION) |
48 | 51 | except Exception as firstE: |
49 | 52 | firstExceptionMessage = str(firstE) |
50 | 53 |
|
|
65 | 68 | else: |
66 | 69 | os.environ[_envs[_arch]] = _bin_dir |
67 | 70 | os.add_dll_directory(_bin_dir) |
68 | | - pythonengine = importlib.import_module("matlabengineforpython"+_PYTHONVERSION) |
| 71 | + if _PYTHONVERSION != '3_9' or _PYTHONVERSION != '3_10': |
| 72 | + pythonengine = importlib.import_module("matlabengineforpython_abi3") |
| 73 | + else: |
| 74 | + pythonengine = importlib.import_module("matlabengineforpython" + _PYTHONVERSION) |
69 | 75 | except Exception as secondE: |
70 | 76 | str1 = 'Please reinstall MATLAB Engine for Python or contact ' |
71 | 77 | str2 = 'MathWorks Technical Support for assistance:\nFirst issue: {}\nSecond issue: {}'.format( |
@@ -106,9 +112,8 @@ def start_matlab(option="-nodesktop", **kwargs): |
106 | 112 | |
107 | 113 | Parameters |
108 | 114 | option - MATLAB startup option. |
109 | | - async, background: bool - start MATLAB asynchronously or not. This parameter |
110 | | - is optional and false by default. "async" is a synonym for "background" |
111 | | - that will be removed in a future release. |
| 115 | + background: bool - start MATLAB asynchronously or not. This parameter |
| 116 | + is optional and false by default. |
112 | 117 | |
113 | 118 | Returns |
114 | 119 | MatlabEngine - if aync or background is false. This object can be used to evaluate |
|
0 commit comments