请教关于tushare的如何安装tushare

安装TuShare财经数据接口包 - 简书
安装TuShare财经数据接口包
pip install pandasC:\JS&pip install pandas
Collecting pandas
Downloading pandas-0.19.2-cp36-cp36m-win_amd64.whl (7.2MB)
100% |████████████████████████████████| 7.2MB 120kB/s
Collecting pytz&=2011k (from pandas)
Downloading pytz-2016.10-py2.py3-none-any.whl (483kB)
100% |████████████████████████████████| 491kB 857kB/s
Collecting numpy&=1.7.0 (from pandas)
Downloading numpy-1.12.0-cp36-none-win_amd64.whl (7.7MB)
100% |████████████████████████████████| 7.7MB 126kB/s
Collecting python-dateutil&=2 (from pandas)
Downloading python_dateutil-2.6.0-py2.py3-none-any.whl (194kB)
100% |████████████████████████████████| 194kB 2.1MB/s
Requirement already satisfied: six&=1.5 in c:\users\chang\appdata\local\programs\python\python36\lib\site-packages (from pytho
n-dateutil&=2-&pandas)
Installing collected packages: pytz, numpy, python-dateutil, pandas
Successfully installed numpy-1.12.0 pandas-0.19.2 python-dateutil-2.6.0 pytz-2016.10
如果想完成pandas主页上的测试项目,还需要安装nose包。C:\JS&pip install nose
Collecting nose
Downloading nose-1.3.7-py3-none-any.whl (154kB)
100% |████████████████████████████████| 163kB 169kB/s
Installing collected packages: nose
Successfully installed nose-1.3.7
测试一下是否成功安装。C:\JS&python
Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 :12) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
&&& import pandas as pd
&&& pd.test()
Running unit tests for pandas
pandas version 0.19.2
numpy version 1.12.0
pandas is installed in C:\Users\*****\AppData\Local\Programs\Python\Python36\lib\site-packages\pandas
Python version 3.6.0 (v3.6.0:41df79263a11, Dec 23 :12) [MSC v.1900 64 bit (AMD64)]
nose version 1.3.7
C:\Users\*****\AppData\Local\Programs\Python\Python36\lib\imp.py:216: FutureWarning: The pandas.rpy module is deprecated and w
ill be removed in a future version. We refer to external packages like rpy2.
See here for a guide on how to port your code to rpy2: http://pandas.pydata.org/pandas-docs/stable/r_interface.html
return _load(spec)
.........SSS..SS..SS..SS..SS..SS..SS..SS..SSSSSSSSSSSSSS.
安装lxmlC:\JS&pip install lxml
Collecting lxml
Downloading lxml-3.7.2-cp36-cp36m-win_amd64.whl (3.2MB)
100% |████████████████████████████████| 3.2MB 272kB/s
Installing collected packages: lxml
Successfully installed lxml-3.7.2
安装requestsC:\JS&pip install requests
Collecting requests
Downloading requests-2.13.0-py2.py3-none-any.whl (584kB)
100% |████████████████████████████████| 593kB 1.2MB/s
Installing collected packages: requests
Successfully installed requests-2.13.0
安装tushareC:\JS&pip install tushare
Collecting tushare
Downloading tushare-0.6.8.tar.gz (87kB)
100% |████████████████████████████████| 92kB 304kB/s
Installing collected packages: tushare
Running setup.py install for tushare ... done
Successfully installed tushare-0.6.8
测试是否成功安装C:\JS&python
Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 :12) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
&&& import tushare as ts
&&& ts.get_k_data('399300', index=True,start='', end='')
安装seaborn绘图库在 下载scipy-0.18.1-cp36-cp36m-win_amd64.whl文件和numpy-1.12.0+mkl-cp36-cp36m-win_amd64.whl文件。因为pandas安装的numpy不符合scipy的要求,所以需要卸载后重新安装一个附带 库的版本C:\JS&pip uninstall numpy
Proceed (y/n)? y
Successfully uninstalled numpy-1.12.0
C:\JS&pip install "c:\js\numpy-1.12.0+mkl-cp36-cp36m-win_amd64.whl"
Processing c:\js\numpy-1.12.0+mkl-cp36-cp36m-win_amd64.whl
Installing collected packages: numpy
Successfully installed numpy-1.12.0+mkl
C:\JS&pip install "c:\js\scipy-0.18.1-cp36-cp36m-win_amd64.whl"
Processing c:\js\scipy-0.18.1-cp36-cp36m-win_amd64.whl
Installing collected packages: scipy
Successfully installed scipy-0.18.1
都准备好了再安装seabornC:\JS&pip install seaborn
Collecting seaborn
Using cached seaborn-0.7.1.tar.gz
Collecting matplotlib (from seaborn)
Using cached matplotlib-2.0.0-cp36-cp36m-win_amd64.whl
Requirement already satisfied: python-dateutil in c:\users\chang\appdata\local\programs\python\python36\lib\site-packages (fro
m matplotlib-&seaborn)
Collecting cycler&=0.10 (from matplotlib-&seaborn)
Using cached cycler-0.10.0-py2.py3-none-any.whl
Requirement already satisfied: six&=1.10 in c:\users\chang\appdata\local\programs\python\python36\lib\site-packages (from matp
lotlib-&seaborn)
Requirement already satisfied: pytz in c:\users\chang\appdata\local\programs\python\python36\lib\site-packages (from matplotli
b-&seaborn)
Requirement already satisfied: numpy&=1.7.1 in c:\users\chang\appdata\local\programs\python\python36\lib\site-packages (from m
atplotlib-&seaborn)
Collecting pyparsing!=2.0.4,!=2.1.2,!=2.1.6,&=1.5.6 (from matplotlib-&seaborn)
Using cached pyparsing-2.1.10-py2.py3-none-any.whl
Installing collected packages: cycler, pyparsing, matplotlib, seaborn
Running setup.py install for seaborn ... done
Successfully installed cycler-0.10.0 matplotlib-2.0.0 pyparsing-2.1.10 seaborn-0.7.1
我们测试一下是否能用了import matplotlib.pyplot as plt
import seaborn as sns
import seaborn.linearmodels as snsl
import tushare as ts
sns.set_style("whitegrid")
stock = ts.get_hist_data('300104', '', '')
stock['close'].plot(legend=True, figsize=(10, 4))
plt.show()
乐视网收盘价走势.png
完美~或者说,能用了

我要回帖

更多关于 python tushare 安装 的文章

 

随机推荐