Closed lepmik closed 5 years ago
Which version of Python are you using?
As far as I can see, pathlib
is part of the standard library since Python 3.4 and should always be present. It could be missing if you are using Python 2.7, but MacPorts serves also Python 3 packages. It also seems like pathlib2
is not an official module, but a package that tracks the official module, since the original pathlib
package that tracked the original module is no longer maintained: https://pypi.org/project/pathlib/ https://pypi.org/project/pathlib2/
I would prefer if we try import pathlib
and then import pathlib2 as pathlib
with a comment to remove this try/except block when people have finally left Python 2 behind. It seems better than having us depend on the pathlib2
package, which one day might also be outdated.
pathlib2 is the only available pathlib in macports, to facilitate both we could try to import pathlib2 if importing pathlib fails. or we could change dependency to pathlib2 as it is both in pypi and anaconda.