简体   繁体   English

无法导入名称ExtendedInterpolation

[英]cannot import name ExtendedInterpolation

Interestingly, on my machine (OSX) importing the package hgvs runs smoothly, even though I'm working on python 2.7 (and ExtendedInterpolation is a python 3 function from configparser). 有趣的是,即使我正在使用python 2.7(并且ExtendedInterpolation是configparser的python 3函数),在我的计算机(OSX)上导入hgvs包的过程也运行顺利。 As far as what I've gathered, it simply uses a backport of Python 3's configparser module, so it should work anyways if Python 3 is installed. 据我所收集的,它只是使用了Python 3的configparser模块的一个反向端口,因此如果安装了Python 3,它仍然可以正常工作。 However, the following error occurs when I try to import the module on a EC2 instace using iPython Notebook. 但是,当我尝试使用iPython Notebook在EC2实例上导入模块时,发生以下错误。

Any ideas of what may be causing the issue? 关于什么可能导致问题的任何想法?

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-60-832dbede7fbb> in <module>()
----> 1 import hgvs.location

/usr/local/lib/python2.7/dist-packages/hgvs/hgvs/__init__.py in <module>()
     57 import warnings
     58 
---> 59 from .config import global_config    # flake8: noqa; importing symbol
     60 
     61 logger = logging.getLogger(__name__)

/usr/local/lib/python2.7/dist-packages/hgvs/hgvs/config.py in <module>()
     22 from __future__ import absolute_import, division, print_function, unicode_literals
     23 
---> 24 from configparser import ConfigParser, ExtendedInterpolation
     25 from copy import copy
     26 import logging

ImportError: cannot import name ExtendedInterpolation

According to this the problem is that: 根据这个问题是:

Unfortunately in 0.14.0 they broke the configparser import by introducing their own. 不幸的是,在0.14.0中,他们通过引入自己的配置打破了configparser的导入。

To resolve it, I downgraded the future library: 为了解决这个问题,我将未来的库降级了:

pip install future==0.13.1 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM