quantopian / alphalens

Performance analysis of predictive (alpha) stock factors
http://quantopian.github.io/alphalens
Apache License 2.0
3.2k stars 1.12k forks source link

Newbie issues: "ModuleNotFoundError: No module named 'alphalens'" #321

Closed udayb closed 5 years ago

udayb commented 5 years ago

I just installed alphalens using pip and installed Jupyter as suggested. On executing daily_factor_synthetic_data.ipynb from examples in the Jupyter , I get the following error

ModuleNotFoundError Traceback (most recent call last)

in () 5 import matplotlib.pyplot as plt 6 ----> 7 from alphalens.tears import (create_returns_tear_sheet, 8 create_information_tear_sheet, 9 create_turnover_tear_sheet, ModuleNotFoundError: No module named 'alphalens' Please let me know if there is an alias where I can I ask dumber questions. Thanks Uday
luca-s commented 5 years ago

So, if you simply import alphalens in a Notebook, does it work or do you get an error? This seems more an installation problem you have than a general Alphalens issue.

udayb commented 5 years ago

[image: image.png]

I am very new to Jupyter and Python. So please excuse the mistakes.

Thanks Uday

On Thu, Oct 11, 2018 at 1:12 PM luca-s notifications@github.com wrote:

So, if you simply import alphalens in a Notebook, does it work or do you get an error?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/quantopian/alphalens/issues/321#issuecomment-428853919, or mute the thread https://github.com/notifications/unsubscribe-auth/AF8f69ORnL0ECnk_o0LGa1xATj91d5DOks5ujvZPgaJpZM4XWruw .

luca-s commented 5 years ago

@udayb the image was not uploaded

udayb commented 5 years ago

@udayb the image was not uploaded

It shows that alphalens is not found. Others seem to work fine. I had installed it via pip as suggested and assumed that the path would be updated implicitly. Let me know if I am missing something. I am new to Python.

2018-10-12

Thanks Uday

luca-s commented 5 years ago

Thanks, I can see the image now. It seems that Jupyter NB is using python3. Did you pip-install Alphalens for python2 or python3?

udayb commented 5 years ago

I did the following sudo apt install python-pip and pip install alphalens

I did not choose anything specifically wrt python itself.

Thanks Uday

On Sat, Oct 13, 2018 at 2:03 PM luca-s notifications@github.com wrote:

Thanks, I can see the image now. It seems that Jupyter NB is using python3. Did you pip-install Alphalens for python2 or python3?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/quantopian/alphalens/issues/321#issuecomment-429522576, or mute the thread https://github.com/notifications/unsubscribe-auth/AF8f6xy2yV6ocaYEY03A7K5abNyAWhXlks5ukaVNgaJpZM4XWruw .

luca-s commented 5 years ago

try tunning:

pip3 install alphalens

udayb commented 5 years ago

Still the same issue. This is on ubuntu 18.04 would that matter?

Thanks Uday

On Sat, Oct 13, 2018 at 9:24 PM luca-s notifications@github.com wrote:

try tunning:

pip3 install alphalens

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/quantopian/alphalens/issues/321#issuecomment-429552688, or mute the thread https://github.com/notifications/unsubscribe-auth/AF8f65Nr9RHR8wbvoH46pmekejeOG3gNks5ukgzPgaJpZM4XWruw .

luca-s commented 5 years ago

I am sorry that I was not able to help you but this issue is not really Alphalens related, this has to do with you system and it is very hard for me to debug the problem without having access to your machine. I would suggest to read your distribution documentation on how to install python modules.

On my machine, which is an OS similar to your ubuntu 18.04 I simply run pip (or pip3) install with the --user option (so that the package is installed in my home folder). The python environment variables already include my home as search path for python modules, so the installed modules work right away.

In your case I would double check that Alphales in actually installed in the system (check the files are there) and then I would make sure that python module search path includes the folder where Alphalens is actually installed.

udayb commented 5 years ago

No worries. I'll figure it out.

Is there an alias for this effort that I can join. Raising issues for teething problems like mine is not fair for you developers.

Thanks Uday

On Tue, Oct 16, 2018 at 10:28 PM luca-s notifications@github.com wrote:

I am sorry that I was not able to help you but this issue is not really Alphalens related, this has to do with you system and it is very hard for me to debug the problem without having access to your machine. I would suggest to read your distribution documentation on how to install python modules.

On my machine, which is an OS similar to your ubuntu 18.04 I simply run pip (or pip3) install with the --user option (so that the package is installed in my home folder). The python environment variables already include my home as search path for python modules, so the installed modules work right away.

In your case I would double check that Alphales in actually installed in the system (check the files are there) and then I would make sure that python module search path includes the folder where Alphalens is actually installed.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/quantopian/alphalens/issues/321#issuecomment-430315011, or mute the thread https://github.com/notifications/unsubscribe-auth/AF8f61Cidzqm37IPDZ9VUGNO_iSOJDVOks5ulhAlgaJpZM4XWruw .

davidmcomfort commented 2 years ago

I used conda to install alphalens conda install -c conda-forge alphalens and that solved the issue. It installs version 0.3.6.