-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ImportError: No module named pathlib #33
Comments
Note pathlib is not in stdlib for python < 3.4. You can install it from pypi but django-pyscss does not list pathlib as a dependency in its setup.py so it does not get installed on older python. |
django-pyscss 2.0.0 attempts to import Py3K stdlib module pathlib even on Python 2.x where it does not exist. File "/usr/local/lib/python2.7/dist-packages/django_pyscss/compiler.py", line 4, in <module> from pathlib import PurePath ImportError: No module named pathlib fusionbox/django-pyscss#33 Change-Id: I5df5baca3c5b79bfb173c4197421a7312da6ccd8
Project: openstack/requirements 8c0ff9178c367c5749100fdf00e3a61815c81baa Skip django-pyscss 2.0.0 django-pyscss 2.0.0 attempts to import Py3K stdlib module pathlib even on Python 2.x where it does not exist. File "/usr/local/lib/python2.7/dist-packages/django_pyscss/compiler.py", line 4, in <module> from pathlib import PurePath ImportError: No module named pathlib fusionbox/django-pyscss#33 Change-Id: I5df5baca3c5b79bfb173c4197421a7312da6ccd8
Project: openstack/requirements 8c0ff9178c367c5749100fdf00e3a61815c81baa Skip django-pyscss 2.0.0 django-pyscss 2.0.0 attempts to import Py3K stdlib module pathlib even on Python 2.x where it does not exist. File "/usr/local/lib/python2.7/dist-packages/django_pyscss/compiler.py", line 4, in <module> from pathlib import PurePath ImportError: No module named pathlib fusionbox/django-pyscss#33 Change-Id: I5df5baca3c5b79bfb173c4197421a7312da6ccd8
django-pyscss 2.0.0 attempts to import Py3K stdlib module pathlib even on Python 2.x where it does not exist. File "/usr/local/lib/python2.7/dist-packages/django_pyscss/compiler.py", line 4, in <module> from pathlib import PurePath ImportError: No module named pathlib fusionbox/django-pyscss#33 Change-Id: I5df5baca3c5b79bfb173c4197421a7312da6ccd8 (cherry picked from commit 8c0ff91)
Thanks for the report guys. Patch incoming. |
Hi, Thanks for bringing this up. Can I ask what version of pyScss you are Thanks again!
|
That is pretty strange since pyScss 1.3 has pathlib as a dependency. How did you install django-pyscss? django-pyscss should probably have it as a dependency no matter what since it does import it. |
I think I see what's going on. You guys are requiring pyScss<1.3: https://github.com/openstack/requirements/blob/8c0ff9178c367c5749100fdf00e3a61815c81baa/global-requirements.txt#L48. django-pyscss 2.0 requires pyScss>=1.3. (See the changelog for 2.0.0: https://pypi.python.org/pypi/django-pyscss/2.0.0#id1). You should stay on the 1.x series of django-pyscss if you really need pyScss 1.2, or allow pyScss 1.3 in your requirements. I can explicitly require pathlib and release 2.0.1 if it will help at all, but you're still going to have to change your pin. I'm going to close this since pathlib does get installed with the right version of pyScss, but feel free to comment if you want 2.0.1. |
Good find, I believe you are correct about our requirements mismatch. From what I can tell the backtrace originates from django-pyscss calling into pathlib directly so I do think adding a dependency on pathlib is something that should happen in django-pyscss, reguardless. Thanks! |
Agreed. If django-pyscss imports a module then it should ideally have the package providing that module listed as a direct dependency, not simply rely on it being provided as a transitive dependency (this is an insurance policy against a future update to pyScss dropping its use of pathlib). It's still odd that the versioned install_requires on pyScss>=1.3.4 didn't raise an error during installation. Anyway, thanks for spotting the mismatch! I'll get our requirements adjusted to accomodate that. |
As pointed out in fusionbox/django-pyscss#33 django-pyscss 2.0.0 install_requires pyScss>=1.3.4 which we currently cap at an incompatible pyScss<1.3 instead. Make it so we install an old enough django-pyscss to work with pyScss 1.2.x. Change-Id: I0cde6300ee2f590beebfa8c624c22f8eaed47172
Project: openstack/requirements 462791d319ca4368eb0fc2dacefc2d6bd51a0de6 Cap django-pyscss <2.0.0 As pointed out in fusionbox/django-pyscss#33 django-pyscss 2.0.0 install_requires pyScss>=1.3.4 which we currently cap at an incompatible pyScss<1.3 instead. Make it so we install an old enough django-pyscss to work with pyScss 1.2.x. Change-Id: I0cde6300ee2f590beebfa8c624c22f8eaed47172
Project: openstack/requirements 462791d319ca4368eb0fc2dacefc2d6bd51a0de6 Cap django-pyscss <2.0.0 As pointed out in fusionbox/django-pyscss#33 django-pyscss 2.0.0 install_requires pyScss>=1.3.4 which we currently cap at an incompatible pyScss<1.3 instead. Make it so we install an old enough django-pyscss to work with pyScss 1.2.x. Change-Id: I0cde6300ee2f590beebfa8c624c22f8eaed47172
As pointed out in fusionbox/django-pyscss#33 django-pyscss 2.0.0 install_requires pyScss>=1.3.4 which we currently cap at an incompatible pyScss<1.3 instead. Make it so we install an old enough django-pyscss to work with pyScss 1.2.x. Change-Id: I0cde6300ee2f590beebfa8c624c22f8eaed47172 (cherry picked from commit 7da0b68)
Fixed in the 2.0.1 release! Thanks for bringing this up! |
New in 2.0.0: import Py3K stdlib module pathlib even on Python 2.x where it does not exist
The text was updated successfully, but these errors were encountered: