<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Weekly Workbench Tip:  Turbo-charge your Python package installation! in SAS Viya Workbench Discussion</title>
    <link>https://communities.sas.com/t5/SAS-Viya-Workbench-Discussion/Weekly-Workbench-Tip-Turbo-charge-your-Python-package/m-p/937709#M5</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Advantages offered by SAS Viya Workbench include&lt;/SPAN&gt;&lt;STRONG&gt;&amp;nbsp;fast availability of a compute environment, and support for multilingual analytics&amp;nbsp;&lt;/STRONG&gt;(Python or SAS, based on skills and preference)&lt;SPAN&gt;.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;When it comes to Python environments, however, users demand flexible and convenient package installation to aid rapid iteration and experimentation.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color="#993300"&gt;&lt;FONT color="#000000"&gt;The default method is to use the standard Python package installer (pip) to install packages.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;However, pip installs take a long time&amp;nbsp; and package installation becomes complex when there are many packages and dependencies involved.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#008000"&gt;This tip suggests the use of virtual Python environments to help isolate and manage your Python package installation.&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using this opportunity, &amp;nbsp;for informational purposes only, we also describe another Python installer utility called&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;uv. &amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;The uv package is written in Rust and claims to be 10x - 100x faster than traditional pip and pip-tools, through use of a global cache and better dependency resolution.&amp;nbsp; It follows a syntax very similar to pip, making it easy to adopt and use.&amp;nbsp; Check out its &lt;/SPAN&gt;&lt;A href="https://pypi.org/project/uv/" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;PyPi page&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt; for more details. &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;IMPORTANT&lt;STRONG&gt;:&amp;nbsp;&lt;/STRONG&gt;Use uv based on your own discretion. &amp;nbsp;The &lt;A href="https://go.documentation.sas.com/doc/en/workbenchcdc/v_001/explore/p1xkndg0wuxl3sn1ep3wj8tk5qkn.htm" target="_blank" rel="noopener"&gt;SAS Viya Workbench documentation&lt;/A&gt;&amp;nbsp;specifies &lt;STRONG&gt;pip install&lt;/STRONG&gt; as the standard approach to install packages. &amp;nbsp; This tip regarding uv is only meant as a suggestion and I recommend you first try it out on a local Python environment for experience.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H1&gt;&lt;STRONG&gt;Virtual Environment creation&lt;/STRONG&gt;&lt;/H1&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Virtual environments in Python allow you to create separate sub-environments within an existing Python environment. &amp;nbsp;Any additional packages you install in the virtual environment are not accessible by the base (main) Python environment. &amp;nbsp;This provides you, the Python user, &lt;FONT color="#008000"&gt;benefits such as isolation, &amp;nbsp;control over package dependencies, and rapid experimentation through different virtual environments.&lt;/FONT&gt; &amp;nbsp;As environment definitions can be persisted, you also have an option of discarding your work in case of issues, and reverting to the base Python environment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Creating a virtual environment in Workbench is easy and can be achieved through the following commands (for e.g., through a Terminal window on Workbench's Visual Studio Code application):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;# Create a virtual env - provide your desired name in place of new_env
python -m venv new_env

# Activate virtual env
. new_env/bin/activate&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;The 'uv' angle&lt;/STRONG&gt;: It's also possible to create virtual environments using uv. &amp;nbsp;Install uv, using pip, into your target environment just like any other Python package.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;Once that's done, you can create a virtual environment and activate the same.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;# Install uv and upgrade pip
pip install --upgrade pip uv

# Create virtual env using uv
uv venv new_uv_venv

# Activate virtual env
. new_uv_venv/bin/activate&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Note how the commands for creating a virtual environment using uv are similar to traditional Python commands, i.e. python -m venv &amp;lt;virtual_environment_name&amp;gt;.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Deactivation&lt;/STRONG&gt;: In order to revert to the base &amp;nbsp;Python environment, use the deactivate command to leave the virtual environment. &amp;nbsp;This applies for both virtual environments created through venv or uv.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;# Deactivate virtual env
deactivate

echo "deactivated system"

