本文介绍了ImportError:无法导入名称flib的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用Python尝试hddm.

I want to use Python for trying out hddm.

我安装了蟒蛇Python 2.7.当我尝试在spyder的命令行窗口中遵循hddm教程时,会发生以下情况,这在pymc中似乎是一个问题:

I installed anaconda, Python 2.7. When I try to follow the hddm tutorial in the command line window in spyder, the following happens, which seems to be a problem in pymc:

import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
import hddm

Traceback (most recent call last):

  File "<ipython-input-24-17365318b31c>", line 1, in <module>
    import hddm

  File "/Users/c/anaconda/lib/python2.7/site-packages/hddm/__init__.py", line 7, in <module>
    import likelihoods

  File "/Users/c/anaconda/lib/python2.7/site-packages/hddm/likelihoods.py", line 2, in <module>
    import pymc as pm

  File "/Users/c/anaconda/lib/python2.7/site-packages/pymc/__init__.py", line 31, in <module>
    from .distributions import *

  File "/Users/c/anaconda/lib/python2.7/site-packages/pymc/distributions.py", line 30, in <module>
    from . import flib, utils

ImportError: cannot import name flib

我在Mac OS X 10.7上工作.在网上,我发现一些有关pymc的评论,可能未使用正确版本的gfortran进行编译,但解决方案似乎都适用于Windows.另外,我认为这种问题应该不会在像Anaconda这样的集成系统中发生吗?

I work on Mac OS X 10.7. On the web, I find some comments concerning pymc possibly not being compiled with the correct version of gfortran, but the solutions all seem to be for windows. Also, I thought that this kind of problem should not happen with an integrated system like Anaconda?

推荐答案

有两个选项:

  1. 使用conda install -c conda.binstar.org/pymc pymc

安装 gfortran 并使用pip install -U pymc

这篇关于ImportError:无法导入名称flib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-08 23:08
查看更多