Project Homepage / Setup Instructions (Unix)
This guide takes you from a fresh install of macOS / Linux to having the project running.
Note: The only Linux distribution official supported by this guide is Ubuntu.
The steps involved are:
This guide also explains:
Pyenv is the best tool for managing different Python versions and isolating dependencies.
-
Install Pyenv via appropriate means for your system
-
macOS: Follow the installation instructions in the Pyenv GitHub repository.
-
Linux: Use the automatic installer:
$ curl https://pyenv.run | bash
Read the automatic installer documentation
(Ubuntu) Tip: If
pyenv
fails because it couldn't findzlib
, run:sudo apt install zlib1g-dev
.
-
-
Configure your shell correctly:
macOS
- Add these lines to
.zshrc
:This can be done automatically by running:eval "$(pyenv init -)" eval "$(pyenv virtualenv-init -)"
echo 'eval "$(pyenv init -)"' >> ~/.zshrc echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.zshrc
Linux
-
Add these lines to the top of
.profile
:export PYENV_ROOT="$HOME/.pyenv" export PATH="$PYENV_ROOT/bin:$PATH" eval "$(pyenv init --path)"
-
Add these lines to
.bashrc
:eval "$(pyenv init -)" eval "$(pyenv virtualenv-init -)"
This can be done automatically by running:
echo 'eval "$(pyenv init -)"' >> ~/.bashrc echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc
-
Changes to
.profile
do not become active until you log out and log back in again (or restart), but can be applied to the current shell by runningsource ~/.profile
.-
Run
source ~/.profile
OR
-
Logout and login
OR
-
Restart
-
⚠️ Note: as of May 2021 there was discussion of further changes to the Pyenv environment setup, so runpyenv init
or read the environment configuration guide on the Pyenv Github for the most up to date information. - Add these lines to
-
Install Python build dependencies.
-
Install Python 3.6.7 using
pyenv install
with custom options:env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.6.7
In order for PyInstaller to work correctly, you need a complete Python installation, so you need to specify
--enable-shared
. In generalpyenv install 3.6.7
is sufficient to install a Python version viapyenv
.If you encounter any issues, check the Pyenv troubleshooting guide.
-
Use
pyenv
to create a virtual environment for the project.pyenv virtualenv 3.6.7 paper-ecg
-
Navigate to the project root directory (
.../paper-ecg/
) and assign the virtual environment you just created to the current directory (this automatically activates the environment).pyenv local paper-ecg
Now, whenever this folder is the working directory in terminal, this environment will be used. Test this out by running:
> python --version 3.6.7
Use pip install
to install required dependencies:
pip install --upgrade pip
pip install -r requirements.txt
⚠️ This may take several minutes
Navigate to the project root directory (.../paper-ecg/
) and run fbs run
to run the project.
(Ubuntu) Tip: If fbs run
fails because of qt.qpa.plugin: Could not load the Qt platform plugin "xcb" ...
try re-installing xcb
:
sudo apt install --reinstall libxcb-xinerama0
If you no longer want to have the paper-ecg
virtualenv, you can delete it:
pyenv virtualenv-delete paper-ecg
If you wish to remove Python 3.6.7:
pyenv uninstall 3.6.7
If you would like to completely uninstall Pyenv:
-
macOS:
brew uninstall pyenv
-
Linux:
rm -rf $HOME/.pyenv