Skip to content

Commit

Permalink
Merge pull request #51 from minrk/ruamel-hint
Browse files Browse the repository at this point in the history
raise informative error when ruamel.yaml is missing due to ruamel_yaml
  • Loading branch information
yuvipanda committed Aug 27, 2020
2 parents 341f344 + 0487777 commit e76585d
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion jupyter_telemetry/eventlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,23 @@

import jsonschema
from pythonjsonlogger import jsonlogger
from ruamel.yaml import YAML
try:
from ruamel.yaml import YAML
except ImportError as e:
# check for known conda bug that prevents
# pip from installing ruamel.yaml dependency
try:
import ruamel_yaml # noqa
except ImportError:
# nope, regular import error; raise original
raise e
else:
# have conda fork ruamel_yaml, but not ruamel.yaml.
# this is a bug in the ruamel_yaml conda package
# mistakenly identifying itself as ruamel.yaml to pip.
# conda install the 'real' ruamel.yaml to fix
raise ImportError("Missing dependency ruamel.yaml. Try: `conda install ruamel.yaml`")

from traitlets import List
from traitlets.config import Configurable, Config

Expand Down

0 comments on commit e76585d

Please sign in to comment.