首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Python模块错误

Python模块错误
EN

Stack Overflow用户
提问于 2015-11-23 22:30:47
回答 2查看 1.4K关注 0票数 0

嗨,我是Python新手,我想使用一个已经开发的工具/代码,我对所使用的模块有问题。我用Python的Anaconda版本安装了Spider

我试图运行以下代码,

litterman.py

如果我正确理解了代码,那么它引用的是下面的自定义模块https://code.google.com/p/quantandfinancial/source/browse/trunk/structures/quote.py?r=25

我将代码的两部分存储在C:\Users\Michal\Documents\Python Scripts中,Python安装在C:\Anaconda3中,当我运行该代码时,会得到一个错误

代码语言:javascript
复制
File "C:/Users/Michal/Documents/Python Scripts/Black-Litterman.py", line 4, in <module>
    from structures.quote import QuoteSeries
ImportError: No module named 'structures'

请帮助我如何运行这段代码?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2016-01-14 13:42:34

pip安装结构从普通windows cmd为我工作。

C:\Users\user>pip安装结构

您使用的是pip版本7.0.3,但是版本7.1.2是可用的。您应该考虑通过'python -m pip install --upgrade pip'命令进行升级。

代码语言:javascript
复制
> Collecting structures   
> Downloading structures-2.0.2.tar.bz2
> Installing collected packages: structures   
> Running setup.py install for structures 
> Successfully installed structures-2.0.2
票数 1
EN

Stack Overflow用户

发布于 2015-11-23 22:50:20

你需要这样做:

代码语言:javascript
复制
pip install structures

最好的方法可能是首先使用 environment,然后您可以管理您需要的所有包。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33881982

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档