Navigation Menu

Skip to content
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

Spurious ImportWarnings on 3.6+ #1753

Closed
seberg opened this issue Jun 27, 2017 · 2 comments
Closed

Spurious ImportWarnings on 3.6+ #1753

seberg opened this issue Jun 27, 2017 · 2 comments
Milestone

Comments

@seberg
Copy link
Contributor

seberg commented Jun 27, 2017

Since I think it might be good to have an open issue for others to find. This is a resurrection of gh-1720.

Due to http://bugs.python.org/issue25791 on python 3.6 cython will cause warnings such as:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/antoine/multidict/multidict/__init__.py", line 24, in <module>
    __import__('_multidict', globals=globals(), level=1)
  File "multidict/_multidict.pyx", line 1, in init multidict._multidict (multidict/_multidict.c:14817)
    import sys
ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__

upon import. Getting rid of the warning appears to be not very easy, and probably requires gh-1715 to be implemented.

Workaround: If I understand correctly, if the cython module is compiled using cython -3 mode or uses from __future__ import absolute_import, most of these warnings should go away. Also python modules which are imported using the format of e.g. from . import _ufunc need to be converted to from scipy.special import _ufunc.

@scoder
Copy link
Contributor

scoder commented Jul 23, 2017

PEP 489 / #1715 is implemented in #1794

@seberg
Copy link
Contributor Author

seberg commented Aug 9, 2017

Cool, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants