kochkinaelena/branchLSTM

Local run instructions need updating to be clearer regarding python version and instructions for conda users

Opened this issue · 3 comments

Problems installing the requirements file from a conda distribution

I ran into some issues trying to run this on a local machine (Option 1 instructions). These were surrounding the requirements installation line pip install -r requirements.txt.

At first, I was receiving this error while trying to install the requirements:
CRITICAL:pip.index:Could not find a version that satisfies the requirement futures==3.2.0 (from versions: 0.2.python3, 0.1, 0.2, 1.0, 2.0, 2.1, 2.1.1, 2.1.2, 2.1.3, 2.1.4, 2.1.5, 2.1.6, 2.2.0, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.1.0, 3.1.1)

I found this issue on the topic but didn't find it very informative.

Through discussion with a colleague, I came to the realisation that virtualenv will tend to copy the root version of python into the environment, which was 3.6 through the Anaconda distribution for me. (The fact that virtualenv is installed as part of the distribution further complicates this matter.) So I bypassed virtualenv and used Anaconda to define an environment with 2.7:
conda create --name py27 python=2.7

Now trying to install the requirements this error was thrown:
Cannot uninstall 'certifi'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

This issue describes the problem with distutils not having enough metadata to be properly uninstalled and contains a workaround which is to down-grade pip to a version before this behaviour.
pip install --upgrade --force-reinstall pip==9.0.3

Hereafter, the requirements can be installed (with a deprecation warning). Just remember to re-upgrade your pip installation.

TL;DR

When running this repo on a local machine with a conda distribution, use the following set-up commands:

conda create --name py27 python=2.7
source activate py27
pip install --upgrade --force-reinstall pip==9.0.3
pip install -r requirements.txt
pip install --upgrade pip

@LouiseABowler It seems I can't to assign you to this!

FYI, we're going to run into this problem when making the repo Binder-ready as Binder uses pip. May need to use an environment.yml file pinning pip==9.0.3 before installing the dependencies.

FYI, we're going to run into this problem when making the repo Binder-ready as Binder uses pip. May need to use an environment.yml file pinning pip==9.0.3 before installing the dependencies.

Solved by moving numpy into dependencies section of environment.yml, i.e. numpy is installed before pip installs anything else.