Skip to content

Installation options

Tomi Belan edited this page Sep 21, 2018 · 1 revision

This page describes some alternative ways to install Votr's system requirements. See the README.md for the rest of the installation instructions.

Python 3.4+ and virtualenv

The easiest way to install Python is from your Linux distribution's package manager.

Example for Debian/Ubuntu: sudo apt install virtualenv

If you can't or don't want to install Python system-wide, or you want a newer version of Python than your distribution provides, you can try to compile Python yourself. The standard way is to download the Python source code and run ./configure --prefix=$HOME/.local && make && make install or similar. There are also a few utilities like pyenv or p which can do it for you and manage multiple versions, but they still work by building Python from source.

In either case, to compile Python you'll need a compiler and development files for the libraries used by Python. This is tricky because Python's ./configure script considers almost all libraries optional. It doesn't fail if a library is missing, it just silently omits that functionality, even though Votr (or Python itself) might need it later. So it's hard to determine which packages you need and hard to verify if you got it right. Just install Python from your package manager.

node.js 8+ and yarn

With node.js you have multiple options:

Package manager

(This is a way to install everything system-wide.)

The package manager will install node.js for all users on the system, and you will get automatic updates whenever the distro updates it (i.e. very often for rolling release distros and very rarely for point release distros).

Example for Debian/Ubuntu: sudo apt install nodejs

More distributions: https://nodejs.org/en/download/package-manager/

Warning: If you use Debian older than buster or Ubuntu older than 18.10, the default nodejs package is too old (< 8.0), and you should get an unofficial package from the above link.

After installing node.js, read the Yarn installation instructions.

nodeenv

(This is a way to install everything per-project in Votr's directory.)

nodeenv is a tool which can install node.js inside a Python virtualenv. You can use it to install node.js without root privileges, use the latest node.js if your distro is lagging behind, and isolate multiple projects from each other if they require different node.js versions. nodeenv downloads binaries so you don't need a compiler.

After you download Votr and create its venv directory, activate it: source venv/bin/activate
(This adds venv/bin to the current shell's $PATH. You must run it in every terminal where you develop Votr. Unlike venv/bin/pip, venv/bin/yarn won't work if you don't activate it.)

Install nodeenv and use it to install node.js: pip install nodeenv; nodeenv -p

Now you have venv/bin/node and venv/bin/npm. Install venv/bin/yarn with: npm install -g yarn

(The Yarn documentation doesn't recommend this method, but the install.sh script installs it in ~/.yarn and can't be changed to venv/bin. Compared to all the other code you're downloading and running from npm, this shouldn't be any riskier.)

Advanced note: if you ever need to update requirements.txt, remember to remove nodeenv from the output of pip freeze.

nvm

(This is a way to install everything per-user in your home directory.)

nvm is a tool which can install one or more node.js versions in ~/.nvm and switch between them. You can use it to install node.js without root privileges, use the latest node.js if your distro is lagging behind, and manually switch between versions if you have multiple projects that require different versions. nvm downloads binaries so you don't need a compiler.

Read how to install nvm.

After it's installed (remember you must restart your terminal), download the latest node.js with: nvm install node

After node is installed, use Yarn's install.sh script to install Yarn in ~/.yarn, so you can use it regardless of which node.js version is active nvm. Or use npm install -g yarn (see above), so every node.js version can have its own Yarn version.