Connexion: Missing pathlib dependency

Created on 22 Jul 2017  路  11Comments  路  Source: zalando/connexion

Description

This error occurs when building applications with connexion 1.1.12. The pathlib dependency appears to be missing.

File "/work/code/sfl2/lib.cxsupport/build/tox/test/lib/python2.7/site-packages/connexion/apps/abstract.py", line 3, in <module>
    import pathlib
ImportError: No module named pathlib

Additional info:

Output of the commands:

  • python --version
    Python 2.7.13

  • pip show connexion | grep "^Version\:"
    Version: 1.1.12

  • pip freeze | grep pathlib
    No output

Most helpful comment

@hjacobs instead of using code in setup.py, couldn't you just use environment markers to conditionally install the compat packages? Like this: 'pathlib; python_version < "3.4"'

See more info about these here: https://www.python.org/dev/peps/pep-0508/#environment-markers

All 11 comments

Same issue here. Use connexion 1.1.11 to workaround.

Hmm, I guess the "unversal wheel" introduced with #492 broke it.

Use Python 3 as a workaround... :speak_no_evil:

Longish term, Python 3 is a solution, but that wouldn't work for us immediately ...

Perhaps a breaking changes like this should be reserved for a major version change?

Something else to keep in mind is pathlib was only introduced in python3.4.

@ChamaraG actually the breaking change was introduced with the unversal wheel which was requested by a Python 2 user. See #492

I'm not sure how to proceed here, simple workaround would be to add pathlib dependency in your own requirements. Or we simply revert the "universal wheel".

Any suggestions?

@lorochka85 do you have any idea, as the author of the universal wheel PR?

@hjacobs instead of using code in setup.py, couldn't you just use environment markers to conditionally install the compat packages? Like this: 'pathlib; python_version < "3.4"'

See more info about these here: https://www.python.org/dev/peps/pep-0508/#environment-markers

@underyx ah, I did not know about this. Would you be willing to do a PR?

Seems like environment-markers is the way to go - nice find @underyx! I'm curious though, was it a problem with *.tar installations on py2.7 or was only introduced with universal wheel?

Would you be willing to do a PR?

Sure thing @hjacobs: https://github.com/zalando/connexion/issues/495

@underyx, @hjacobs thank you. v1.1.13 works for me on Python 2.7.

Was this page helpful?
0 / 5 - 0 ratings