awwad / uptane

Uptane, security framework for automotive updates
https://uptane.github.io/
MIT License
10 stars 42 forks source link

Should `simplejson` be listed as a dependency? #36

Closed vladimir-v-diaz closed 7 years ago

vladimir-v-diaz commented 7 years ago

I was following the instructions for the primary client (https://github.com/awwad/uptane#window-4-the-primary-clients) and encountered the following exception:

>>> import demo.demo_primary as dp
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "demo/demo_primary.py", line 34, in <module>
    import canonicaljson
  File "/home/vlad/projects/vladforks/tmp/uptane/env/local/lib/python2.7/site-packages/canonicaljson.py", line 18, in <module>
    import simplejson as json
ImportError: No module named simplejson
vladimir-v-diaz commented 7 years ago

frozendict also appears to be a required dependency (after I manually installed simplejson).

>>> import demo.demo_primary as dp
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "demo/demo_primary.py", line 34, in <module>
    import canonicaljson
  File "/home/vlad/projects/vladforks/tmp/uptane/env/local/lib/python2.7/site-packages/canonicaljson.py", line 20, in <module>
    from frozendict import frozendict
ImportError: No module named frozendict

I can successfully run the primary client after installing simplejson and frozendict. Not sure if this is an issue with my pip / setuptools installation...

awwad commented 7 years ago

I'm not sure. It might be your environment.

I'm a bit surprised that the import simplejson directive isn't couched in a try/except with import json as the fallback. simplejson has been in the std lib as json for a long while now, and json is a perfectly suitable fallback. :P

Anyway, oddly, I've never run into either error nor have I manually installed frozendict or simplejson in my virtual environments (and I use new ones pretty regularly).

awwad commented 7 years ago

This issue was moved to uptane/uptane#27