Forums

TA-Lib

Can someone please tell me how I can use TA-Lib( http://mrjbq7.github.io/ta-lib/ ) in PythonAnywhere?

Thanks, Michael

I just tried using 'easy_install --user' but it failed because TA-Lib requires gcc for installation.

If you ask the devs nicely, they might help :-)

(You might also considering upgrading your account...)

Hmm. gcc is available now (though still in beta). What was the error message you got?

11:49 ~ $ easy_install --user TA-Lib                                                                                  
Searching for TA-Lib
Reading https://pypi.python.org/simple/TA-Lib/
Reading http://github.com/mrjbq7/ta-lib
Best match: TA-Lib 0.4.7
Downloading https://github.com/mrjbq7/ta-lib/archive/TA_Lib-0.4.7.zip
Processing TA_Lib-0.4.7.zip
Writing /tmp/easy_install-_Th1FF/ta-lib-TA_Lib-0.4.7/setup.cfg
Running ta-lib-TA_Lib-0.4.7/setup.py -q bdist_egg --dist-dir /tmp/easy_install-_Th1FF/ta-lib-TA_Lib-0.4.7/egg-dist-tmp-4B2Ejb
talib/common.c:314:28: fatal error: ta-lib/ta_defs.h: No such file or directory
compilation terminated.
error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Ah okay. So we would need to install the TA-lib package and development files for that pip install to work. Something to investigate.

Thanks for the help, guys. I'll try it out. Check out my stock picking tools at: https://github.com/mardizzone/Stock-Analyzer if it's any thanks for the help

@ardiz8 - depending on how good your c hacking skills are, you may be able to download and compile the module yourself, putting it into your home folder, and then hack the easy_install script where to look for the libraries, but that's non-trivial stuff.

Failing that, we'll look into downloading and compiling it ourselves, and making it part of our standard machine image, but no promises as to how soon we can get round to that i'm afraid...

It's taken a while, but TA-lib is now installed on PythonAnywhere by default.

Now I do see TA-Lib in the included batteries, but when running the code of import talib, it still give the error message "oduleNotFoundError: No module named 'talib'". What I am missing here?

How do you run your code?