empyrical icon indicating copy to clipboard operation
empyrical copied to clipboard

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

Open dartdog opened this issue 7 years ago • 11 comments

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..

dartdog avatar Jun 22 '17 20:06 dartdog

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

falaktheoptimist avatar Jun 23 '17 08:06 falaktheoptimist

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

twiecki avatar Jun 23 '17 13:06 twiecki

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

iamraa avatar Jun 23 '17 21:06 iamraa

@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.

richafrank avatar Jun 23 '17 21:06 richafrank

actually it was just renamed.

twiecki avatar Jun 23 '17 21:06 twiecki

Oh ok! I stand corrected.

richafrank avatar Jun 23 '17 21:06 richafrank

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 avatar Jun 24 '17 16:06 dartdog

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...

dartdog avatar Jun 24 '17 17:06 dartdog

@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.

iamraa avatar Jun 24 '17 17:06 iamraa

@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)

dartdog avatar Jun 24 '17 18:06 dartdog

@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.

closedLoop avatar Jul 10 '17 14:07 closedLoop