I had set up my PC for Python, etc during the EPAT course. However, due to a PC problem, I now need to re-install the environment, and am having problems installing TA-Lib. I'm using the guide in the blog:
https://blog.quantinsti.com/install-ta-lib-python/
I’m running python 3.9.13 on Win 11 PC, 64-bit. I have saved the downloaded whl file to the directory as described in the blog.
Error using pip instal:
(base) C:\Users\user>pip install TA_Lib‑0.4.24‑cp39‑cp39‑win_amd64.whl
WARNING: Requirement 'TA_Lib‑0.4.24‑cp39‑cp39‑win_amd64.whl' looks like a filename, but the file does not exist
ERROR: TA_Lib‑0.4.24‑cp39‑cp39‑win_amd64.whl is not a valid wheel filename.
Btw, I’m using pip install because the conda forge installation didn’t work either, as shown below.
Would appreciate any help. Thanks …
Using conda to install results in:
(base) C:\Users\user>conda install -c conda-forge ta-lib
Collecting package metadata (current_repodata.json): done
Solving environment: /
The environment is inconsistent, please check the package plan carefully
The following packages are causing the inconsistency:
-
- defaults/win-64::anaconda==2022.10=py39_0
- defaults/win-64::anaconda-client==1.11.0=py39haa95532_0
- defaults/win-64::anaconda-navigator==2.3.2=py39haa95532_0
- defaults/win-64::anaconda-project==0.11.1=py39haa95532_0
- defaults/noarch::babel==2.9.1=pyhd3eb1b0_0
- defaults/win-64::bkcharts==0.2=py39haa95532_1
- defaults/win-64::conda-build==3.22.0=py39haa95532_0
- defaults/win-64::conda-repo-cli==1.0.27=py39haa95532_0
- defaults/win-64::dask==2022.7.0=py39haa95532_0
- defaults/win-64::datashader==0.14.1=py39haa95532_0
- defaults/win-64::holoviews==1.15.0=py39haa95532_0
- defaults/win-64::hvplot==0.8.0=py39haa95532_0
- defaults/noarch::intake==0.6.5=pyhd3eb1b0_0
- defaults/win-64::jupyter==1.0.0=py39haa95532_8
- defaults/win-64::jupyterlab==3.4.4=py39haa95532_0
- defaults/noarch::jupyterlab_server==2.10.3=pyhd3eb1b0_1
- defaults/win-64::numpydoc==1.4.0=py39haa95532_0
- defaults/win-64::pandas==1.4.4=py39hd77b12b_0
- defaults/noarch::seaborn==0.11.2=pyhd3eb1b0_0
- defaults/win-64::sphinx==5.0.2=py39haa95532_0
- defaults/win-64::spyder==5.2.2=py39haa95532_1
- defaults/win-64::statsmodels==0.13.2=py39h2bbff1b_0
- defaults/noarch::xarray==0.20.1=pyhd3eb1b0_1
- defaults/win-64::_ipyw_jlab_nb_ext_conf==0.1.0=py39haa95532_0
failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: /
The environment is inconsistent, please check the package plan carefully
The following packages are causing the inconsistency:
- defaults/win-64::anaconda==2022.10=py39_0
- defaults/win-64::anaconda-client==1.11.0=py39haa95532_0
- defaults/win-64::anaconda-navigator==2.3.2=py39haa95532_0
- defaults/win-64::anaconda-project==0.11.1=py39haa95532_0
- defaults/noarch::babel==2.9.1=pyhd3eb1b0_0
- defaults/win-64::bkcharts==0.2=py39haa95532_1
- defaults/win-64::conda-build==3.22.0=py39haa95532_0
- defaults/win-64::conda-repo-cli==1.0.27=py39haa95532_0
- defaults/win-64::dask==2022.7.0=py39haa95532_0
- defaults/win-64::datashader==0.14.1=py39haa95532_0
- defaults/win-64::holoviews==1.15.0=py39haa95532_0
- defaults/win-64::hvplot==0.8.0=py39haa95532_0
- defaults/noarch::intake==0.6.5=pyhd3eb1b0_0
- defaults/win-64::jupyter==1.0.0=py39haa95532_8
- defaults/win-64::jupyterlab==3.4.4=py39haa95532_0
- defaults/noarch::jupyterlab_server==2.10.3=pyhd3eb1b0_1
- defaults/win-64::numpydoc==1.4.0=py39haa95532_0
- defaults/win-64::pandas==1.4.4=py39hd77b12b_0
- defaults/noarch::seaborn==0.11.2=pyhd3eb1b0_0
- defaults/win-64::sphinx==5.0.2=py39haa95532_0
- defaults/win-64::spyder==5.2.2=py39haa95532_1
- defaults/win-64::statsmodels==0.13.2=py39h2bbff1b_0
- defaults/noarch::xarray==0.20.1=pyhd3eb1b0_1
- defaults/win-64::_ipyw_jlab_nb_ext_conf==0.1.0=py39haa95532_0
/
Hello Jatin,
This is really interesting. By the way, this might give you a different kind of issue, but alternatively, you could try to set up a virtual environment of Python with the required python libraries, all in one go. The instructions can be found in this blog: https://blog.quantinsti.com/set-up-python-system/
Coming to your issue, I think while you may have downloaded the correct file based on the OS version, whether it is 32 or 64 bit, and Python version, I think the downloaded folder and the location from where you are running the command to install the library is different.
I can see in this line, C:\Users\user>pip install TA_Lib‑0.4.24‑cp39‑cp39‑win_amd64.whl
that you are running the command from the location "C:\Users\user". I hope it is the same folder where the "whl" file is downloaded.
Alternatively, you can try upgrading pip installer with the following command:
pip install --upgrade pip
Let me know if this helps. Ideally this should work, or we might have to try a version lower than the latest one as sometimes there might be bugs in the latest version.
Thanks.
Hi Rekhit
Thanks very much for your reply with possible solutions. I upgraded pip as you suggested, and was able to successfully install TA-Lib after that.
On your suggestion to set up a Quantra environment, I have 2 questions:
- Where should "conda env create -f Learn algorithmic trading from top institutions and experts | Quantra by QuantInsti; be run?
My (base) root environment has been set up with Python 3.9. I assume I should get out of base first, and then run the code above?
- Since this is replicating the Quantra environment via the yml, how do I keep track of any changes you may make to this environment?
Best regards
jatin
Hi Jatin,
It is great to know that you were successfully able to install TA-lib. To answer your questions:
- You can run the command from the base environment. The file, when run, will create another environment independent of the base environment, and conda will take care of the complexities involved.
- We keep updating the environment file when there are any major changes in the package versions. You can check them once every few months to keep them up to date.
Hope this helps!
Thanks,
Akshay