# OPTIONAL - Remove virtual env folder
rm -rf new_env&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H1&gt;Package installation&lt;/H1&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once you've activated a virtual environment, install packages &amp;nbsp;using the pip install command, either through a list of required packages, or a text file, conventionally named &lt;STRONG&gt;requirements.txt&lt;/STRONG&gt;, &amp;nbsp;containing a list of packages. &amp;nbsp; Pip is a powerful utility which also provides other operations. &amp;nbsp;The &lt;A href="https://pip.pypa.io/en/stable/index.html" target="_blank" rel="noopener"&gt;pip documentation&lt;/A&gt; is a useful reference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;# Install packages
pip install --upgrade -r requirements.txt&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt; The 'uv' angle:&lt;/STRONG&gt;&amp;nbsp; The uv command is as easy as the traditional pip command. &amp;nbsp;Just prepend the 'uv' command to a standard pip installation command, either specifying the packages as a list, or using a requirements.txt file.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;As shown in the following snippet.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;# Install packages from requirements.txt
uv pip install --upgrade -r requirements.txt&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P lang="en-US"&gt;Let's take a look at the effect.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;Taking an example where a minimal set of packages (for e.g., torch for machine learning, plus some additional helper packages) were specified in requirements.txt, the following animated gif shows how quickly uv downloads the same (faster than pip).&lt;/P&gt;
&lt;P lang="en-US"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P lang="en-US"&gt;&lt;div class="lia-vid-container video-embed-center"&gt;&lt;div id="lia-vid-6359657730112w1150h540r59" class="lia-video-brightcove-player-container"&gt;&lt;video-js data-video-id="6359657730112" data-account="6058004174001" data-player="default" data-embed="default" class="vjs-fluid" controls="" data-application-id="" style="width: 100%; height: 100%;"&gt;&lt;/video-js&gt;&lt;/div&gt;&lt;script src="https://players.brightcove.net/6058004174001/default_default/index.min.js"&gt;&lt;/script&gt;&lt;script&gt;(function() {  var wrapper = document.getElementById('lia-vid-6359657730112w1150h540r59');  var videoEl = wrapper ? wrapper.querySelector('video-js') : null;  if (videoEl) {     if (window.videojs) {       window.videojs(videoEl).ready(function() {         this.on('loadedmetadata', function() {           this.el().querySelectorAll('.vjs-load-progress div[data-start]').forEach(function(bar) {             bar.setAttribute('role', 'presentation');             bar.setAttribute('aria-hidden', 'true');           });         });       });     }  }})();&lt;/script&gt;&lt;a class="video-embed-link" href="https://communities.sas.com/t5/video/gallerypage/video-id/6359657730112"&gt;(view in My Videos)&lt;/a&gt;&lt;/div&gt;&lt;/P&gt;
&lt;H1 lang="en-US"&gt;&amp;nbsp;&lt;/H1&gt;
&lt;H1 lang="en-US"&gt;A quick impression about uv's speed improvements&lt;/H1&gt;
&lt;P lang="en-US"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P lang="en-US"&gt;To form a quick impression, we specified an example requirements.txt file consisting of the following common machine learning and analytics&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;packages:&lt;/P&gt;
&lt;P lang="en-US"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="shell"&gt;torch
swat
tensorflow
matplotlib
pandas
flask&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P lang="en-US"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P lang="en-US"&gt;Note that this is &lt;STRONG&gt;NOT&lt;/STRONG&gt; meant as an exact test, rather a rough assessment which was sufficient to form an initial impression.&lt;SPAN&gt;&amp;nbsp; We found that u&lt;/SPAN&gt;sing uv took, on an average,&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;FONT color="#008000"&gt;30% of the time compared to using traditional pip commands&lt;/FONT&gt;.&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P lang="en-US"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P lang="en-US"&gt;Note that the time to install can be affected by package composition and several other infrastructure-specific / local details. &amp;nbsp;uv provides its own claims and test details on its &lt;A href="https://pypi.org/project/uv/" target="_blank" rel="noopener"&gt;Python project page&lt;/A&gt;. &amp;nbsp;An assessment of uv is beyond the scope of this tip.&lt;/P&gt;
&lt;P lang="en-US"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P lang="en-US"&gt;If you are interested in a detailed script containing the commands provided above, feel free to access them from this &lt;A href="https://github.com/SundareshSankaran/uv-install-tests" target="_blank" rel="noopener"&gt;GitHub repository&lt;/A&gt;.&lt;/P&gt;
&lt;P lang="en-US"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P lang="en-US"&gt;Have fun trying out package installation and virtual environment methods on SAS Viya Workbench and share your experiences.&lt;/P&gt;</description>
    <pubDate>Wed, 31 Jul 2024 05:33:34 GMT</pubDate>
    <dc:creator>Sundaresh1</dc:creator>
    <dc:date>2024-07-31T05:33:34Z</dc:date>
    <item>
      <title>Weekly Workbench Tip:  Turbo-charge your Python package installation!</title>
      <link>https://communities.sas.com/t5/SAS-Viya-Workbench-Discussion/Weekly-Workbench-Tip-Turbo-charge-your-Python-package/m-p/937709#M5</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Advantages offered by SAS Viya Workbench include&lt;/SPAN&gt;&lt;STRONG&gt;&amp;nbsp;fast availability of a compute environment, and support for multilingual analytics&amp;nbsp;&lt;/STRONG&gt;(Python or SAS, based on skills and preference)&lt;SPAN&gt;.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;When it comes to Python environments, however, users demand flexible and convenient package installation to aid rapid iteration and experimentation.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color="#993300"&gt;&lt;FONT color="#000000"&gt;The default method is to use the standard Python package installer (pip) to install packages.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;However, pip installs take a long time&amp;nbsp; and package installation becomes complex when there are many packages and dependencies involved.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#008000"&gt;This tip suggests the use of virtual Python environments to help isolate and manage your Python package installation.&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using this opportunity, &amp;nbsp;for informational purposes only, we also describe another Python installer utility called&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;uv. &amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;The uv package is written in Rust and claims to be 10x - 100x faster than traditional pip and pip-tools, through use of a global cache and better dependency resolution.&amp;nbsp; It follows a syntax very similar to pip, making it easy to adopt and use.&amp;nbsp; Check out its &lt;/SPAN&gt;&lt;A href="https://pypi.org/project/uv/" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;PyPi page&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt; for more details. &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;IMPORTANT&lt;STRONG&gt;:&amp;nbsp;&lt;/STRONG&gt;Use uv based on your own discretion. &amp;nbsp;The &lt;A href="https://go.documentation.sas.com/doc/en/workbenchcdc/v_001/explore/p1xkndg0wuxl3sn1ep3wj8tk5qkn.htm" target="_blank" rel="noopener"&gt;SAS Viya Workbench documentation&lt;/A&gt;&amp;nbsp;specifies &lt;STRONG&gt;pip install&lt;/STRONG&gt; as the standard approach to install packages. &amp;nbsp; This tip regarding uv is only meant as a suggestion and I recommend you first try it out on a local Python environment for experience.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H1&gt;&lt;STRONG&gt;Virtual Environment creation&lt;/STRONG&gt;&lt;/H1&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Virtual environments in Python allow you to create separate sub-environments within an existing Python environment. &amp;nbsp;Any additional packages you install in the virtual environment are not accessible by the base (main) Python environment. &amp;nbsp;This provides you, the Python user, &lt;FONT color="#008000"&gt;benefits such as isolation, &amp;nbsp;control over package dependencies, and rapid experimentation through different virtual environments.&lt;/FONT&gt; &amp;nbsp;As environment definitions can be persisted, you also have an option of discarding your work in case of issues, and reverting to the base Python environment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Creating a virtual environment in Workbench is easy and can be achieved through the following commands (for e.g., through a Terminal window on Workbench's Visual Studio Code application):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;# Create a virtual env - provide your desired name in place of new_env
