[转]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 ...
随机推荐
- SpringBoot2静态资料访问
在SpringBoot2内要继承WebMvcConfigurationSupport并重写addResourceHandlers方法才能访问到静态资料. @Configuration public c ...
- 关于Q-LEARNING的优化
Q-LEARNING 最后得到的一个图寻路最佳路径:---直接转化为图关于多顶点深度遍历热度传递 V(level+1) = 0.8 * Max(Vi(level)) 这个方法可以在O时间收敛 原方 ...
- ubuntu下载超快的一个站点
http://mirrors.163.com/ubuntu-releases/14.04/
- matlab handle plot
https://cn.mathworks.com/help/matlab/ref/plotyy.html
- Python之路PythonNet,第一篇,网络1
pythonnet 网络1 ARPAnet(互联网雏形)---> 民用 ISO(国际标准化组织)--->网络体系结构标准 OSI模型 OSI : 网络信息传输比较复杂需要很多功能协同 ...
- [LeetCode&Python] Problem 697. Degree of an Array
Given a non-empty array of non-negative integers nums, the degree of this array is defined as the ma ...
- [LeetCode&Python] Problem 167. Two Sum II - Input array is sorted
Given an array of integers that is already sorted in ascending order, find two numbers such that the ...
- Gym101002 2016NAIPC(队内第7次训练)
(由于先看的最后一题,然后又一直WA,导致这场有点爆炸,我背锅. A .Fancy Antiques 题意: 选择最多k个商店,买n个物品,每个物品分别对应两个店售卖,求最小花费是多少.n<10 ...
- java实现图片上传功能,并返回图片保存路径
1.前端html <div class="form-group"> <label for="inputPassword3" class ...
- python 闭包和迭代器
一 函数名的运用:(函数名是一个变量,但它是一个特殊变量,与括号配合可以执行变量. (1) 函数名可以赋值给其他变量 def chi(): print("吃月饼") fn=chi ...