我正在尝试在运行Ubuntu 14.04的计算机上使用pydna模块,当我尝试导入它时出现以下错误:
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/pydna/__init__.py", line 97, in <module>
from pydna.amplify import Anneal
File "/usr/local/lib/python2.7/dist-packages/pydna/amplify.py", line 32, in <module>
from pydna.dsdna import rc
File "/usr/local/lib/python2.7/dist-packages/pydna/dsdna.py", line 63, in <module>
from IPython.display import Markdown as display
ImportError: cannot import name Markdown
有没有人找到解决这个问题的方法?我曾尝试重新安装IPython和pydna。 dsdna.py中的违规块如下: (第58-63行)
try:
import IPython
except ImportError:
def display(item): return item
else:
from IPython.display import Markdown as display
非常感谢任何帮助!
(Python 2.7.6)
答案 0 :(得分:1)
我安装了IPython 4.1.1,它对我有用(见下文)。你有哪个版本?另外,你安装了哪个pydna版本?
这可能是由于版本太旧的IPython,最近IPython被拆分为IPython和Jupyter,这导致一些代码中断。
(bjorn)bjorn@bjorn-ThinkPad-T450s:~/Desktop/GMB$ python
Python 2.7.10 |Anaconda 2.5.0 (64-bit)| (default, Oct 19 2015, 18:04:42)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>> from IPython.display import Markdown as display
>>> import IPython
>>> IPython.__version__
'4.1.1'