TypeError: slice indices must be integers or None or have an index method
2017-09-18 17:15
686 查看
http://www.jianshu.com/p/9137efc1bd8f
这是由于numpy的版本太高,numpy 1.12.0对这个做了些调整,把numpy降级到1.11.0就行了。
参考了这篇:
sudo pip install -U numpy==1.11.0
但是我的服务器中有两个python,2.7和3.4,而系统默认pip是装在python3.4上的,这样可以看见:
输入:pip --version
显示:pip 9.0.1 from /usr/local/lib/python3.4/dist-packages (python 3.4)
所以执行以下代码,装到强制装到python2.7中:
sudo python2.7 /usr/local/bin/pip install -U numpy==1.11.0
作者:kelseyh
链接:http://www.jianshu.com/p/9137efc1bd8f
來源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
这是由于numpy的版本太高,numpy 1.12.0对这个做了些调整,把numpy降级到1.11.0就行了。
参考了这篇:
sudo pip install -U numpy==1.11.0
但是我的服务器中有两个python,2.7和3.4,而系统默认pip是装在python3.4上的,这样可以看见:
输入:pip --version
显示:pip 9.0.1 from /usr/local/lib/python3.4/dist-packages (python 3.4)
所以执行以下代码,装到强制装到python2.7中:
sudo python2.7 /usr/local/bin/pip install -U numpy==1.11.0
作者:kelseyh
链接:http://www.jianshu.com/p/9137efc1bd8f
來源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
相关文章推荐
- TypeError: slice indices must be integers or None or have an __index__ method
- faster rcnn报错:TypeError: slice indices must be integers or None or have an __index__ method
- TypeError: slice indices must be integers or None or have an index method
- TypeError: slice indices must be integers or None or have an __index__ method
- 错误异常slice indices must be integers or None or have
- 快速解决Python问题:TypeError: list indices must be integers or slices, not str
- TypeError: list indices must be integers or slices, not tuple
- python错误:TypeError: string indices must be integers
- 处理错误TypeError: initial_value must be unicode or None, not str
- TypeError: string indices must be integers, not str
- Pymongo: TypeError: if no direction is specified, key_or_list must be an instance of list
- 读取页面返回字典值提示错误:TypeError: string indices must be integers, not str
- python错误:TypeError: string indices must be integers
- python3 爬虫TypeError: POST data should be bytes, an iterable of bytes, or a file object. It cannot be
- TypeError: 'numpy.float64' object cannot be interpreted as an index
- Uncaught TypeError: Super expression must either be null or a function, not undefine
- Class, struct, or interfce method must have a return type
- androidbug之Error running CaptureActivity: The activity must be exported or contain an intent-filter
- matlab错误:Subscript indices must either be real positive integers or logicals.
- TypeError: unbound method x must be called with x instance as first argument (got nothing instead)