build/install from quantopian/zipline zipline-master...

735 views
Skip to first unread message

David Kossack

unread,
Aug 14, 2015, 7:02:17 PM8/14/15
to Zipline Python Opensource Backtester
Zipline -

As noted in your “Issues” the public release of Zipline is 0.7.0, while quantopian/zipline.git:zipline-master is at 0.8.x… While I think a updated public release is great I would actually like to access/build zipline.git:zipline-master in real time. My assumption is that the Master Branch is/should be a functional user space, though changing with merges addressing bug fixes and features. 

The Problem:
Editing the meta.yml provided in zipline-master/conda/zipline make it easy to point `conda build zipline` to git_url: https://github.com/quantopian/zipline.git to grab and build zipline, and it does. However, the build fails at `import numpy` (SOP…?) but more importantly, with numpy provided, the build proceeds without a problem until: `test` where it fails, and the `install` also fails functionally. In both cases it appears that the failure is because `install` does not copy/install various zipline folders/modules into the installed zipline module folder/environment; when python tries to import zipline, zipline is unable to find these supporting modules and that is that: 

(e.g., 
import zipline
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "/Users/canopy/Desktop/zipline-master/zipline/__init__.py", line 26, in <module>
   from . import finance
 File "/Users/canopy/Desktop/zipline-master/zipline/finance/__init__.py", line 16, in <module>
   from . import execution, trading
 File "/Users/canopy/Desktop/zipline-master/zipline/finance/trading.py", line 26, in <module>
   from zipline.assets import AssetFinder
 File "/Users/canopy/Desktop/zipline-master/zipline/assets/__init__.py", line 16, in <module>
   from ._assets import (
ImportError: No module named 'zipline.assets._assets'

)

Installing quantopian/zipline locally with `python setup.py install` has the same issue(s). Manually copying the missing module directories from zipline-master to the installed zipline directory appears to resolve the problem.

I presume that this is a basic install script issue… or am I missing something.

Thanks
David

David Kossack

unread,
Aug 14, 2015, 11:10:40 PM8/14/15
to Zipline Python Opensource Backtester
Same issue with `pip install git+https://github.com/quantopian/zipline.git`...

lsyi...@gmail.com

unread,
Aug 20, 2015, 12:17:27 AM8/20/15
to Zipline Python Opensource Backtester
I am running into similar problem here. I used python setup.py install, but all I get is a zipline-0.8.0rc1.egg file in the site pkgs folder. I copied those files from zipline-master-zipline into the site pkgs folder. But I got the same error as No module named 'zipline.assets._assets'
Would you mind post the detail of where you copied those files ? I tried to unpack the zipline-0.8.0rc1.egg file, there is a _asssets.py file in it, but it doesn't work.

Maybe b/c I am new to this, and it is a steep learning curve. But to be honest, using zipline is not a good experience at all in the past a few days with lack of document and inconsistent code repository.

Scott Sanderson

unread,
Aug 20, 2015, 12:56:57 AM8/20/15
to Zipline Python Opensource Backtester
Hi All,

Thanks for the bug reports.  As of the merging of https://github.com/quantopian/zipline/pull/681, it should be possible to install zipline with pip without any additional steps by running

Alternatively, you can clone the repo locally and run

pip install /path/to/your/zipline/checkout

or, if you want to be able to make local changes to your repo and have them affect the behavior of the package

pip install -e /path/to/your/zipline/checkout

Unfortunately, we have upstream dependencies that don't appear to install correctly when installed via setuptools (as opposed to pip), so just running setup.py install or setup.py develop is still non-functional.  I think the conda build should be fixed by this, but I haven't had a chance to try it out.

We're hoping to properly release 0.8.0 in the coming weeks; we've had a number of long-term projects going for a while that are nearing completion.  Once they're in a shippable state, we also need to do a documentation pass to clean up many of our stale examples.

-Scott

Joël Hubert

unread,
Aug 21, 2015, 12:05:09 AM8/21/15
to Zipline Python Opensource Backtester
Just some feedback on this, after installing Visual C++ for Python (9.0) I see three warnings leading to a failed installation:

 c:\python27\lib\site-packages\numpy\core\include\numpy\npy_1_7_deprecated_api.h(12) : Warning Msg: Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION

zipline/lib/adjusted_array.c(3080) : error C2065: 'NAN' : undeclared identifier
    error: command 'C:\\Users\\Mr MASHEK\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status 2

Command "C:\Python27\python.exe -c "import setuptools, tokenize; __file__='C:\\WINDOWS\\system32\\src\\zipline\\setup.py'; exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" develop --no-deps" failed with error code 1 in C:\WINDOWS\system32\src\zipline

Scott Sanderson

unread,
Aug 21, 2015, 12:56:18 AM8/21/15
to Zipline Python Opensource Backtester
The warning about using deprecated Numpy APIs happens because the C code generated by Cython uses older APIs from Numpy.  Those warnings are triggered (unfortunately) by pretty much every project that uses Cython's numpy features.  They're harmless, at least for the time being.

The undeclared identifier error looks like it's the result of this issue: http://tdistler.com/2011/03/24/how-to-define-nan-not-a-number-on-windows.  I'll look at fixing this tomorrow morning.

Thanks for the heads up.

Scott Sanderson

unread,
Aug 21, 2015, 11:38:01 AM8/21/15
to Zipline Python Opensource Backtester
Joel, can you try building from this bugfix branch?  I don't have a Windows machine handy to test the compilation myself.

-Scott
Reply all
Reply to author
Forward
0 new messages