Skip to main content

Install PyTorch distributions from the latest wheels.

Project description

Note

This project is deprecated and will see no further development. It is superseded by light-the-torch .

Original README below.

Disclaimer

Neither this project (pytorch_wheel_installer) nor its author (Philip Meier) are affiliated with PyTorch in any way. PyTorch and any related marks are trademarks of Facebook, Inc.

pytorch_wheel_installer

Commandline utility and tox -plugin to install PyTorch distributions from the latest wheels. The computation backend (CPU, CUDA), the language version, and the platform are detected automatically but can be overwritten manually.

package

License Project Status: WIP

code

black mypy Lint status via GitHub Actions

tests

Test status via GitHub Actions Test coverage via codecov.io

Installation

The latest stable version can be installed with

pip install pytorch_wheel_installer

The latest potentially unstable version can be installed with

pip install git+https://github.com/pmeier/pytorch_wheel_installer

Usage

CLI

The CLI can be invoked by pytorch_wheel_installer or its shorthand pwi.

$ pwi --help
usage: pwi [-h] [-v] [-d DISTRIBUTION] [-b BACKEND] [-p PLATFORM]
           [-l LANGUAGE] [-ni] [-ic INSTALL_CMD]

Install PyTorch from the latest wheels.

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         Show version and exit.
  -d DISTRIBUTION, --distribution DISTRIBUTION
                        PyTorch distribution e.g. 'torch', 'torchvision'.
                        Multiple distributions can be given as a comma-
                        separated list. Defaults to 'torch,torchvision'.
  -b BACKEND, --backend BACKEND
                        Computation backend e.g. 'cpu' or 'cu102'. If not
                        given the backend is automatically detected from the
                        available hardware preferring CUDA over CPU.
  -p PLATFORM, --platform PLATFORM
                        Platform e.g. 'linux', 'windows', 'macos', or 'any'.
                        Defaults to the platform that is used to run this.
  -l LANGUAGE, --language LANGUAGE
                        Language implementation and version tag e.g. 'py3',
                        'cp36'. Defaults to the language version used to run
                        this.
  -ni, --no-install     If given, the selected wheels are written to STDOUT
                        instead of installed.
  -ic INSTALL_CMD, --install-cmd INSTALL_CMD
                        Command that is used to install the wheels. Defaults
                        to 'pip install'

The --no-install option can be used to pipe or redirect the wheel links such as generating a requirements.txt file:

$ pwi --no-install > requirements.txt
$ cat requirements.txt
https://download.pytorch.org/whl/cu102/torch-1.5.1-cp36-cp36m-linux_x86_64.whl
https://download.pytorch.org/whl/cu102/torchvision-0.6.1-cp36-cp36m-linux_x86_64.whl

tox

$ tox --help
...
optional arguments:
...
  --pytorch-install                Install PyTorch from the latest wheels. (default:
                                   False)
  --pytorch-distribution DISTRIBUTION
                                   PyTorch distribution e.g. 'torch', 'torchvision'.
                                   Multiple distributions can be given as a
                                   comma-separated list. Defaults to
                                   'torch,torchvision'. (default: torch,torchvision)
  --pytorch-backend BACKEND        Computation backend e.g. 'cpu' or 'cu102'. If not
                                   given the backend is automatically detected from
                                   the available hardware preferring CUDA over CPU.
                                   (default: None)
  --pytorch-language LANGUAGE      Language implementation and version tag e.g.
                                   'py3', 'cp36'. Defaults to the language version
                                   used to run this. (default: None)
  --pytorch-platform PLATFORM      Platform e.g. 'linux', 'windows', 'macos', or
                                   'any'. Defaults to the platform that is used to
                                   run this. (default: None)
...
$ tox --help-ini
pytorch_install <bool>   default: False
Install PyTorch from the latest wheels.

pytorch_distribution <string> default: torch,torchvision
PyTorch distribution e.g. 'torch', 'torchvision'. Multiple distributions can be given
as a comma-separated list. Defaults to 'torch,torchvision'.

pytorch_backend <string> default: None
Computation backend e.g. 'cpu' or 'cu102'. If not given the backend is automatically
detected from the available hardware preferring CUDA over CPU.

pytorch_language <string> default: None
Language implementation and version tag e.g. 'py3', 'cp36'. Defaults to the language
version used to run this.

pytorch_platform <string> default: None
Platform e.g. 'linux', 'windows', 'macos', or 'any'. Defaults to the platform that is
used to run this.

If neither --pytorch-install nor pytorch_install = true is given, nothing is installed.

Python

To find the links to the wheels for a specific setup, the function find_links can be used from within Python:

from pytorch_wheel_installer import find_links

links = find_links(
    distributions=("torch", "torchvision"),
    backend="cpu",
    language="py36",
    platform="linux",
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytorch_wheel_installer-0.2.1.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

pytorch_wheel_installer-0.2.1-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file pytorch_wheel_installer-0.2.1.tar.gz.

File metadata

  • Download URL: pytorch_wheel_installer-0.2.1.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.12

File hashes

Hashes for pytorch_wheel_installer-0.2.1.tar.gz
Algorithm Hash digest
SHA256 51827a476ee149ce46ad8ab0773ee814c087384ba2585308ec1d7cbf9648ce40
MD5 969ec439ff148ad078ec281bc18cfdce
BLAKE2b-256 79db7f18d7678d4b8296c5540b611645b44a09c2815f11d010c99e078b85c281

See more details on using hashes here.

File details

Details for the file pytorch_wheel_installer-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: pytorch_wheel_installer-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.12

File hashes

Hashes for pytorch_wheel_installer-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 be4814c8b973e1bdc0e5cfb7d9dbdbe459872a3137e6b5fa086e924b172b2fcd
MD5 befda6b4892092cdf16002f14efaf048
BLAKE2b-256 c6c69120db517398c3a72ef177969892a22e9a786ab6af3fb8dfed0e869162c8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page