-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New version of installing PyTorch using pip #7337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
Fixed missing quote in metadata
Corrected capitalization of Pytorch.
Changed my name to Smith so it will accept this.
disabled Vale coverage of some metadata
trying to fix metadata
✅ Deploy Preview for nostalgic-ptolemy-b01ab8 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for nostalgic-ptolemy-b01ab8 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for nostalgic-ptolemy-b01ab8 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Added missing backticks for format adherence.
Fixed numbering.
Updated installation instructions for PyTorch on Ubuntu 22.04, including system requirements, package installation commands, and virtual environment setup.
| license: "[CC BY-ND 4.0](https://creativecommons.org/licenses/by-nd/4.0/)" | ||
| --- | ||
|
|
||
| This guide shows examples for installing PyTorch (a Python framework) on an Ubuntu 22.04 compute instance and provides support for math-intensive applications that run on GPU and CPU. These instances are both available with Akamai Technologies. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| This guide shows examples for installing PyTorch (a Python framework) on an Ubuntu 22.04 compute instance and provides support for math-intensive applications that run on GPU and CPU. These instances are both available with Akamai Technologies. | |
| This guide shows how to install PyTorch on an Ubuntu 22.04 instance. PyTorch supports math-intensive workloads on both GPU and CPU. These compute options are available with Akamai Technologies. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the goal of tightening the intro, but I’d prefer to retain a bit more context here. “Shows examples” reflects that we’re offering a primary method (pip) while also linking out to Conda as an alternative—per our approach of referencing existing material rather than duplicating it. I’d also like to keep “(a Python framework)” for clarity, especially for readers newer to PyTorch. My aim is to support a range of developer familiarity levels while staying within Linode’s editorial tone.
Happy to revisit if needed, but I’d like to preserve this slightly more explanatory phrasing for now.
|
|
||
| ## What is PyTorch? | ||
|
|
||
| This is an open-source machine learning framework that enables fast, flexible experimentation and production deployment. Whether you want to build neural networks or fine-tune pre-trained models, PyTorch offers intuitive APIs and dynamic computation graphs that make it ideal for research and real-world applications. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| This is an open-source machine learning framework that enables fast, flexible experimentation and production deployment. Whether you want to build neural networks or fine-tune pre-trained models, PyTorch offers intuitive APIs and dynamic computation graphs that make it ideal for research and real-world applications. | |
| PyTorch is an open-source machine learning framework that enables fast, flexible experimentation and production deployment. Whether you want to build neural networks or fine-tune pre-trained models, PyTorch offers intuitive APIs and dynamic computation graphs that make it ideal for research and real-world applications. |
| ## Before You Begin | ||
|
|
||
| Our guide assumes you're working on a Linux-based compute instance with sudo access. You're going to install PyTorch in a Python environment--either system-wide or within a virtualenv (virtual environment is recommended). | ||
|
|
||
| ### Prerequisites | ||
|
|
||
| To install and run PyTorch comfortably, your system should have: | ||
|
|
||
| - **OS**: Ubuntu 22.04 or higher | ||
| - **Python**: 3.8 or higher | ||
| - **Pip**: Latest version recommended | ||
| - **Optional**: CUDA 11.8+ for GPU acceleration | ||
| - A working internet connection | ||
| - Clean Python environment (e.g., virtualenv or conda) | ||
| - At least **4 GB RAM** (8 GB+ preferred for training) | ||
| - No conflicting Python packages | ||
| - At least 3 - 5 GB of free disk space, depending on your python version, virtual environment setup, and additional packages. If working on a minimal or resource-constrained system, consider checking available disk space with: | ||
|
|
||
| ```command | ||
| df -h | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before You Begin
-
This guide assumes that you have access to a server or workstation running Ubuntu 22.04. To provision a Linode running Ubuntu 22.04, follow our Getting Started guide.
-
This guide uses
sudowherever possible. Complete the sections of our Setting Up and Securing a Compute Instance to create a standard user account, harden SSH access, and remove unnecessary network services. -
Install Python 3 .For the best results, use a Linode GPU instance with sufficient memory and storage to accomplish your task. Up to 96GB of memory and 7TB of storage are available.
Optimizing a task may also require using external data sources. If using external data sources and data sets, like Linode Object Storage, you should prepare them ahead of setting up your PyTorch GPU instance.
- Create a new Python environment
This approach ensures we give users complete information about what they need and where to find it if they don’t already have it. It also strengthens our SEO performance through helpful internal links.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestions. I understand the intent to align more closely with the Linode Formatting Guide, and I appreciate the attention to structure. I’ve been following a slightly different editorial approach across the content I’ve authored—based on my understanding of Andy’s preferences and the tone he’s asked me to bring to recent assignments.
Since he hasn’t flagged this structure or style as problematic, I’d prefer to hold off on major rewrites unless we receive specific direction to do so. My goal is to support consistency across the guides I’ve contributed while remaining open to adjustments if needed.
Happy to revisit if there’s a broader editorial shift underway, but for now I’d like to preserve this framing.
| df -h | ||
| ``` | ||
|
|
||
| ## Installation Steps |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion. I understand the desire for consistency, but I haven’t found a rule in the Linode Writer’s Formatting Guide that mandates gerunds for all headings. “Installation Steps” is a noun phrase that aligns with other accepted patterns in Linode docs, and I’d prefer to retain it unless we receive specific guidance to revise. Happy to revisit if needed.
| 1. Update your system | ||
|
|
||
| Once you have taken care of prerequisites, run: | ||
|
|
||
| ```command | ||
| sudo apt update && sudo apt upgrade | ||
| ``` | ||
|
|
||
| After running these commands, the system prompts you for confirmation [Y/n] before upgrading to ensure you are aware of resource usage and system changes before continuing. Choose "n" to stop and remedy this situation if you don't have the required resources. | ||
|
|
||
| {{< note >}} | ||
| After confirming the upgrade, you may be prompted to restart services or resolve config file changes. These are expected so carefully read and follow the contributor-safe defaults when available. | ||
| {{< /note >}} | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 1. Update your system | |
| Once you have taken care of prerequisites, run: | |
| ```command | |
| sudo apt update && sudo apt upgrade | |
| ``` | |
| After running these commands, the system prompts you for confirmation [Y/n] before upgrading to ensure you are aware of resource usage and system changes before continuing. Choose "n" to stop and remedy this situation if you don't have the required resources. | |
| {{< note >}} | |
| After confirming the upgrade, you may be prompted to restart services or resolve config file changes. These are expected so carefully read and follow the contributor-safe defaults when available. | |
| {{< /note >}} | |
| 1. Update your system | |
| Once you have taken care of prerequisites, run: | |
| ```command | |
| sudo apt update && sudo apt upgrade |
After running these commands, the system prompts you for confirmation [Y/n] before upgrading to ensure you are aware of resource usage and system changes before continuing. Choose "n" to stop and remedy this situation if you don't have the required resources.
{{< note >}}
After confirming the upgrade, you may be prompted to restart services or resolve config file changes. These are expected so carefully read and follow the contributor-safe defaults when available.
{{< /note >}}
-
Update your system.
sudo apt update && sudo apt upgradeAfter running these commands, the system prompts you for confirmation [Y/n] before upgrading to ensure you are aware of resource usage and system changes before continuing. Choose "n" to stop and remedy this situation if you don't have the required resources.
{{< note >}}
After confirming the upgrade, you may be prompted to restart services or resolve config file changes. These are expected so carefully read and follow the contributor-safe defaults when available.
{{< /note >}}
This formatting ensures that the notes and the additional information related to step 1 remain under step 1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a generic review command applicable across the guide.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’ll update the formatting to align with how similar steps are structured in existing Linode guides like the old Vaultwarden install doc. This keeps related content visually grouped under each step and supports consistency across the rendered output.
|
|
||
| 2. Services restart | ||
|
|
||
| Next you will be prompted to select which services to restart. You can accept the defaults and select any others you know are needed. If you are not sure, skip restarts by selecting Cancel, but it may delay updates taking effect. To navigate inside the Restart Services box: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use different format to distinguish the verbs in the output or on the screen for example: Cancel or Cancel. Restart Services page or Restart Services.
For more information see: https://developers.google.com/style/ui-elements or https://learn.microsoft.com/en-us/style-guide/procedures-instructions/describing-interactions-with-ui
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion. I appreciate it and the intent to distinguish UI verbs and labels. Currently, the Linode Writer's Guide doesn't require this formatting, and most published guides us plain text for UI elements unless clarity demands emphasis. If we receive new direction to adopt external standards, I'll be happy to change those when needed.
| sudo systemctl restart samba | ||
| sudo systemctl restart apache2 | ||
| ``` | ||
| This ensures upgraded packages are used without requiring a full reboot. However, if the installer triggers a service restart (e.g., `systemd`, `udev`, or networking), contributors should: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generic comments applicable across the guide:
Please follow the writing guidelines. (e.g.,)
https://developers.google.com/style/abbreviations or https://learn.microsoft.com/en-us/style-guide/word-choice/use-us-spelling-avoid-non-english-words
| python3 -m venv pytorch-env | ||
| ``` | ||
|
|
||
| Then do: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is a new step then why not number it as 5. If it is a sub step then should it not be
4
a.
b.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's an optional step not a new one but is a step within the context of the section if they choose to do so. Sub numbering might be confusing unless there is specific guidance that applies, I would prefer to leave it as is.
| source pytorch-env/bin/activate | ||
| ``` | ||
|
|
||
| To activate the virtual environment. If you do not see activate, then install the missing package: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If these are optional then may be it should be unordered list : https://www.linode.com/docs/guides/linode-writers-formatting-guide/#unordered-lists
|
|
||
| Then follow the steps above to create the virtual environment and activate it. Then you will see the `(pytorch-env)` in your prompt. | ||
|
|
||
| To keep your PyTorch install separate from system-wide Python packages and: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it unordered list?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I agree, it is an unordered list and I will fix this, my bad.

Created instructions for installing Python3 and pip3 and creating a virtual environment to install PyTorch in.
This PR refines the PyTorch installation for clarity, contributor safety, and legacy awareness. Includes pip-based workflows, uninstall instructions, troubleshooting entry point, and metadata cleanup.
Questions for reviewers are all commands and package versions current and compatible with Ubuntu 22.04?
Could any steps benefit from added context or troubleshooting tips?
Does this guide align with other install docs in tone and structure?