#include "ta-lib/ta_defs.h" not found during installation
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?
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
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.
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
these replies aren't helping, it still doesn't work on Mac
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
-
mixed architecture in Apple Silicon, some stuff is Intel and some stuff is arm
-
using pip3 which is tied to a different Python installation than the one you try and use
-
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.
I use "conda install -c conda-forge ta-lib", and it works for me.