python -m venv new_env

# Activate virtual env
. new_env/bin/activate&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;The 'uv' angle&lt;/STRONG&gt;: It's also possible to create virtual environments using uv. &amp;nbsp;Install uv, using pip, into your target environment just like any other Python package.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;Once that's done, you can create a virtual environment and activate the same.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;# Install uv and upgrade pip
pip install --upgrade pip uv

# Create virtual env using uv
uv venv new_uv_venv

# Activate virtual env
. new_uv_venv/bin/activate&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Note how the commands for creating a virtual environment using uv are similar to traditional Python commands, i.e. python -m venv &amp;lt;virtual_environment_name&amp;gt;.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Deactivation&lt;/STRONG&gt;: In order to revert to the base &amp;nbsp;Python environment, use the deactivate command to leave the virtual environment. &amp;nbsp;This applies for both virtual environments created through venv or uv.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;# Deactivate virtual env
deactivate

echo "deactivated system"

# OPTIONAL - Remove virtual env folder
rm -rf new_env&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H1&gt;Package installation&lt;/H1&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once you've activated a virtual environment, install packages &amp;nbsp;using the pip install command, either through a list of required packages, or a text file, conventionally named &lt;STRONG&gt;requirements.txt&lt;/STRONG&gt;, &amp;nbsp;containing a list of packages. &amp;nbsp; Pip is a powerful utility which also provides other operations. &amp;nbsp;The &lt;A href="https://pip.pypa.io/en/stable/index.html" target="_blank" rel="noopener"&gt;pip documentation&lt;/A&gt; is a useful reference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;# Install packages
pip install --upgrade -r requirements.txt&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt; The 'uv' angle:&lt;/STRONG&gt;&amp;nbsp; The uv command is as easy as the traditional pip command. &amp;nbsp;Just prepend the 'uv' command to a standard pip installation command, either specifying the packages as a list, or using a requirements.txt file.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;As shown in the following snippet.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;# Install packages from requirements.txt
uv pip install --upgrade -r requirements.txt&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P lang="en-US"&gt;Let's take a look at the effect.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;Taking an example where a minimal set of packages (for e.g., torch for machine learning, plus some additional helper packages) were specified in requirements.txt, the following animated gif shows how quickly uv downloads the same (faster than pip).&lt;/P&gt;
&lt;P lang="en-US"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P lang="en-US"&gt;&lt;div class="lia-vid-container video-embed-center"&gt;&lt;div id="lia-vid-6359657730112w1150h540r655" class="lia-video-brightcove-player-container"&gt;&lt;video-js data-video-id="6359657730112" data-account="6058004174001" data-player="default" data-embed="default" class="vjs-fluid" controls="" data-application-id="" style="width: 100%; height: 100%;"&gt;&lt;/video-js&gt;&lt;/div&gt;&lt;script src="https://players.brightcove.net/6058004174001/default_default/index.min.js"&gt;&lt;/script&gt;&lt;script&gt;(function() {  var wrapper = document.getElementById('lia-vid-6359657730112w1150h540r655');  var videoEl = wrapper ? wrapper.querySelector('video-js') : null;  if (videoEl) {     if (window.videojs) {       window.videojs(videoEl).ready(function() {         this.on('loadedmetadata', function() {           this.el().querySelectorAll('.vjs-load-progress div[data-start]').forEach(function(bar) {             bar.setAttribute('role', 'presentation');             bar.setAttribute('aria-hidden', 'true');           });         });       });     }  }})();&lt;/script&gt;&lt;a class="video-embed-link" href="https://communities.sas.com/t5/video/gallerypage/video-id/6359657730112"&gt;(view in My Videos)&lt;/a&gt;&lt;/div&gt;&lt;/P&gt;
&lt;H1 lang="en-US"&gt;&amp;nbsp;&lt;/H1&gt;
&lt;H1 lang="en-US"&gt;A quick impression about uv's speed improvements&lt;/H1&gt;
&lt;P lang="en-US"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P lang="en-US"&gt;To form a quick impression, we specified an example requirements.txt file consisting of the following common machine learning and analytics&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;packages:&lt;/P&gt;
&lt;P lang="en-US"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="shell"&gt;torch
swat
tensorflow
matplotlib
pandas
flask&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P lang="en-US"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P lang="en-US"&gt;Note that this is &lt;STRONG&gt;NOT&lt;/STRONG&gt; meant as an exact test, rather a rough assessment which was sufficient to form an initial impression.&lt;SPAN&gt;&amp;nbsp; We found that u&lt;/SPAN&gt;sing uv took, on an average,&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;FONT color="#008000"&gt;30% of the time compared to using traditional pip commands&lt;/FONT&gt;.&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P lang="en-US"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P lang="en-US"&gt;Note that the time to install can be affected by package composition and several other infrastructure-specific / local details. &amp;nbsp;uv provides its own claims and test details on its &lt;A href="https://pypi.org/project/uv/" target="_blank" rel="noopener"&gt;Python project page&lt;/A&gt;. &amp;nbsp;An assessment of uv is beyond the scope of this tip.&lt;/P&gt;
&lt;P lang="en-US"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P lang="en-US"&gt;If you are interested in a detailed script containing the commands provided above, feel free to access them from this &lt;A href="https://github.com/SundareshSankaran/uv-install-tests" target="_blank" rel="noopener"&gt;GitHub repository&lt;/A&gt;.&lt;/P&gt;
&lt;P lang="en-US"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P lang="en-US"&gt;Have fun trying out package installation and virtual environment methods on SAS Viya Workbench and share your experiences.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2024 05:33:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya-Workbench-Discussion/Weekly-Workbench-Tip-Turbo-charge-your-Python-package/m-p/937709#M5</guid>
      <dc:creator>Sundaresh1</dc:creator>
      <dc:date>2024-07-31T05:33:34Z</dc:date>
    </item>
  </channel>
</rss>

