Skip to content

Install nogil with pyenv on Linux

Sam Gross edited this page Jan 29, 2023 · 4 revisions

Prerequisites

You will need curl, git, and a number of other packages installed first. See pyenv's suggested build environemnt for instructions on how to install prerequisite packages for your Linux distribution.

Installation

Install pyenv and restart the current shell:

curl https://pyenv.run | bash
exec $SHELL

If you have an existing pyenv environment, run "update" to grab the latest definition files:

pyenv update

Now you can install the "nogil" version of Python:

pyenv install nogil-3.9.10-1

To use the "nogil" version as your default version run:

pyenv global nogil-3.9.10-1

Now you can just run "python":

$ python
Python 3.9.10 (main, Apr 29 2022, 13:11:21)
[nogil, GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>