Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Just installed Pyfolio getting AttributeError: module 'empyrical' has no attribute 'information_ratio' #52

Open
dartdog opened this issue Jun 22, 2017 · 11 comments

Comments

@dartdog
Copy link

dartdog commented Jun 22, 2017

I'm getting this on a number of the example notebooks.. I did update the utils py file in order to get Google data instead of yahoo,, and I do have some portions of the notebooks working but can't get a "full" tear sheet due to this error! Any hints/workarounds appreciated..

@falaktheoptimist
Copy link

Same error, but in my case this occurs in a call from zipline

@twiecki
Copy link
Contributor

twiecki commented Jun 23, 2017

Can you guys try to install pyfolio master: pip install -U git@https://github.com/quantopian/pyfolio

@iamraa
Copy link

iamraa commented Jun 23, 2017

Somebody renamed information_ratio to excess_sharpe. Make changes by yourselves or wait for miracle.

@richafrank
Copy link
Member

@iamraa I could be mistaken, but I believe that excess_sharpe was added and information_ratio removed - but that they are functions with different behavior, as opposed to one function that was renamed.

@twiecki
Copy link
Contributor

twiecki commented Jun 23, 2017

actually it was just renamed.

@richafrank
Copy link
Member

Oh ok! I stand corrected.

@dartdog
Copy link
Author

dartdog commented Jun 24, 2017

Under an Anaconda virtual env for python 3.6
FYI, guess I'll try a manual install..
pip install -U git@https://github.com/quantopian/pyfolio
Collecting git@ https://github.com/quantopian/pyfolio
Could not find a version that satisfies the requirement git@ https://github.com/quantopian/pyfolio (from versions: )
No matching distribution found for git@ https://github.com/quantopian/pyfolio
(py36n) tom@tomServal:~$

@dartdog
Copy link
Author

dartdog commented Jun 24, 2017

Welp a simple

(py36n) tom@tomServal:~$ cd Documents//pyfolio/
(py36n) tom@tomServal:~/Documents/pyfolio$ python setup.py install
/home/tom/anaconda3/envs/py36n/lib/python3.6/site-packages/setuptools/dist.py:336: UserWarning: Normalizing 'v0.7.0+18.ga34222e' to '0.7.0+18.ga34222e'
  normalized_version  ```  

did not work as hoped..

```%matplotlib inline
import pyfolio as pf  ```  

gave me:  

```RuntimeError                              Traceback (most recent call last)
RuntimeError: module compiled against API version 0xb but this version of numpy is 0xa ```   

Guess I'll try a new env...

@iamraa
Copy link

iamraa commented Jun 24, 2017

@dartdog pyfolio does not fix it. You have to fix it manualy in zipline scripts.
%env%/lib/python#.#/site-packages/zipline/finance/risk/
period.py & cumulative.py
Replace information_ratio by excess_sharpe.

@dartdog
Copy link
Author

dartdog commented Jun 24, 2017

@iamraa it actually at least got pyfolio up and going,, as follows... zipline is yet another exercise...
Well I did create a new env in conda, is just did a conda py 3 env,, then ran the setup.py in pyfolio.. it could not find or install numpy itself so I conda installed it then re-ran the setup.py for pyfolio, it kicked off recompiling just about everything..conda installed matplotlib.. then I replaced the utils.py in the egg.. with the modified one for Google data. Also had to install the right kernel modules in the new env for jupyter,, and low and behold, I can now run the single stock notebook!! also had to install a few other packages request-files and requests-ftp (for others who follow)

@closedLoop
Copy link

@twiecki if pyfolio and empyrical are going to be so intertwined, I believe better testing and deployment needs to be made. Maybe synchronize version numbers / releases when there are reverse compatibility.

These headaches are making pyfolio and all of these other libraries more trouble then they are worth.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants