{"id":18455,"date":"2025-09-17T11:59:20","date_gmt":"2025-09-17T15:59:20","guid":{"rendered":"https:\/\/blogs.mathworks.com\/deep-learning\/?p=18455"},"modified":"2025-09-24T09:49:14","modified_gmt":"2025-09-24T13:49:14","slug":"pip-uv-in-matlab-online","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/deep-learning\/2025\/09\/17\/pip-uv-in-matlab-online\/","title":{"rendered":"pip &#038; uv in MATLAB Online"},"content":{"rendered":"MATLAB Online is a very convenient platform for working with MATLAB and Python\u00ae together. And I am not only saying this because I was part of the MATLAB Online product team until fairly recently (ok, now you know my biases). Even before joining the online product team, I was leveraging this online environment to deliver workshops at scale. The main reason why I adopted this approach is because I always used to waste up to 30 min upfront on questions like:\r\n<h6><\/h6>\r\n<em>\u201cWhich set of Python packages do I need to make this script run on my machine?\u201d<\/em>\r\n<h6><\/h6>\r\nSo, I decided to document how to build reproducible MATLAB and Python environments to facilitate the on-boarding of users of both languages. Another motivation early on was to enable the example of my <a href=\"https:\/\/github.com\/yanndebray\/matlab-with-python-book\/blob\/main\/8_Resources.md\">book on MATLAB with Python<\/a> to open in MATLAB Online.\r\n<h6><\/h6>\r\nTwo tools stand out for this purpose:\u00a0<strong>pip<\/strong>, the classic Python package manager, and\u00a0<strong>uv<\/strong>, a modern, high-speed alternative.\u00a0<strong>uv<\/strong> is the new cool kid in town, and I have finally invested the time to play around with it and compared it with <strong>pip<\/strong>. I thought you might be interested in my learnings. Buckle up, let\u2019s install some python packages!\r\n<h6><\/h6>\r\n<img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-18515 size-medium\" src=\"https:\/\/blogs.mathworks.com\/deep-learning\/files\/2025\/09\/python-packages-matlab-online-2-300x300.png\" alt=\"\" width=\"300\" height=\"300\" \/>\r\n<h6><\/h6>\r\n<h2>TL;DR<\/h2>\r\n<ul>\r\n \t<li>MATLAB Online ships with a version of Python you can use right away. You can retrieve a package manager like pip to <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/answers\/648773-installing-python-libraries-in-matlab-online\">install packages<\/a>\u00a0and call them from MATLAB.<\/li>\r\n \t<li>For speed and more advanced development workflows, <a href=\"https:\/\/docs.astral.sh\/uv\/getting-started\/installation\/\">install uv<\/a>, add it to <span style=\"font-family: Consolas, Monaco, monospace; font-size: inherit;\">PATH<\/span> for your MATLAB session, then use uv to manage packages\u00a0and virtual environments.<\/li>\r\n \t<li>Avoid putting virtual environments under <span style=\"font-family: Consolas, Monaco, monospace; font-size: inherit;\">\/MATLAB Drive<\/span>. Create them under your home directory instead, more precisely <span style=\"font-family: Consolas, Monaco, monospace; font-size: inherit;\">\/home\/matlab<\/span>.<\/li>\r\n \t<li>Each <span style=\"font-family: Consolas, Monaco, monospace; font-size: inherit;\">!<\/span> shell call in MATLAB is a fresh non-interactive shell; use <span style=\"font-family: Consolas, Monaco, monospace; font-size: inherit;\">setenv<\/span> inside MATLAB to persist environment changes like <span style=\"font-family: Consolas, Monaco, monospace; font-size: inherit;\">PATH<\/span>.<\/li>\r\n<\/ul>\r\n<h6><\/h6>\r\n&nbsp;\r\n<h2>Get started with the MATLAB Online sandbox<\/h2>\r\n<h6><\/h6>\r\nYou can access MATLAB Online from the following shortcut in your web browser:\r\n<h6><\/h6>\r\n<a href=\"https:\/\/matlab.new\">https:\/\/matlab.new<\/a>\r\n<h6><\/h6>\r\nIt will take you to MATLAB Home, where you can Open MATLAB Online or pick up from files you have been editing in previous sessions:\r\n<h6><\/h6>\r\n<img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-18464\" src=\"https:\/\/blogs.mathworks.com\/deep-learning\/files\/2025\/09\/Open-MATLAB-Online.png\" alt=\"\" width=\"302\" height=\"84\" \/>\r\n\r\n&nbsp;\r\n<h6><\/h6>\r\nIn MATLAB Online you get an ephemeral machine, on which you can experiment freely, simply because it is not your local machine, and you will be served with a new one when you quit your session with the command <strong>exit<\/strong>. So feel free to install things to try out new libraries, as long as you don\u2019t persist them in your MATLAB Drive.\r\n<h6><\/h6>\r\nSomething that you might already know from working on your Windows\u00ae desktop machine; you can run OS commands with the <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/exclamationpoint.html\">exclamation mark<\/a> operator ! (also called bang). One thing to pay attention to is that each call spawns a new shell, so exported variables in one ! call don\u2019t persist to the next. Use the MATLAB function <span style=\"font-family: Consolas, Monaco, monospace; font-size: inherit;\"><a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/setenv.html\">setenv<\/a><\/span> to make environment variables (like PATH) stick for your session. You might be familiar with this command to pass your API key to call <a href=\"https:\/\/github.com\/matlab-deep-learning\/llms-with-matlab\">LLMs with MATLAB<\/a>.\r\n<h6><\/h6>\r\nNow that you are equipped with the basic concepts, let\u2019s dive into the world of Python dependencies.\r\n<h6><\/h6>\r\n&nbsp;\r\n<h2>Option 1 \u2013 Plain old pip<\/h2>\r\npip stands for Python installs packages. It is a recursive acronym (like <a href=\"https:\/\/en.wikipedia.org\/wiki\/GNU\">GNU<\/a> is Not Unix). It is the default Python package manager, that ships with Python on Windows. On Linux, it typically needs to be retrieved separately, like venv (the default virtual environment manager). Here is a quick method to fetch and install pip with a simple script:\r\n<h6><\/h6>\r\n<div style=\"position: relative; background: #f9fafb; border: 1px solid #d1d5db; border-radius: 6px; padding: 1rem; font-family: Consolas,monospace; color: #111827;\"><button style=\"position: absolute; top: 8px; right: 8px; background: #e5e7eb; color: #111827; border: 1px solid #d1d5db; border-radius: 4px; padding: 4px 8px; font-size: 12px; cursor: pointer;\">\r\nCopy\r\n<\/button>\r\n<pre id=\"matlab-snippet\" style=\"margin: 0; padding: 0; border: none; background: none; color: inherit; white-space: pre; line-height: 1.4;\"><span class=\"comment\">% Retrieve pip from PyPA<\/span>\r\nwebsave('\/tmp\/get-pip.py','https:\/\/bootstrap.pypa.io\/get-pip.py');\r\n<span class=\"comment\">% Install pip<\/span>\r\nsystem('python \/tmp\/get-pip.py');<\/pre>\r\n<\/div>\r\n<h6><\/h6>\r\nInstall Numpy (in quiet mode with flag -q) and time it\r\n<h6><\/h6>\r\n<div style=\"position: relative; background: #f9fafb; border: 1px solid #d1d5db; border-radius: 6px; padding: 1rem; font-family: Consolas,monospace; color: #111827;\"><button style=\"position: absolute; top: 8px; right: 8px; background: #e5e7eb; color: #111827; border: 1px solid #d1d5db; border-radius: 4px; padding: 4px 8px; font-size: 12px; cursor: pointer;\">\r\nCopy\r\n<\/button>\r\n<pre id=\"matlab-snippet\" style=\"margin: 0; padding: 0; border: none; background: none; color: inherit; white-space: pre; line-height: 1.4;\">system('time python -m pip install -q numpy');<\/pre>\r\n<\/div>\r\n<h6><\/h6>\r\n<pre class=\"brush: python\" style=\"background-color: white; border: white;\">real\u00a0\u00a0 0m3.125s<\/pre>\r\n<pre class=\"brush: python\" style=\"background-color: white; border: white;\">user\u00a0\u00a0 0m2.041s<\/pre>\r\n<pre class=\"brush: python\" style=\"background-color: white; border: white;\">sys\u00a0\u00a0\u00a0 0m0.284s\r\n\r\n<\/pre>\r\n<h6><\/h6>\r\nThis first test is too simple, let\u2019s take something heavier like PyTorch\u00ae:\r\n<h6><\/h6>\r\n<div style=\"position: relative; background: #f9fafb; border: 1px solid #d1d5db; border-radius: 6px; padding: 1rem; font-family: Consolas,monospace; color: #111827;\"><button style=\"position: absolute; top: 8px; right: 8px; background: #e5e7eb; color: #111827; border: 1px solid #d1d5db; border-radius: 4px; padding: 4px 8px; font-size: 12px; cursor: pointer;\">\r\nCopy\r\n<\/button>\r\n<pre id=\"matlab-snippet\" style=\"margin: 0; padding: 0; border: none; background: none; color: inherit; white-space: pre; line-height: 1.4;\">tic; system('python -m pip install -q torch'); toc<\/pre>\r\n<\/div>\r\n<h6><\/h6>\r\n<pre class=\"brush: python\" style=\"background-color: white; border: white;\">Elapsed time is 120.127409 seconds.<\/pre>\r\n<h6><\/h6>\r\nAs you can see it takes around 2 minutes to install PyTorch (with its dependencies).\r\n<h6><\/h6>\r\nNow, let\u2019s try uv \ud83d\ude80\r\n<h6><\/h6>\r\n&nbsp;\r\n<h2>Option 2 \u2013 uv: faster installs, nicer tooling<\/h2>\r\n<h6><\/h6>\r\nuv is a single, blazing-fast tool that can replace pip, pipx, virtualenv, parts of poetry\/pdm, and more. It\u2019s 10\u2013100\u00d7 faster than pip for installs, and includes uvx to run tools without installing them globally. Some might say it is \u201cyet another Python package manager\u201d. They wouldn\u2019t be wrong. But I got curious about the hype, and decided to test it myself. And I have to say that I quite appreciate it, even just for the speed up.\r\n<h6><\/h6>\r\n<img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-18470\" src=\"https:\/\/blogs.mathworks.com\/deep-learning\/files\/2025\/09\/uv-speedup.png\" alt=\"\" width=\"601\" height=\"130\" \/>\r\n<h6><\/h6>\r\n<h3>Install uv and put it on the system PATH<\/h3>\r\nSimply follow the <a href=\"https:\/\/docs.astral.sh\/uv\/getting-started\/installation\/\">instructions from the uv documentation<\/a>:\r\n<h6><\/h6>\r\n<div style=\"position: relative; background: #f9fafb; border: 1px solid #d1d5db; border-radius: 6px; padding: 1rem; font-family: Consolas,monospace; color: #111827;\"><button style=\"position: absolute; top: 8px; right: 8px; background: #e5e7eb; color: #111827; border: 1px solid #d1d5db; border-radius: 4px; padding: 4px 8px; font-size: 12px; cursor: pointer;\">\r\nCopy\r\n<\/button>\r\n<pre id=\"matlab-snippet\" style=\"margin: 0; padding: 0; border: none; background: none; color: inherit; white-space: pre; line-height: 1.4;\">!curl -LsSf https:\/\/astral.sh\/uv\/install.sh | sh<\/pre>\r\n<\/div>\r\n<h6><\/h6>\r\n<pre class=\"brush: python\" style=\"background-color: white; border: white;\">curl: \/MATLAB\/bin\/glnxa64\/libcurl.so.4: no version information available (required by curl)<\/pre>\r\n<pre class=\"brush: python\" style=\"background-color: white; border: white;\">downloading uv 0.8.15 x86_64-unknown-linux-gnu<\/pre>\r\n<pre class=\"brush: python\" style=\"background-color: white; border: white;\">curl: \/MATLAB\/bin\/glnxa64\/libcurl.so.4: no version information available (required by curl)<\/pre>\r\n<pre class=\"brush: python\" style=\"background-color: white; border: white;\">no checksums to verify<\/pre>\r\n<pre class=\"brush: python\" style=\"background-color: white; border: white;\">installing to \/home\/matlab\/.local\/bin<\/pre>\r\n<pre class=\"brush: python\" style=\"background-color: white; border: white;\">uv<\/pre>\r\n<pre class=\"brush: python\" style=\"background-color: white; border: white;\">uvx<\/pre>\r\n<pre class=\"brush: python\" style=\"background-color: white; border: white;\">everything's installed!<\/pre>\r\n<pre class=\"brush: python\" style=\"background-color: white; border: white;\"><\/pre>\r\n<pre class=\"brush: python\" style=\"background-color: white; border: white;\">To add $HOME\/.local\/bin to your PATH, either restart your shell or run:<\/pre>\r\n&nbsp;\r\n<pre class=\"brush: python\" style=\"background-color: white; border: white;\">source $HOME\/.local\/bin\/env (sh, bash, zsh)<\/pre>\r\n<pre class=\"brush: python\" style=\"background-color: white; border: white;\">source $HOME\/.local\/bin\/env.fish (fish)<\/pre>\r\nUnlike what is suggested, you will need another method to add $HOME\/.local\/bin to your PATH so that it persists in your !\/system calls:\r\n<h6><\/h6>\r\n<div style=\"position: relative; background: #f9fafb; border: 1px solid #d1d5db; border-radius: 6px; padding: 1rem; font-family: Consolas,monospace; color: #111827;\"><button style=\"position: absolute; top: 8px; right: 8px; background: #e5e7eb; color: #111827; border: 1px solid #d1d5db; border-radius: 4px; padding: 4px 8px; font-size: 12px; cursor: pointer;\">\r\nCopy\r\n<\/button>\r\n<pre id=\"matlab-snippet\" style=\"margin: 0; padding: 0; border: none; background: none; color: inherit; white-space: pre; line-height: 1.4;\">% 1) Point PATH to where uv was installed\r\nsetenv('PATH', getenv('HOME')+\"\/.local\/bin:\"+getenv('PATH'));\r\n<span class=\"comment\">% Sanity checks<\/span>\r\nsystem('which uv'); <span class=\"comment\"> % should print ~\/.local\/bin\/uv<\/span><\/pre>\r\n<\/div>\r\n<h6><\/h6>\r\n<pre class=\"brush: python\" style=\"background-color: white; border: white;\">\/home\/matlab\/.local\/bin\/uv<\/pre>\r\n<h6><\/h6>\r\nWhy setenv? Each ! call is a fresh shell; source ~\/.local\/bin\/env doesn\u2019t persist across ! calls. setenv updates the environment for subsequent !\/system calls.\r\n<h6><\/h6>\r\n<div style=\"position: relative; background: #f9fafb; border: 1px solid #d1d5db; border-radius: 6px; padding: 1rem; font-family: Consolas,monospace; color: #111827;\"><button style=\"position: absolute; top: 8px; right: 8px; background: #e5e7eb; color: #111827; border: 1px solid #d1d5db; border-radius: 4px; padding: 4px 8px; font-size: 12px; cursor: pointer;\">\r\nCopy\r\n<\/button>\r\n<pre id=\"matlab-snippet\" style=\"margin: 0; padding: 0; border: none; background: none; color: inherit; white-space: pre; line-height: 1.4;\">system('uv --version');<\/pre>\r\n<\/div>\r\n<h6><\/h6>\r\n<pre class=\"brush: python\" style=\"background-color: white; border: white;\">uv 0.8.15<\/pre>\r\n<h6><\/h6>\r\n<div style=\"position: relative; background: #f9fafb; border: 1px solid #d1d5db; border-radius: 6px; padding: 1rem; font-family: Consolas,monospace; color: #111827;\"><button style=\"position: absolute; top: 8px; right: 8px; background: #e5e7eb; color: #111827; border: 1px solid #d1d5db; border-radius: 4px; padding: 4px 8px; font-size: 12px; cursor: pointer;\">\r\nCopy\r\n<\/button>\r\n<pre id=\"matlab-snippet\" style=\"margin: 0; padding: 0; border: none; background: none; color: inherit; white-space: pre; line-height: 1.4;\">system('uvx --version');<\/pre>\r\n<\/div>\r\n<h6><\/h6>\r\n<pre class=\"brush: python\" style=\"background-color: white; border: white;\">uvx 0.8.15<\/pre>\r\n<h6><\/h6>\r\n<div style=\"position: relative; background: #f9fafb; border: 1px solid #d1d5db; border-radius: 6px; padding: 1rem; font-family: Consolas,monospace; color: #111827;\"><button style=\"position: absolute; top: 8px; right: 8px; background: #e5e7eb; color: #111827; border: 1px solid #d1d5db; border-radius: 4px; padding: 4px 8px; font-size: 12px; cursor: pointer;\">\r\nCopy\r\n<\/button>\r\n<pre id=\"matlab-snippet\" style=\"margin: 0; padding: 0; border: none; background: none; color: inherit; white-space: pre; line-height: 1.4;\">system('python --version');<\/pre>\r\n<\/div>\r\n<h6><\/h6>\r\n<pre class=\"brush: python\" style=\"background-color: white; border: white;\">Python 3.10.17<\/pre>\r\n<h6><\/h6>\r\n<h3>Create and activate a virtual environment<\/h3>\r\n<h6><\/h6>\r\nBefore installing packages, it is a good practice in Python to use a <a href=\"https:\/\/realpython.com\/python-virtual-environments-a-primer\/\">virtual environment<\/a> (venv). This acts a little bit like virtualization with a docker container, but takes up less space as it works at the language level, not the operating system level. Setting the --clear flag ensures reproducibility to reset an already existing environment called env that might exist in the same location.\r\n<h6><\/h6>\r\n<div style=\"position: relative; background: #f9fafb; border: 1px solid #d1d5db; border-radius: 6px; padding: 1rem; font-family: Consolas,monospace; color: #111827;\"><button style=\"position: absolute; top: 8px; right: 8px; background: #e5e7eb; color: #111827; border: 1px solid #d1d5db; border-radius: 4px; padding: 4px 8px; font-size: 12px; cursor: pointer;\">\r\nCopy\r\n<\/button>\r\n<pre id=\"matlab-snippet\" style=\"margin: 0; padding: 0; border: none; background: none; color: inherit; white-space: pre; line-height: 1.4;\"><span class=\"comment\">% 2) Create a venv OUTSIDE MATLAB Drive (symlinks are fine here)<\/span>\r\nsystem('uv venv --clear \/home\/matlab\/venvs\/env');\r\n<\/pre>\r\n<\/div>\r\n<h6><\/h6>\r\n<pre class=\"brush: python\" style=\"background-color: white; border: white;\">Using CPython 3.10.17 interpreter at: \/usr\/bin\/python<\/pre>\r\n<pre class=\"brush: python\" style=\"background-color: white; border: white;\">Creating virtual environment at: \/home\/matlab\/venvs\/env<\/pre>\r\n<pre class=\"brush: python\" style=\"background-color: white; border: white;\">Activate with: source \/home\/matlab\/venvs\/env\/bin\/activate<\/pre>\r\n<h6><\/h6>\r\n<div style=\"position: relative; background: #f9fafb; border: 1px solid #d1d5db; border-radius: 6px; padding: 1rem; font-family: Consolas,monospace; color: #111827;\"><button style=\"position: absolute; top: 8px; right: 8px; background: #e5e7eb; color: #111827; border: 1px solid #d1d5db; border-radius: 4px; padding: 4px 8px; font-size: 12px; cursor: pointer;\">\r\nCopy\r\n<\/button>\r\n<pre id=\"matlab-snippet\" style=\"margin: 0; padding: 0; border: none; background: none; color: inherit; white-space: pre; line-height: 1.4;\"><span class=\"comment\">% 3) \"Activate\" it for this MATLAB session <\/span>\r\nsetenv('VIRTUAL_ENV','\/home\/matlab\/venvs\/env');\r\nsetenv('PATH', ['\/home\/matlab\/venvs\/env\/bin:' getenv('PATH')]);\r\n<\/pre>\r\n<\/div>\r\n<h6><\/h6>\r\nOnce again, the \u201cactivation\u201d of the environment won\u2019t be done through the source command, but by adding two important variables (VIRTUAL_ENV and PATH) to the OS environment.\r\n<h6><\/h6>\r\n<strong>\/!\\ by default uv won\u2019t be found <\/strong>\r\n<pre>&gt;&gt; !uv pip install numpy\r\nerror: Broken virtual environment `\/MATLAB Drive\/.venv`: `pyvenv.cfg` is missing\r\n<\/pre>\r\n<h6><\/h6>\r\nThere is a hiccup if you try to store your python environment in your MATLAB Drive. MATLAB Drive is the default file storage mechanism for MATLAB Online. It shows up as \/MATLAB Drive, where your drive is mounted on the machine that is attributed to your MATLAB Online session. This mount does not create symbolic links, which matters for virtual environments (<a href=\"https:\/\/github.com\/astral-sh\/uv\/issues\/11927\">symlinks are not supported there<\/a>).\r\n<h6><\/h6>\r\nInstead, I would recommend you use other ephemeral locations specific to the duration of your MATLAB Online session, like \/home\/matlab for venvs (this directory is stored as the variable $HOME in MATLAB Online).\r\n<h6><\/h6>\r\n&nbsp;\r\n<h3>Install packages with uv<\/h3>\r\n<h6><\/h6>\r\nLet\u2019s finally install PyTorch with uv.\r\n<h6><\/h6>\r\n<div style=\"position: relative; background: #f9fafb; border: 1px solid #d1d5db; border-radius: 6px; padding: 1rem; font-family: Consolas,monospace; color: #111827;\"><button style=\"position: absolute; top: 8px; right: 8px; background: #e5e7eb; color: #111827; border: 1px solid #d1d5db; border-radius: 4px; padding: 4px 8px; font-size: 12px; cursor: pointer;\">\r\nCopy\r\n<\/button>\r\n<pre id=\"matlab-snippet\" style=\"margin: 0; padding: 0; border: none; background: none; color: inherit; white-space: pre; line-height: 1.4;\">tic;\r\nsystem('uv pip install -q torch');\r\ntoc<\/pre>\r\n<\/div>\r\n<h6><\/h6>\r\n<pre class=\"brush: python\" style=\"background-color: white; border: white;\">Elapsed time is 35.361351 seconds.<\/pre>\r\n<h6><\/h6>\r\nAs you can see, it brings a significant speedup. Now that I \u2018ve tried it, I\u2019m ready to store an install and setup script for uv in my MATLAB Drive, so I can just add uv in front of my pip install commands from now on!\r\n<h6><\/h6>\r\n&nbsp;\r\n<h2>Try it with an example: Call PyTorch from MATLAB Online<\/h2>\r\n<h6><\/h6>\r\nLet's use the basic <a href=\"https:\/\/docs.pytorch.org\/tutorials\/beginner\/basics\/quickstart_tutorial.html\">quickstart tutorial<\/a> from the PyTorch documentation. This is a classification example with a model that has been trained on 60000 28x28 grey pictures of clothes, called the Fashion MNIST dataset.\r\n<h6><\/h6>\r\nFirst connect MATLAB Online to your newly created Python environment from the command window. I recommend setting the execution mode to \u201cOutOfProcess\u201d. This way you can <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/pythonenvironment.terminate.html\">terminate the environment connection<\/a> without having to restart MATLAB Online. Also make sure that the python Executable field points to the Python in your venv.\r\n<h6><\/h6>\r\n<div style=\"position: relative; background: #f9fafb; border: 1px solid #d1d5db; border-radius: 6px; padding: 1rem; font-family: Consolas,monospace; color: #111827;\"><button style=\"position: absolute; top: 8px; right: 8px; background: #e5e7eb; color: #111827; border: 1px solid #d1d5db; border-radius: 4px; padding: 4px 8px; font-size: 12px; cursor: pointer;\">\r\nCopy\r\n<\/button>\r\n<pre id=\"matlab-snippet\" style=\"margin: 0; padding: 0; border: none; background: none; color: inherit; white-space: pre; line-height: 1.4;\">&gt;&gt; pyenv(\"ExecutionMode\",\"OutOfProcess\")<\/pre>\r\n<\/div>\r\n<h6><\/h6>\r\n<pre class=\"brush: python\" style=\"background-color: white; border: white;\">ans = \r\n\r\n\u00a0 <a href=\"matlab:helpPopup('matlab.pyclient.PythonEnvironment')\"><strong>PythonEnvironment<\/strong><\/a> with properties:\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Version: \"3.10\"\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Executable: \"\/home\/matlab\/venvs\/env\/bin\/python3\"\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Library: \"libpython3.10.so.1.0\"\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Home: \"\/home\/matlab\/venvs\/env\"\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Status: NotLoaded\r\n\u00a0\u00a0\u00a0 ExecutionMode: OutOfProcess<\/pre>\r\n&nbsp;\r\n\r\nOnce the connection with Python is established, you can retrieve the : <a href=\"https:\/\/drive.mathworks.com\/sharing\/3ebb886a-fd21-4bc8-ba94-e0ad5912c309\">https:\/\/drive.mathworks.com\/sharing\/3ebb886a-fd21-4bc8-ba94-e0ad5912c309<\/a>\r\n\r\n&nbsp;\r\n\r\nNext, you can use a to simply paste Python code that will be wrapped under the hood with the <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/pyrun.html\">pyrun<\/a> function.\r\n<h6><\/h6>\r\n<img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-18473\" src=\"https:\/\/blogs.mathworks.com\/deep-learning\/files\/2025\/09\/pyrun-task.png\" alt=\"\" width=\"800\" height=\"449\" \/>\r\n<h6><\/h6>\r\nIf you unfold the &gt; Show code you will get the following generated code.\r\n<h6><\/h6>\r\n<div style=\"position: relative; background: #f9fafb; border: 1px solid #d1d5db; border-radius: 6px; padding: 1rem; font-family: Consolas,monospace; color: #111827;\"><button style=\"position: absolute; top: 8px; right: 8px; background: #e5e7eb; color: #111827; border: 1px solid #d1d5db; border-radius: 4px; padding: 4px 8px; font-size: 12px; cursor: pointer;\">\r\nCopy\r\n<\/button>\r\n<pre id=\"matlab-snippet\" style=\"margin: 0; padding: 0; border: none; background: none; color: inherit; white-space: pre; line-height: 1.4;\"><span class=\"comment\">% Python code input<\/span>\r\npycode = [...\r\n\"import torch\",...\r\n\"from fashion_model import NeuralNetwork\",...\r\n\"model = NeuralNetwork().to('cpu')\",...\r\n\"model.load_state_dict(torch.load(\"\"model.pth\"\", map_location=torch.device('cpu')))\"...\r\n];\r\n\r\ntry\r\n\u00a0\u00a0\u00a0 [model] = pyrun(pycode, ...\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 [ \"model\" ])\r\ncatch ME6\r\n\u00a0\u00a0\u00a0<span class=\"comment\"> % Clear temporary variables from workspace and from Python<\/span>\r\n\u00a0\u00a0\u00a0 clear pycode;\r\n\u00a0\u00a0\u00a0 rethrow(ME6)\r\nend<\/pre>\r\n<\/div>\r\n<h6><\/h6>\r\n<pre class=\"brush: python\" style=\"background-color: white; border: white;\">model =\r\n\r\n\u00a0 Python NeuralNetwork with properties:\r\n\r\n\u00a0\u00a0\u00a0 training: 1\r\n\r\n\u00a0\u00a0\u00a0 NeuralNetwork(\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 (flatten): Flatten(start_dim=1, end_dim=-1)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 (linear_relu_stack): Sequential(\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 (0): Linear(in_features=784, out_features=128, bias=True)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 (1): ReLU()\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 (2): Linear(in_features=128, out_features=10, bias=True)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 )\r\n\r\n\u00a0\u00a0\u00a0 )<\/pre>\r\n&nbsp;\r\n<h6><\/h6>\r\n<div style=\"position: relative; background: #f9fafb; border: 1px solid #d1d5db; border-radius: 6px; padding: 1rem; font-family: Consolas,monospace; color: #111827;\"><button style=\"position: absolute; top: 8px; right: 8px; background: #e5e7eb; color: #111827; border: 1px solid #d1d5db; border-radius: 4px; padding: 4px 8px; font-size: 12px; cursor: pointer;\">\r\nCopy\r\n<\/button>\r\n<pre id=\"matlab-snippet\" style=\"margin: 0; padding: 0; border: none; background: none; color: inherit; white-space: pre; line-height: 1.4;\"><span class=\"comment\">% Clear temporary variables from workspace and from Python<\/span>\r\nclear pycode;<\/pre>\r\n<\/div>\r\n<h6><\/h6>\r\n<div style=\"position: relative; background: #f9fafb; border: 1px solid #d1d5db; border-radius: 6px; padding: 1rem; font-family: Consolas,monospace; color: #111827;\"><button style=\"position: absolute; top: 8px; right: 8px; background: #e5e7eb; color: #111827; border: 1px solid #d1d5db; border-radius: 4px; padding: 4px 8px; font-size: 12px; cursor: pointer;\">\r\nCopy\r\n<\/button>\r\n<pre id=\"matlab-snippet\" style=\"margin: 0; padding: 0; border: none; background: none; color: inherit; white-space: pre; line-height: 1.4;\">test_data = pyrunfile('fashion_dataset.py','test_data')<\/pre>\r\n<\/div>\r\n<h6><\/h6>\r\n<pre class=\"brush: python\" style=\"background-color: white; border: white;\">test_data =\r\n\r\n\u00a0 Python FashionMNIST with properties:\r\n\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 class_to_idx: [1\u00d71 py.dict]\r\n\u00a0\u00a0\u00a0 processed_folder: [1\u00d727 py.str]\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 raw_folder: [1\u00d721 py.str]\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 test_data: [1\u00d71 py.torch.Tensor]\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 test_labels: [1\u00d71 py.torch.Tensor]\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 train_data: [1\u00d71 py.torch.Tensor]\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 train_labels: [1\u00d71 py.torch.Tensor]\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 transform: [1\u00d71 py.torchvision.transforms.transforms.ToTensor]\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 data: [1\u00d71 py.torch.Tensor]\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 targets: [1\u00d71 py.torch.Tensor]\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 train: 0\r\n\u00a0\u00a0\u00a0 target_transform: [1\u00d71 py.NoneType]\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 transforms: [1\u00d71 py.torchvision.datasets.vision.StandardTransform]\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 root: [1\u00d74 py.str]\r\n\r\n\r\n\u00a0\u00a0\u00a0 Dataset FashionMNIST\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Number of datapoints: 10000\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Root location: data\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Split: Test\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 StandardTransform\r\n\u00a0\u00a0\u00a0 Transform: ToTensor()\r\n\r\n<\/pre>\r\n<h6><\/h6>\r\n<div style=\"position: relative; background: #f9fafb; border: 1px solid #d1d5db; border-radius: 6px; padding: 1rem; font-family: Consolas,monospace; color: #111827;\"><button style=\"position: absolute; top: 8px; right: 8px; background: #e5e7eb; color: #111827; border: 1px solid #d1d5db; border-radius: 4px; padding: 4px 8px; font-size: 12px; cursor: pointer;\">\r\nCopy\r\n<\/button>\r\n<pre id=\"matlab-snippet\" style=\"margin: 0; padding: 0; border: none; background: none; color: inherit; white-space: pre; line-height: 1.4;\">x = pyrun('x = test_data[0][0]','x',test_data=test_data)<\/pre>\r\n<\/div>\r\n<h6><\/h6>\r\n<pre class=\"brush: python\" style=\"background-color: white; border: white;\">x =\r\n\r\n\u00a0 Python Tensor with properties:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ...\r\n\r\n\u00a0\u00a0\u00a0 tensor([[[0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000,\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000,\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000,\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0.0000, 0.0000, 0.0000, 0.0000], ...\r\n\r\n\r\n\r\n<\/pre>\r\n<h6><\/h6>\r\n<div style=\"position: relative; background: #f9fafb; border: 1px solid #d1d5db; border-radius: 6px; padding: 1rem; font-family: Consolas,monospace; color: #111827;\"><button style=\"position: absolute; top: 8px; right: 8px; background: #e5e7eb; color: #111827; border: 1px solid #d1d5db; border-radius: 4px; padding: 4px 8px; font-size: 12px; cursor: pointer;\">\r\nCopy\r\n<\/button>\r\n<pre id=\"matlab-snippet\" style=\"margin: 0; padding: 0; border: none; background: none; color: inherit; white-space: pre; line-height: 1.4;\">clothes = [\r\n\u00a0\u00a0\u00a0 \"T-shirt\/top\",...\r\n\u00a0\u00a0\u00a0 \"Trouser\",...\r\n\u00a0\u00a0\u00a0 \"Pullover\",...\r\n\u00a0\u00a0\u00a0 \"Dress\",...\r\n\u00a0\u00a0\u00a0 \"Coat\",...\r\n\u00a0\u00a0\u00a0 \"Sandal\",...\r\n\u00a0\u00a0\u00a0 \"Shirt\",...\r\n\u00a0\u00a0\u00a0 \"Sneaker\",...\r\n\u00a0\u00a0\u00a0 \"Bag\",...\r\n\u00a0\u00a0\u00a0 \"Ankle boot\",\r\n]<\/pre>\r\n<\/div>\r\n&nbsp;\r\n<pre class=\"brush: python\" style=\"background-color: white; border: white;\">clothes = <em>1\u00d710 string<\/em>\r\n\r\n\"T-shirt\/top\"\"Trouser\"\u00a0\u00a0\u00a0 \"Pullover\"\u00a0\u00a0 \"Dress\"\u00a0\u00a0\u00a0\u00a0\u00a0 \"Coat\"\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \"Sandal\"\u00a0\u00a0 \u22ef\r\n\r\n<\/pre>\r\n<h6><\/h6>\r\n<div style=\"position: relative; background: #f9fafb; border: 1px solid #d1d5db; border-radius: 6px; padding: 1rem; font-family: Consolas,monospace; color: #111827;\"><button style=\"position: absolute; top: 8px; right: 8px; background: #e5e7eb; color: #111827; border: 1px solid #d1d5db; border-radius: 4px; padding: 4px 8px; font-size: 12px; cursor: pointer;\">\r\nCopy\r\n<\/button>\r\n<pre id=\"matlab-snippet\" style=\"margin: 0; padding: 0; border: none; background: none; color: inherit; white-space: pre; line-height: 1.4;\">pred = model(x)<\/pre>\r\n<\/div>\r\n<h6><\/h6>\r\n<pre class=\"brush: python\" style=\"background-color: white; border: white;\">pred =\r\n\r\n\u00a0 Python Tensor with properties:\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ...\r\n\r\n\u00a0\u00a0\u00a0 tensor([[ -8.7973,\u00a0 -9.9736, -10.1721, -11.8425,\u00a0 -9.1262,\u00a0 -2.4357,\u00a0 -9.7069,\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0.0156,\u00a0 -6.0885,\u00a0\u00a0 4.0667]], grad_fn=&lt;AddmmBackward0&gt;)<\/pre>\r\n<h6><\/h6>\r\n<div style=\"position: relative; background: #f9fafb; border: 1px solid #d1d5db; border-radius: 6px; padding: 1rem; font-family: Consolas,monospace; color: #111827;\"><button style=\"position: absolute; top: 8px; right: 8px; background: #e5e7eb; color: #111827; border: 1px solid #d1d5db; border-radius: 4px; padding: 4px 8px; font-size: 12px; cursor: pointer;\">\r\nCopy\r\n<\/button>\r\n<pre id=\"matlab-snippet\" style=\"margin: 0; padding: 0; border: none; background: none; color: inherit; white-space: pre; line-height: 1.4;\">i = py.int(argmax(pred))<\/pre>\r\n<\/div>\r\n<h6><\/h6>\r\n<pre class=\"brush: python\" style=\"background-color: white; border: white;\">i =\r\n\r\n\u00a0 Python int with properties:\r\n\r\n\r\n\u00a0\u00a0\u00a0 denominator: [1\u00d71 py.int]\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 imag: [1\u00d71 py.int]\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 numerator: [1\u00d71 py.int]\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 real: [1\u00d71 py.int]\r\n\r\n\r\n\u00a0\u00a0\u00a0 9<\/pre>\r\n<h6><\/h6>\r\n<div style=\"position: relative; background: #f9fafb; border: 1px solid #d1d5db; border-radius: 6px; padding: 1rem; font-family: Consolas,monospace; color: #111827;\"><button style=\"position: absolute; top: 8px; right: 8px; background: #e5e7eb; color: #111827; border: 1px solid #d1d5db; border-radius: 4px; padding: 4px 8px; font-size: 12px; cursor: pointer;\">\r\nCopy\r\n<\/button>\r\n<pre id=\"matlab-snippet\" style=\"margin: 0; padding: 0; border: none; background: none; color: inherit; white-space: pre; line-height: 1.4;\">pred_label = clothes(i+1)<\/pre>\r\n<\/div>\r\n<h6><\/h6>\r\n<pre class=\"brush: python\" style=\"background-color: white; border: white;\">pred_label = \"Ankle boot\"<\/pre>\r\n<h6><\/h6>\r\n<div style=\"position: relative; background: #f9fafb; border: 1px solid #d1d5db; border-radius: 6px; padding: 1rem; font-family: Consolas,monospace; color: #111827;\"><button style=\"position: absolute; top: 8px; right: 8px; background: #e5e7eb; color: #111827; border: 1px solid #d1d5db; border-radius: 4px; padding: 4px 8px; font-size: 12px; cursor: pointer;\">\r\nCopy\r\n<\/button>\r\n<pre id=\"matlab-snippet\" style=\"margin: 0; padding: 0; border: none; background: none; color: inherit; white-space: pre; line-height: 1.4;\">X_m = double(x.numpy());\r\n\r\nsize(X_m)\r\n<\/pre>\r\n<\/div>\r\n<h6><\/h6>\r\n<pre class=\"brush: python\" style=\"background-color: white; border: white;\">ans = <em>1\u00d73<\/em>\r\n\r\n\u00a0\u00a0\u00a0\u00a0 1\u00a0\u00a0\u00a0 28\u00a0\u00a0\u00a0 28<\/pre>\r\n<h6><\/h6>\r\n<div style=\"position: relative; background: #f9fafb; border: 1px solid #d1d5db; border-radius: 6px; padding: 1rem; font-family: Consolas,monospace; color: #111827;\"><button style=\"position: absolute; top: 8px; right: 8px; background: #e5e7eb; color: #111827; border: 1px solid #d1d5db; border-radius: 4px; padding: 4px 8px; font-size: 12px; cursor: pointer;\">\r\nCopy\r\n<\/button>\r\n<pre id=\"matlab-snippet\" style=\"margin: 0; padding: 0; border: none; background: none; color: inherit; white-space: pre; line-height: 1.4;\">imshow(squeeze(X_m(1, :, :)))\r\n\r\ntitle(pred_label)<\/pre>\r\n<\/div>\r\n<h6><\/h6>\r\n<img decoding=\"async\" loading=\"lazy\" class=\"wp-image-18476 size-medium alignnone\" src=\"https:\/\/blogs.mathworks.com\/deep-learning\/files\/2025\/09\/ankle-boot-300x187.png\" alt=\"\" width=\"300\" height=\"187\" \/>\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n<h6><\/h6>\r\nThis \u201chello world\u201d example of deep learning shows that you can call a PyTorch model from MATLAB Online.\r\n<h6><\/h6>\r\n&nbsp;\r\n<h2>Wrap-up<\/h2>\r\n<ul>\r\n \t<li>MATLAB Online + Python is not only possible\u2014it\u2019s practical. Start with <strong>pip <\/strong>for simplicity, switch to <strong>uv<\/strong> when speed and tighter management of your environments matter.<\/li>\r\n \t<li>Keep your virtual environments under <span style=\"font-family: Consolas, Monaco, monospace; font-size: inherit;\">$HOME<\/span>, not <span style=\"font-family: Consolas, Monaco, monospace; font-size: inherit;\">\/MATLAB Drive<\/span>, just for the duration of your session.<\/li>\r\n \t<li>Use <span style=\"font-family: Consolas, Monaco, monospace; font-size: inherit;\">setenv<\/span> for session-persistent <span style=\"font-family: Consolas, Monaco, monospace; font-size: inherit;\">PATH<\/span> changes inside MATLAB.<\/li>\r\n<\/ul>\r\n&nbsp;\r\n\r\nThat\u2019s it for today, thanks for following along \ud83d\udce6\r\n\r\n&nbsp;\r\n\r\n<script>\r\nfunction copyCode(btn) {\r\n  const code = btn.parentElement.querySelector(\"pre\").textContent.trim();\r\n  if (navigator.clipboard) {\r\n    navigator.clipboard.writeText(code).then(() => {\r\n      btn.textContent = \"Copied!\";\r\n      setTimeout(() => btn.textContent = \"Copy\", 1500);\r\n    }).catch(() => fallbackCopy(code, btn));\r\n  } else {\r\n    fallbackCopy(code, btn);\r\n  }\r\n}\r\nfunction fallbackCopy(text, btn) {\r\n  const ta = document.createElement(\"textarea\");\r\n  ta.value = text;\r\n  document.body.appendChild(ta);\r\n  ta.select();\r\n  document.execCommand(\"copy\");\r\n  document.body.removeChild(ta);\r\n  btn.textContent = \"Copied!\";\r\n  setTimeout(() => btn.textContent = \"Copy\", 1500);\r\n}\r\n<\/script>","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img src=\"https:\/\/blogs.mathworks.com\/deep-learning\/files\/2025\/09\/python-packages-matlab-online-2.png\" class=\"img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image\" alt=\"\" decoding=\"async\" loading=\"lazy\" \/><\/div><p>MATLAB Online is a very convenient platform for working with MATLAB and Python\u00ae together. And I am not only saying this because I was part of the MATLAB Online product team until fairly recently (ok,... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/deep-learning\/2025\/09\/17\/pip-uv-in-matlab-online\/\">read more >><\/a><\/p>","protected":false},"author":230,"featured_media":18515,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[32,39,45],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/posts\/18455"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/users\/230"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/comments?post=18455"}],"version-history":[{"count":17,"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/posts\/18455\/revisions"}],"predecessor-version":[{"id":18713,"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/posts\/18455\/revisions\/18713"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/media\/18515"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/media?parent=18455"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/categories?post=18455"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/tags?post=18455"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}