Skip to content

Commit

Permalink
initial version of R2020b; version number is 9.9.1a0
Browse files Browse the repository at this point in the history
  • Loading branch information
alanfmw committed Jul 8, 2022
1 parent d6e13a3 commit 33ca959
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ The MATLAB® Engine API for Python® provides a package to integrate MATLA
## Requirements
### Required MathWorks Products
<!-- MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string) -->
* MATLAB release R2021a
* MATLAB release R2020b

### Required 3rd Party Products
<!-- MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string) -->
* Python 3.7 or 3.8
* Python 3.6, 3.7, or 3.8
* Supported Python versions by MATLAB release can be found [here](https://www.mathworks.com/content/dam/mathworks/mathworks-dot-com/support/sysreq/files/python-compatibility.pdf).

---
Expand All @@ -21,15 +21,15 @@ The MATLAB&reg; Engine API for Python&reg; provides a package to integrate MATLA
MATLAB Engine API for Python can be installed directly from the Python Package Index.
<!-- MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string) -->
```bash
$ python -m pip install matlabengine==9.10.1a1
$ python -m pip install matlabengine==9.9.1a0
```



### Linux&reg;
Prior to installation, check the default install location of MATLAB by calling ```matlabroot``` in a MATLAB Command Window. By default, Linux installs MATLAB at:<br>
<!-- MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string) -->
```/usr/local/MATLAB/R2021a```
```/usr/local/MATLAB/R2020b```

When MATLAB is not installed in the default location, the bin/*architecture* directory within the MATLAB root directory must be added to an environment variable. The path can be added to the environment variable within the shell startup configuration file (for example, .bashrc for bash shell or .tcshrc for tcsh).

Expand All @@ -46,14 +46,14 @@ setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:matlabroot/bin/glnxa64
MATLAB Engine API for Python can be installed directly from the Python Package Index.
<!-- MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string) -->
```bash
$ python -m pip install matlabengine==9.10.1a1
$ python -m pip install matlabengine==9.9.1a0
```

### macOS
Prior to installation, check the default install location of MATLAB by calling ```matlabroot``` in a MATLAB Command Window. By default, macOS installs MATLAB at:<br>

<!-- MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string) -->
```/Applications/MATLAB_R2021a.app```
```/Applications/MATLAB_R2020b.app```

When MATLAB is not installed in the default location, the bin/*architecture* directory within the MATLAB root directory must be added to an environment variable. The path can be added to the environment variable within the shell startup configuration file (for example, .bashrc for bash shell or .tcshrc for tcsh).

Expand All @@ -70,7 +70,7 @@ setenv DYLD_LIBRARY_PATH ${DYLD_LIBRARY_PATH}:matlabroot/bin/maci64
MATLAB Engine API for Python can be installed directly from the Python Package Index.
<!-- MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string) -->
```bash
$ python -m pip install matlabengine==9.10.1a1
$ python -m pip install matlabengine==9.9.1a0
```

---
Expand Down
11 changes: 6 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ class _MatlabFinder(build_py):
}

# MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string)
MATLAB_REL = 'R2021a'
MATLAB_REL = 'R2020b'

# MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string)
MATLAB_VER = '9.10.1a1'
MATLAB_VER = '9.9.1a0'

# MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string)
SUPPORTED_PYTHON_VERSIONS = set(['3.7', '3.8'])
SUPPORTED_PYTHON_VERSIONS = set(['3.6', '3.7', '3.8'])

# MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string)
VER_TO_REL = {
Expand Down Expand Up @@ -303,7 +303,7 @@ def run(self):
setup(
name="matlabengine",
# MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string)
version="9.10.1a1",
version="9.9.1a0",
description='A module to call MATLAB from Python',
author='MathWorks',
license="MathWorks XSLA License",
Expand All @@ -328,9 +328,10 @@ def run(self):
"Natural Language :: English",
"Intended Audience :: Developers",
# MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string)
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8"
],
# MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string)
python_requires=">=3.7, <3.9"
python_requires=">=3.6, <3.9"
)
9 changes: 4 additions & 5 deletions src/matlab/engine/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

# UPDATE_IF_PYTHON_VERSION_ADDED_OR_REMOVED : search for this string in codebase
# when support for a Python version must be added or removed
_supported_versions = ['2_7', '3_7', '3_8']
_supported_versions = ['3_6', '3_7', '3_8']
_ver = sys.version_info
_version = '{0}_{1}'.format(_ver[0], _ver[1])
_PYTHONVERSION = None
Expand All @@ -39,24 +39,23 @@
raise EnvironmentError("Python %s is not supported." % _version)

_module_folder = os.path.dirname(os.path.realpath(__file__))
_arch_filename = os.path.join(_module_folder, "_arch.txt")
_arch_filename = _module_folder+os.sep+"_arch.txt"

try:
pythonengine = importlib.import_module("matlabengineforpython"+_PYTHONVERSION)
except:
try:
_arch_file = open(_arch_filename,'r')
_lines = _arch_file.readlines()
[_arch, _bin_dir,_engine_dir, _extern_bin_dir] = [x.rstrip() for x in _lines if x.rstrip() != ""]
[_arch, _bin_dir,_engine_dir] = [x.rstrip() for x in _lines if x.rstrip() != ""]
_arch_file.close()
sys.path.insert(0,_engine_dir)
sys.path.insert(0,_extern_bin_dir)

_envs = {'win32': 'PATH', 'win64': 'PATH'}
if _arch in _envs:
if _envs[_arch] in os.environ:
_env = os.environ[_envs[_arch]]
os.environ[_envs[_arch]] = _bin_dir + os.pathsep + os.environ[_envs[_arch]]
os.environ[_envs[_arch]] = _bin_dir+os.pathsep+os.environ[_envs[_arch]]
else:
os.environ[_envs[_arch]] = _bin_dir
if sys.version_info.major >= 3 and sys.version_info.minor >= 8:
Expand Down

0 comments on commit 33ca959

Please sign in to comment.