ImportError: cannot import name flib

爷,独闯天下 提交于 2020-01-05 13:08:14

问题


I want to use Python for trying out hddm.

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

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:


There are two options:

  1. use conda install -c conda.binstar.org/pymc pymc

  2. install gfortran and use pip install -U pymc



来源:https://stackoverflow.com/questions/24480279/importerror-cannot-import-name-flib

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!