问题
I've read through posts regarding installing TA-Lib in Python but without success. Here's what I've done so far:
- Since my Python is 3.7.3, I downloaded the file
TA_Lib-0.4.17-cp37-cp37m-win_amd64.whl
from https://www.lfd.uci.edu/~gohlke/pythonlibs/#ta-lib, and put it under the base folder. - I then went to Anaconda Prompt and type
pip install TA_Lib-0.4.17-cp37-cp37m-win_amd64.whl
, and here's what I got:
Traceback (most recent call last):
File "C:\Users\User\Anaconda3\Scripts\pip-script.py", line 6, in <module>
from pip._internal import main
File "C:\Users\User\Anaconda3\lib\site-packages\pip\_internal\__init__.py", line 40, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "C:\Users\User\Anaconda3\lib\site-packages\pip\_internal\cli\autocompletion.py", line 8, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "C:\Users\User\Anaconda3\lib\site-packages\pip\_internal\cli\main_parser.py", line 11, in <module>
from pip._internal.commands import (
File "C:\Users\User\Anaconda3\lib\site-packages\pip\_internal\commands\__init__.py", line 9, in <module>
from pip._internal.commands.download import DownloadCommand
File "C:\Users\User\Anaconda3\lib\site-packages\pip\_internal\commands\download.py", line 10, in <module>
from pip._internal.operations.prepare import RequirementPreparer
File "C:\Users\User\Anaconda3\lib\site-packages\pip\_internal\operations\prepare.py", line 9, in <module>
from pip._internal.distributions import (
File "C:\Users\User\Anaconda3\lib\site-packages\pip\_internal\distributions\__init__.py", line 1, in <module>
from pip._internal.distributions.source import SourceDistribution
ImportError: cannot import name 'SourceDistribution' from 'pip._internal.distributions.source' (C:\Users\User\Anaconda3\lib\site-packages\pip\_internal\distributions\source\__init__.py)
Any help is very much appreciated!
回答1:
Try this and let us know if this works for you.....
- curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
- python get-pip.py
来源:https://stackoverflow.com/questions/58426409/installing-ta-lib-on-python-3-7