Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Axelrod pip install in Colab fails due to prompt_toolkit #1379

Closed
jsafyan opened this issue Nov 23, 2020 · 3 comments · Fixed by #1407
Closed

Axelrod pip install in Colab fails due to prompt_toolkit #1379

jsafyan opened this issue Nov 23, 2020 · 3 comments · Fixed by #1407

Comments

@jsafyan
Copy link
Contributor

jsafyan commented Nov 23, 2020

It appears a version mismatch for prompt_toolkit causes problems for pip installing Axelrod in Colab.

!pip install -q axelrod

results in

ERROR: jupyter-console 5.2.0 has requirement prompt-toolkit<2.0.0,>=1.0.0, but you'll have prompt-toolkit 3.0.8 which is incompatible.
ERROR: ipython 5.5.0 has requirement prompt-toolkit<2.0.0,>=1.0.4, but you'll have prompt-toolkit 3.0.8 which is incompatible.

Please see a reproduction of this error in this notebook

@marcharper
Copy link
Member

Colab uses an old version of IPython. Here's the workaround for now.

First note we have another issue with the PyYAML version (needs to be >= 5.1 because we use FullLoader). So first run

!pip install --ignore-installed PyYAML

The latest dev version of Axelrod can be installed in Colab with this command

!pip install git+https://github.com/Axelrod-Python/Axelrod.git@dev

After running these commands, import axelrod works. However it puts Colab into an unhappy state where the kernel has to be "factory reset" to reload properly.

To fix, we need to do two things:

  • For prompt-toolkit we can make it an optional import / requirement or find another workaround
  • For PyYAML we just need to update requirements.txt or change FullLoader to Loader or SafeLoader. See here and here.

@drvinceknight
Copy link
Member

drvinceknight commented Nov 24, 2020

  • For prompt-toolkit we can make it an optional import / requirement or find another workaround

If I'm correct we only use prompt-toolkit for the Human player, making it optional with a clear message could be a way forward?

I'll open a PR for the pyyaml bump now PR to bump pyyaml: #1380

@marcharper
Copy link
Member

If I'm correct we only use prompt-toolkit for the Human player, making it optional with a clear message could be a way forward?

I think that's a good fix for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants