ta-lib-python icon indicating copy to clipboard operation
ta-lib-python copied to clipboard

#include "ta-lib/ta_defs.h" not found during installation

Open imamushroom opened this issue 5 years ago • 6 comments

I performed a git clone first.

Then, running a WSL2 session (Fedora remix) on a Windows 10 machine and getting the following error:

talib/_ta_lib.c:611:10: fatal error: ta-lib/ta_defs.h: No such file or directory 611 | #include "ta-lib/ta_defs.h" | ^~~~~~~~~~~~~~~~~~ compilation terminated. error: command 'gcc' failed with exit status 1

after issuing the command: pip install TA-Lib --user

How do I fix this please?

imamushroom avatar Dec 15 '20 09:12 imamushroom

If you look in the troubleshooting section of the README:

https://github.com/mrjbq7/ta-lib#troubleshooting

You'll see that error means you need the TA-Lib C library installed first.

You can see some help doing that on different platforms in the Dependencies section of the README:

https://github.com/mrjbq7/ta-lib#dependencies

mrjbq7 avatar Dec 15 '20 15:12 mrjbq7

I found the same library with the TA-Lib C library pre-installed. This was useful for me since I was running the code directly on Streamlit cloud and installing dependencies resulted to errors, plus finding the compatible binary files was an issue. So the solution that worked with me was pip install TA-Lib-Precompiled.

Andre-Mwendwa avatar Jul 27 '23 14:07 Andre-Mwendwa

I found the same library with the TA-Lib C library pre-installed. This was useful for me since I was running the code directly on Streamlit cloud and installing dependencies resulted to errors, plus finding the compatible binary files was an issue. So the solution that worked with me was pip install TA-Lib-Precompiled.

This worked for me! Thank you so much! I have been banging my head against the wall for an hour now trying to figure this out, and python3 -m pip install TA-Lib-Precompiled worked like a charm

jeffxhansen avatar Mar 16 '24 20:03 jeffxhansen

these replies aren't helping, it still doesn't work on Mac

jaxontn avatar Sep 07 '24 09:09 jaxontn

It’s very easy to install on the Mac.

It’s basically “brew install ta-lib”.

Followed by “python3 -m pip install ta-lib”.

If you have issues, it’s often because of

  1. mixed architecture in Apple Silicon, some stuff is Intel and some stuff is arm

  2. using pip3 which is tied to a different Python installation than the one you try and use

  3. integration with editors like PyCharm which make it confusing which Python you are using. So, “it works in the terminal but not in PyCharm” type of problems.

We’re happy to help, if you want to share more about what’s happening.

mrjbq7 avatar Sep 07 '24 13:09 mrjbq7

I use "conda install -c conda-forge ta-lib", and it works for me.

BoyceFong avatar Jan 14 '25 06:01 BoyceFong