[AstroPy] DeprecationWarning from ipython [metadata was set from the constructor]

Christoph Deil deil.christoph at googlemail.com
Thu Apr 14 07:53:42 EDT 2016


> On 14 Apr 2016, at 01:55, Duncan Macleod <duncan.macleod at ligo.org> wrote:
> 
> Hi all,
> 
> With macports installs of python/ipython/astropy, for a while now I've been getting a DeprecationWarning when import astropy, related to something in ipython. Here is the traceback when I escalate it to an error:
> 
> $ python -c "import warnings; warnings.simplefilter('error', DeprecationWarning); import astropy"
> Traceback (most recent call last):
>   File "<string>", line 1, in <module>
>   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/astropy/__init__.py", line 284, in <module>
>     from .logger import _init_log, _teardown_log
>   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/astropy/logger.py", line 17, in <module>
>     from .utils.console import color_print
>   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/astropy/utils/console.py", line 29, in <module>
>     from IPython import get_ipython
>   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/IPython/__init__.py", line 48, in <module>
>     from .core.application import Application
>   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/IPython/core/application.py", line 25, in <module>
>     from IPython.core.profiledir import ProfileDir, ProfileDirError
>   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/IPython/core/profiledir.py", line 29, in <module>
>     class ProfileDir(LoggingConfigurable):
>   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/IPython/core/profiledir.py", line 52, in ProfileDir
>     `profile` option.""",
>   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/traitlets/traitlets.py", line 421, in __init__
>     DeprecationWarning, stacklevel=stacklevel)
> DeprecationWarning: metadata {'config': True} was set from the constructor.  Metadata should be set using the .tag() method, e.g., Int().tag(key1='value1', key2='value2')
> 
> Can anyone offer a reason why this is, whether it has been reported before, or whether I can disable the astropy logger in some way (I just want astropy.units!)?
> 
> For the record, I have the following versions:
> 
> $ port installed | egrep " python27 | py27-ipython | py27-astropy " | grep "(active)"
>   py27-astropy @1.1.1_2 (active)
>   py27-ipython @4.1.2_0 (active)
>   python27 @2.7.11_2 (active)
> 
> 
> Thanks in advance
> Duncan
> -- 
> Duncan Macleod
> duncan.macleod at ligo.org <mailto:duncan.macleod at ligo.org>
> LIGO Data Grid systems development
> Louisiana State University
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> https://mail.scipy.org/mailman/listinfo/astropy


Hi Duncan,

I see the same issue with Python 2 and Macports.
(not with Python 3 though, that’s why I hadn’t noticed it)

Not sure what the cause or fix is.

Could you please file an issue in the Astropy tracker with the description you gave above?
https://github.com/astropy/astropy/issues <https://github.com/astropy/astropy/issues>

Christoph

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20160414/5c589598/attachment.html>


More information about the AstroPy mailing list