[转]happybase1.0 报错:ThriftPy does not support generating module with path in protocol 'f'
happybase1.0 报错:ThriftPy does not support generating module with path in protocol 'f'
原因:happybase1.0在win下不支持绝对路径
具体原因:happybase要读取Python\Lib\site-packages\happybase\Hbase.thrift,但在Python\Lib\site-packages\thriftpy\parser\parser.py中的487行
url_scheme = urlparse(path).scheme
if url_scheme == '': with open(path) as fh:
data = fh.read()
elif url_scheme in ('http', 'https'):('http', 'https'):
data = urlopen(path).read()
else:
raise ThriftParserError('ThriftPy does not support generating module '
'with path in protocol \'{}\''.format(
url_scheme))
path是Hbase.thrift的绝对路径(我的是“F:\SoftWare\Python27\Lib\site-packages\happybase\Hbase.thrift”),但经过urlparse(path).scheme后,url_scheme变成了“f”,(这也就是报错信息中最后的“f”)。根据代码,url_scheme既不为“”,也不包含
(‘http’,'https'),则只能为raise报错。
解决方案:将488行的url_scheme == ''改为url_scheme in ('f', ''),即
url_scheme = urlparse(path).scheme
#if url_scheme == '':
if url_scheme in ('f', ''):
with open(path) as fh:
data = fh.read()
elif url_scheme in ('http', 'https'):
data = urlopen(path).read()
else:
raise ThriftParserError('ThriftPy does not support generating module '
'with path in protocol \'{}\''.format(
url_scheme))
注:'f'为盘符,就是我把python装在了f盘,只要能让那个判断为真就行。
参考:https://github.com/eleme/thriftpy/issues/234
[转]happybase1.0 报错:ThriftPy does not support generating module with path in protocol 'f'的更多相关文章
- jQuery3.0+报错Uncaught TypeError: e.indexOf is not a function
jQuery3.0+报错Uncaught TypeError: e.indexOf is not a function 使用.load()绑定事件时报错,Uncaught TypeError: e.i ...
- MySQL8.0报错Can't connect to MySQL server on 'localhost' (10061)的解决办法
MySQL8.0报错Can't connect to MySQL server on 'localhost' (10061)的解决办法 事情的起因 今天课堂上要展示小组项目,需要用一个软件叫W ...
- navicat连接远程数据库报错'client does not support authentication protocol requested by server consider ...'解决方案
[1.cmd终端连接远程mysql数据库方法] mysql -uhello -pworld -h192.168.1.88 -P3306 -Dmysql_oa mysql -u用户名 -p密码 -h ...
- centos7下报错: import requests ImportError: No module named requests
在网上扒了一个python脚本,在centos7上执行的时候报错: import requestsImportError: No module named requests 原因是:requests是 ...
- java.lang.UnsupportedClassVersionError(Unsupported major.minor version 49.0)报错
报错截图如下:
- 使用SQL-Front启动MySQL8.0报错
这学期学习数据库,电脑上分别装有phpStudy(自带的MySQL版本为5.5)和MySQL8.0.11,于是想用phpStudy中的SQL Front连接到8.0的数据库.手动开启8.0的MySQL ...
- 生产环境elasticsearch5.0报错IllegalArgumentException: number of documents in the index cannot exceed 2147483519的处理
最近几天的push:user:req数据写不到集群,报错如下: [--13T09::,][DEBUG][o.e.a.b.TransportShardBulkAction] [yunva_etl_es8 ...
- ionic3 更新打开apk android 8.0报错
项目中安卓强制更新,当文件下载完.在android 8.0中不能打开apk包. 引入插件报一下错误 import { FileOpener } from '@ionic-native/file-ope ...
- 解决MySQL8.0报错:Unknown system variable 'validate_password_policy'
一.问题描述 1.在安装MySQL8.0时,修改临时密码,因密码过于简单(如:123456),不符合MySQL密码规范,会触发一个报错信息: ERROR 1819 (HY000): Your pass ...
随机推荐
- JAVA数组与List相互转换
1.数组转成List 数组转成List可以用方法 :Arrays.asList,一起来了解一下 System.out.println(Arrays.asList(new String[] { &quo ...
- springmvc实现json交互 -requestBody和responseBody
json数据交互 1.为什么要进行json数据交互 json数据格式在接口调用中.html页面中较常用,json格式比较简单,解析还比较方便. 比如:webservice接口,传输json数据. 2. ...
- Kaggle:Home Credit Default Risk 数据探索及可视化(1)
最近博主在做个 kaggle 竞赛,有个 Kernel 的数据探索分析非常值得借鉴,博主也学习了一波操作,搬运过来借鉴,原链接如下: https://www.kaggle.com/willkoehrs ...
- linux 实用命令 —— tr
1. [:alnum:] tr -cd '[:alnum:]' -d:delete:-c:complement:-cd:删除后边的参数以外的: [:class:] [:alpah:]:字母,[:dig ...
- opengl学习,一篇就够你基本了解
http://blog.csdn.net/iduosi/article/details/7835624
- 【转载】 Pytorch中的学习率调整lr_scheduler,ReduceLROnPlateau
原文地址: https://blog.csdn.net/happyday_d/article/details/85267561 ------------------------------------ ...
- P1441 砝码称重(搜索+队列dp)
题目链接:传送门 题目大意: 给你n个砝码ai,从中去掉m个后求最多的砝码可表示的重量. n≤20,m≤4,m<n,ai≤100. 思路: 用dfs搜掉m个砝码,然后用队列dp跑出答案,维护答案 ...
- git 应用
git - 简易指南 助你开始使用 git 的简易指南,木有高深内容,;). 安装 下载 git OSX 版 下载 git Windows 版 下载 git Linux 版 创建新仓库 创建新文件夹, ...
- 《DSP using MATLAB》Problem 6.13
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 解决ERROR - unregister mbean error javax.management.InstanceNotFoundException: com.alibaba.druid:type=
https://blog.csdn.net/chengsi101/article/details/72627062 https://www.cnblogs.com/gradven/p/6323195. ...