question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing dependency when installing iPython on Python 2.7

See original GitHub issue

Thanks for this project, I encountered the following missing enum dependency when installing iPython on Python 2.7.

Here’s how I reproduced against poetry 0.10.0.

[tool.poetry]
name = "test"
version = "0.10.0"
description = ""
authors = []

[tool.poetry.dependencies]
python = "2.7"
ipython = "=5.6.0"

And once poetry install is done I tried both poetry run ipython and ipython without success.

Traceback (most recent call last):
  File "/home/simon/.virtualenvs/tmp-33607c6fbabd8b9/bin/ipython", line 7, in <module>
    from IPython import start_ipython
  File "/home/simon/.virtualenvs/tmp-33607c6fbabd8b9/local/lib/python2.7/site-packages/IPython/__init__.py", line 48, in <module>
    from .core.application import Application
  File "/home/simon/.virtualenvs/tmp-33607c6fbabd8b9/local/lib/python2.7/site-packages/IPython/core/application.py", line 23, in <module>
    from traitlets.config.application import Application, catch_config_error
  File "/home/simon/.virtualenvs/tmp-33607c6fbabd8b9/local/lib/python2.7/site-packages/traitlets/__init__.py", line 1, in <module>
    from .traitlets import *
  File "/home/simon/.virtualenvs/tmp-33607c6fbabd8b9/local/lib/python2.7/site-packages/traitlets/traitlets.py", line 49, in <module>
    import enum
ImportError: No module named enum

I assume this is caused by traitlets’s usage of extra_requires for Python 2.

https://github.com/ipython/traitlets/blob/ee1a829fafad654601dc851dc1d4ec79da090913/setup.py#L92

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
sdispatercommented, May 29, 2018

I think I know where the problem is coming from.

traitlets defines enum34 as a dependency twice:

enum34; python_version=="2.7"
enum34; python_version=="3.3"

Currently, poetry assumes that every dependency appear only once so in this case it picks up the last one: enum34; python_version=="3.3"

That’s why enum34 is not installed for Python 2.7.

I am not sure about the best approach here. While I think the proper way to declare the enum34 dependency should be enum34; python_version in "2.7 3.3", poetry should be able to handle this.

0reactions
sdispatercommented, Jun 4, 2018

@bertjwregeer I think #164 is the same issue so we can use it to track this

Read more comments on GitHub >

github_iconTop Results From Across the Web

Missing dependency when installing iPython on Python 2.7
Thanks for this project, I encountered the following missing enum dependency when installing iPython on Python 2.7.
Read more >
Installing IPython — IPython 8.7.0 documentation
Manual installation without dependencies is possible, but not recommended. The dependencies can be viewed with package manager commands, such as pip show  ......
Read more >
Installing IPython
This page contains simplified installation instructions that should work for most users. Our official documentation contains more detailed instructions for ...
Read more >
Installing ipython with python 2.7 - Stack Overflow
Trying to install ipython on Centos 6.8. It originally had Python 2.6 and I got Python 2.7 installed. Which python returns /usr/bin/python ...
Read more >
874133 – Missing Dependency (python-argparse)
Remove python-argparse 2. Try to install this version of ipython 3. Install succeeds 4. Run Ipython, complains about argparse missing.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found