...
Warning | ||
---|---|---|
Attention: All scripts in this page are assuming that your current shell is Bash.
In order to change your default shell at login from tcsh (or any other shell) to Bash, please execute the following command on a Linux server on the AFS network, such as a rhel6-64* node. (You will be prompted for your password during this process):
After that, close the terminal and open a new one. You will be using Bash as the default shell. You can check if all went well with the following command in a new Terminal window:
|
Anchor | ||||
---|---|---|---|---|
|
We can directly call Python library functionality from MATLAB or write Python programs that work with MATLAB.
For information on compatible Python versions, refer to the link: https://www.mathworks.com/support/requirements/python-compatibility.html
To check the Python version in MATLAB, use the following command:
Code Block | ||
---|---|---|
| ||
>> pyenv
ans =
PythonEnvironment with properties:
Version: "3.8"
Executable: "/usr/local/lcls/package/anaconda/envs/python3_env/bin/python"
Library: "/usr/local/lcls/package/anaconda/envs/python3_env/lib/libpython3.8.so"
Home: "/usr/local/lcls/package/anaconda/envs/python3_env"
Status: NotLoaded
ExecutionMode: InProcess |
Note |
---|
The library conflicts between MATLAB's and Python's libraries can result in segmentation faults. |
If the Python version in the MATLAB environment differs from the one in the Linux environment (the version used in DEV and PROD, you need to update the "startup.m" file located at "$TOOLS/matlab/toolbox/."
Code Block | ||
---|---|---|
| ||
# A snippet of the file:
if strcmp(version('-release'),'2020a') | strcmp(version('-release'),'2022b') | strcmp(version('-release'),'2023a')
% Setup Python Environment:
package_top = getenv('PACKAGE_TOP');
pyenv_path = [package_top '/anaconda/envs/python3_rhel7_env/bin/python'];
pyenv('Version', pyenv_path,'ExecutionMode','InProcess');
%% Change default add-ons installation folder for Monkey Proof Code Checker
theSettings = settings();
theSettings.matlab.addons.InstallationFolder.TemporaryValue = [package_top '/matlab/2020a/SupportPackages'];
end |
Anchor | ||||
---|---|---|---|---|
|
...