Although this is a talib related Q it's mostly related to python module installing.. - Evalias123 - Jan-09-2021
Although I had installed numpy and apparently have it up to date, I've spent several hours banging my head into a wall trying to
pip install talib
pip install ta-lib
and I got all sorts of cool errors, they look like big long blocks of garble, at the end rechecked pip install numpy and it still seems to work.
Error: C:\WINDOWS\system32>pip install talib
Collecting talib
Using cached talib-0.1.1.tar.gz (1.3 kB)
Building wheels for collected packages: talib
Building wheel for talib (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\m s\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\M S\\AppData\\Local\\Temp\\pip-install-chf6hp7j\\talib_68b5a96fb6c24bf9bb216a856ab5c8f2\\setup.py'"'"'; __file__='"'"'C:\\Users\\M S\\AppData\\Local\\Temp\\pip-install-chf6hp7j\\talib_68b5a96fb6c24bf9bb216a856ab5c8f2\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\M S\AppData\Local\Temp\pip-wheel-xkdrzdhz'
cwd: C:\Users\M S\AppData\Local\Temp\pip-install-chf6hp7j\talib_68b5a96fb6c24bf9bb216a856ab5c8f2\
Complete output (29 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib
creating build\lib\talib
copying talib\cli.py -> build\lib\talib
copying talib\__init__.py -> build\lib\talib
installing to build\bdist.win-amd64\wheel
running install
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\M S\AppData\Local\Temp\pip-install-chf6hp7j\talib_68b5a96fb6c24bf9bb216a856ab5c8f2\setup.py", line 32, in <module>
setup(
File "c:\users\m s\anaconda3\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\m s\anaconda3\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "c:\users\m s\anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\m s\anaconda3\lib\site-packages\wheel\bdist_wheel.py", line 259, in run
self.run_command('install')
File "c:\users\m s\anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\m s\anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\M S\AppData\Local\Temp\pip-install-chf6hp7j\talib_68b5a96fb6c24bf9bb216a856ab5c8f2\setup.py", line 20, in run
raise Exception("You probably meant to install and run ta-lib")
Exception: You probably meant to install and run ta-lib
----------------------------------------
ERROR: Failed building wheel for talib
Running setup.py clean for talib
Failed to build talib
Installing collected packages: talib
Running setup.py install for talib ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\m s\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\M S\\AppData\\Local\\Temp\\pip-install-chf6hp7j\\talib_68b5a96fb6c24bf9bb216a856ab5c8f2\\setup.py'"'"'; __file__='"'"'C:\\Users\\M S\\AppData\\Local\\Temp\\pip-install-chf6hp7j\\talib_68b5a96fb6c24bf9bb216a856ab5c8f2\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\M S\AppData\Local\Temp\pip-record-nl2y7qjq\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\m s\anaconda3\Include\talib'
cwd: C:\Users\M S\AppData\Local\Temp\pip-install-chf6hp7j\talib_68b5a96fb6c24bf9bb216a856ab5c8f2\
Complete output (14 lines):
running install
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\M S\AppData\Local\Temp\pip-install-chf6hp7j\talib_68b5a96fb6c24bf9bb216a856ab5c8f2\setup.py", line 32, in <module>
setup(
File "c:\users\m s\anaconda3\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\m s\anaconda3\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "c:\users\m s\anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\M S\AppData\Local\Temp\pip-install-chf6hp7j\talib_68b5a96fb6c24bf9bb216a856ab5c8f2\setup.py", line 20, in run
raise Exception("You probably meant to install and run ta-lib")
Exception: You probably meant to install and run ta-lib
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\m s\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\M S\\AppData\\Local\\Temp\\pip-install-chf6hp7j\\talib_68b5a96fb6c24bf9bb216a856ab5c8f2\\setup.py'"'"'; __file__='"'"'C:\\Users\\M S\\AppData\\Local\\Temp\\pip-install-chf6hp7j\\talib_68b5a96fb6c24bf9bb216a856ab5c8f2\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\M S\AppData\Local\Temp\pip-record-nl2y7qjq\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\m s\anaconda3\Include\talib' Check the logs for full command output.
C:\WINDOWS\system32>pip install ta-lib
Error: Collecting ta-lib
Using cached TA-Lib-0.4.19.tar.gz (267 kB)
Requirement already satisfied: numpy in c:\users\m s\anaconda3\lib\site-packages (from ta-lib) (1.18.5)
Building wheels for collected packages: ta-lib
Building wheel for ta-lib (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\m s\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\M S\\AppData\\Local\\Temp\\pip-install-0fhcistu\\ta-lib_195c704785a44fab8ddfc0a4fb0a501a\\setup.py'"'"'; __file__='"'"'C:\\Users\\M S\\AppData\\Local\\Temp\\pip-install-0fhcistu\\ta-lib_195c704785a44fab8ddfc0a4fb0a501a\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\M S\AppData\Local\Temp\pip-wheel-8lsv39uj'
cwd: C:\Users\M S\AppData\Local\Temp\pip-install-0fhcistu\ta-lib_195c704785a44fab8ddfc0a4fb0a501a\
Complete output (27 lines):
C:\Users\M S\AppData\Local\Temp\pip-install-0fhcistu\ta-lib_195c704785a44fab8ddfc0a4fb0a501a\setup.py:71: UserWarning: Cannot find ta-lib library, installation may fail.
warnings.warn('Cannot find ta-lib library, installation may fail.')
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.8
creating build\lib.win-amd64-3.8\talib
copying talib\abstract.py -> build\lib.win-amd64-3.8\talib
copying talib\deprecated.py -> build\lib.win-amd64-3.8\talib
copying talib\stream.py -> build\lib.win-amd64-3.8\talib
copying talib\test_abstract.py -> build\lib.win-amd64-3.8\talib
copying talib\test_data.py -> build\lib.win-amd64-3.8\talib
copying talib\test_func.py -> build\lib.win-amd64-3.8\talib
copying talib\test_pandas.py -> build\lib.win-amd64-3.8\talib
copying talib\test_stream.py -> build\lib.win-amd64-3.8\talib
copying talib\__init__.py -> build\lib.win-amd64-3.8\talib
running build_ext
skipping 'talib\_ta_lib.c' Cython extension (up-to-date)
building 'talib._ta_lib' extension
creating build\temp.win-amd64-3.8
creating build\temp.win-amd64-3.8\Release
creating build\temp.win-amd64-3.8\Release\talib
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\ta-lib\c\include "-Ic:\users\m s\anaconda3\lib\site-packages\numpy\core\include" "-Ic:\users\m s\anaconda3\include" "-Ic:\users\m s\anaconda3\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /Tctalib\_ta_lib.c /Fobuild\temp.win-amd64-3.8\Release\talib\_ta_lib.obj
_ta_lib.c
talib\_ta_lib.c(609): fatal error C1083: Cannot open include file: 'ta_libc.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.28.29333\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Failed building wheel for ta-lib
Running setup.py clean for ta-lib
Failed to build ta-lib
Installing collected packages: ta-lib
Running setup.py install for ta-lib ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\m s\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\M S\\AppData\\Local\\Temp\\pip-install-0fhcistu\\ta-lib_195c704785a44fab8ddfc0a4fb0a501a\\setup.py'"'"'; __file__='"'"'C:\\Users\\M S\\AppData\\Local\\Temp\\pip-install-0fhcistu\\ta-lib_195c704785a44fab8ddfc0a4fb0a501a\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\M S\AppData\Local\Temp\pip-record-f37b7we_\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\m s\anaconda3\Include\ta-lib'
cwd: C:\Users\M S\AppData\Local\Temp\pip-install-0fhcistu\ta-lib_195c704785a44fab8ddfc0a4fb0a501a\
Complete output (27 lines):
C:\Users\M S\AppData\Local\Temp\pip-install-0fhcistu\ta-lib_195c704785a44fab8ddfc0a4fb0a501a\setup.py:71: UserWarning: Cannot find ta-lib library, installation may fail.
warnings.warn('Cannot find ta-lib library, installation may fail.')
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.8
creating build\lib.win-amd64-3.8\talib
copying talib\abstract.py -> build\lib.win-amd64-3.8\talib
copying talib\deprecated.py -> build\lib.win-amd64-3.8\talib
copying talib\stream.py -> build\lib.win-amd64-3.8\talib
copying talib\test_abstract.py -> build\lib.win-amd64-3.8\talib
copying talib\test_data.py -> build\lib.win-amd64-3.8\talib
copying talib\test_func.py -> build\lib.win-amd64-3.8\talib
copying talib\test_pandas.py -> build\lib.win-amd64-3.8\talib
copying talib\test_stream.py -> build\lib.win-amd64-3.8\talib
copying talib\__init__.py -> build\lib.win-amd64-3.8\talib
running build_ext
skipping 'talib\_ta_lib.c' Cython extension (up-to-date)
building 'talib._ta_lib' extension
creating build\temp.win-amd64-3.8
creating build\temp.win-amd64-3.8\Release
creating build\temp.win-amd64-3.8\Release\talib
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\ta-lib\c\include "-Ic:\users\m s\anaconda3\lib\site-packages\numpy\core\include" "-Ic:\users\m s\anaconda3\include" "-Ic:\users\m s\anaconda3\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /Tctalib\_ta_lib.c /Fobuild\temp.win-amd64-3.8\Release\talib\_ta_lib.obj
_ta_lib.c
talib\_ta_lib.c(609): fatal error C1083: Cannot open include file: 'ta_libc.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.28.29333\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\m s\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\M S\\AppData\\Local\\Temp\\pip-install-0fhcistu\\ta-lib_195c704785a44fab8ddfc0a4fb0a501a\\setup.py'"'"'; __file__='"'"'C:\\Users\\M S\\AppData\\Local\\Temp\\pip-install-0fhcistu\\ta-lib_195c704785a44fab8ddfc0a4fb0a501a\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\M S\AppData\Local\Temp\pip-record-f37b7we_\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\m s\anaconda3\Include\ta-lib' Check the logs for full command output.
C:\WINDOWS\system32>pip install numpy
Requirement already satisfied: numpy in c:\users\m s\anaconda3\lib\site-packages (1.18.5)
Now, I have googled a few different things and then proceeded to download Windows Visual Community 2019 and then an older 2015 version, then also a MySQL developer package that all-in-all ended up being about 20gigs of random information that, for the life of me, I cannot understand why trying to use talib.SMA and other commands I would be forced to have on my system. My python paths are myinitials\desktop , anaconda3\scripts , anaconda3 and anaconda3\Library\bin
It used to tell me that in the code
import numpy as np
import matplotlib.pyplot as plt
import yfinance as yf
import talib No module talib exists or something very similar, now it's telling me No module named yfinance.
How/where/what do I do to get any progress from here? Did I disable yfinance the module somehow, and why won't freaking talib just import. I can't explain how annoyed, frustrated and spread-apart the internet jury-rigged solutions are, why my hard drive has 20Gigs of what I consider irrelevant extra crab on it, and what I'm supposed to do next. I suppose I could reformat my whole drive, install Spyder and only Spyder without Jupyter notebook on it, or simply light the whole thing on fire but I am trying to put to use a course I've read and made plenty of screenshots through and while simple things work, others will Not function without talib commands. Thank you for any time, thoughts or comments on the matter.
RE: Although this is a talib related Q it's mostly related to python module installing.. - bowlofred - Jan-09-2021
If it's for https://github.com/mrjbq7/ta-lib, this package is just a wrapper for the real product that you have to have installed already. Have you already done the windows installation that it says on that page?
In your attempt to install "ta-lib" (with the hyphen), the error is that it can't find ta_libc.h, which suggests the product is not yet installed.
RE: Although this is a talib related Q it's mostly related to python module installing.. - Evalias123 - Jan-09-2021
So, there's a wrapper, and stuff like that..
Poked around a little bit and finally found something that contained the package and it did run and I saw a graph, but only one time, now it supposedly executes but just sit there.
Ended up installing from the file directly into my anaconda directory:
pip install TA_Lib-0.4.19-cp38-cp38-win_amd64.whl
Now, a funny thing is that my Spyder version 4.2.1 seems to un-recognize a module I had and had no issues with running the day before, in this case, yfinance. However, my Jupyter Notebook runs this and TA-Lib (referenced with import talib) just fine, and no problem whatsoever with the yfinance module.
On the anaconda 3 command prompt typing python --version gives me 3.8.3, despite having a path here and in Scripts and Libraries in the Windows System and User variables, typing python anything outside of the anaconda3 directory in CMD does nothing "Python was not found......."
a) Why would a module that had no problem working yesterday, in this case yfinance, now suddenly show up with a ModuleNotFoundError in Spyder?
b) Why would Jupyter Notebook, that ran my silly little test of moving averages against price data (finally!), produce an odd looking graph but then after first successful run, sit there like a potato with a green input line with subsequent runs?
RE: Although this is a talib related Q it's mostly related to python module installing.. - snippsat - Jan-09-2021
(Jan-09-2021, 08:50 PM)Evalias123 Wrote: On the anaconda 3 command prompt typing python --version gives me 3.8.3, despite having a path here and in Scripts and Libraries in the Windows System and User variables, typing python anything outside of the anaconda3 directory in CMD does nothing "Python was not found......." Anaconda 3 command prompt activate base automatically.
You should always activate base when use Anaconda3,or stuff can/will be wrong.
It did work before not activate base in newer version most activate.
So eg from cmd or cmder(recommended) as i use.
C:\
λ cd Anaconda3\
C:\Anaconda3
λ cd Scripts\
C:\Anaconda3\Scripts
λ activate
(base) C:\Anaconda3\Scripts
λ pip -V
pip 20.1.1 from C:\Anaconda3\lib\site-packages\pip (python 3.8)
(base) C:\Anaconda3\Scripts
λ conda -V
conda 4.8.3 Quote:a) Why would a module that had no problem working yesterday, in this case yfinance, now suddenly show up with a ModuleNotFoundError in Spyder?
Start Spyder from commandline when base is active.
Or can start from Anaconda3 Navigator.
(base) C:\Anaconda3\Scripts
λ pip show yfinance
WARNING: Package(s) not found: yfinance
(base) C:\Anaconda3
λ pip install yfinance
Collecting yfinance
.....
Successfully installed multitasking-0.0.9 yfinance-0.1.55
(base) C:\Anaconda3
λ pip show yfinance
Name: yfinance
Version: 0.1.55
Summary: Yahoo! Finance market data downloader
Home-page: https://github.com/ranaroussi/yfinance
Author: Ran Aroussi
Author-email: [email protected]
License: Apache
Location: c:\anaconda3\lib\site-packages
Requires: numpy, requests, multitasking, pandas, lxml
Required-by:
# Test that work
(base) C:\Anaconda3
λ python
Python 3.8.3 (default, Jul 2 2020, 17:30:36) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import yfinance
>>>
>>> yfinance.__version__
'0.1.54'
>>> exit()
RE: Although this is a talib related Q it's mostly related to python module installing.. - Evalias123 - Jan-10-2021
Typing in activate makes everything work in Spyder and the notebook once run from that command prompt (with (base) at the start of it).
Is there any particular reason that the Python developers made modules and interactions between versions and paths so ridiculously weird in terms of simple functioning?
The main thing is: THANK YOU to everyone in this thread. Believe it or not to just get to the point of running a few lines of code and a simple moving average function took about an aggregate of 4 days and approx ~12-16 hours. P.S. as expected and I believe tested before, I did have yfinance just the silly interpreter stopped being able to find it anymore, or Whatever. Time to run more complicated and interesting tests ;)
|