Michal
Michal

Reputation: 215

Python module error

Hi I am new to Python I want to use an already developed tool/code and I have a problem with the modules used. I installed Spider with Anaconda version of Python

I am trying to run below code,
https://code.google.com/p/quantandfinancial/source/browse/trunk/example_black_litterman.py

if I understood the code correctly it is referencing the below custom module https://code.google.com/p/quantandfinancial/source/browse/trunk/structures/quote.py?r=25

I stored the two parts of the code in C:\Users\Michal\Documents\Python Scripts and Python is installed in C:\Anaconda3, when I run the code I get an error

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

Please help how can I get this code running?

Upvotes: 0

Views: 1620

Answers (2)

taCkiE
taCkiE

Reputation: 26

pip install structures worked for me from normal windows cmd

C:\Users\user>pip install structures

You are using pip version 7.0.3, however version 7.1.2 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command.

> 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

Upvotes: 1

Matt Hall
Matt Hall

Reputation: 8112

You need to do this:

pip install structures

Best idea is probably to first make a conda environment, then you can manage all the packages you need in there.

Upvotes: 0

Related Questions