【发布时间】:2014-08-04 14:33:24
【问题描述】:
根据我使用的 Python 安装,我在加载模块时遇到了一些问题。当我输入
from quantecon import approx_markov
在使用Python 3.4.0的终端中,返回如下错误信息:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.4/dist-packages/quantecon/__init__.py", line 6,in <module>
from asset_pricing import AssetPrices
ImportError: No module named 'asset_pricing'
在上面提到的文件夹 /usr/... 中,我确实找到了一个名为 asset_pricing 的模块。 (我不得不承认我也不明白为什么模块asset_pricing会干扰。)
我安装了quantecon:
pip3 install quantecon
我怀疑这些问题与我使用的 Python 版本有关。我也安装了
pip install quantecon
当我使用 Python 2.7.6(我认为这是我正在使用的操作系统的标准 Python 版本)从终端调用模块 approx_markov 时,我没有收到任何错误消息。为了解决这个问题,我已经按照以下讨论中的说明进行操作,但无济于事Python3 has no acces to python2 modules (ubuntu)。
【问题讨论】:
-
感谢您的编辑,Martijn。
标签: python python-2.7 python-3.x ubuntu-14.04