import happybase报错,ThriftPy does not support generating module with path in protocol 'd'
2018-02-07 19:39
656 查看
安装happybase包,运行报错
File import happybase File "D:\Program Files\python3.6\lib\site-packages\happybase\__init__.py", line 10, in <module> 'Hbase_thrift') File "D:\Program Files\python3.6\lib\site-packages\thriftpy\parser\__init__.py", line 30, in load include_dir=include_dir) File "D:\Program Files\python3.6\lib\site-packages\thriftpy\parser\parser.py", line 496, in parse url_scheme)) thriftpy.parser.exc.ThriftParserError: ThriftPy does not support generating module with path in protocol 'd'
解决方法:
进入如下 你的Python的安装路径下,找到parser.py文件
D:\Program Files\python3.6\Lib\site-packages\thriftpy\parser
打开parser.py文件,找到488行。注释掉原来488行代码,添加为
if len(url_scheme) <= 1:
或者可以修改为
if url_scheme in ('f', ''):
如果是报错’d’上面就写’d’,‘f’就写’f’
问题原因
原因:happybase1.0在win下不支持绝对路径
具体原因:happybase要读取Python\Lib\site-packages\happybase\Hbase.thrift,但在Python\Lib\site-packages\thriftpy\parser\parser.py中的487行
path是Hbase.thrift的绝对路径(我的是“F:\SoftWare\Python27\Lib\site-packages\happybase\Hbase.thrift”),但经过urlparse(path).scheme后,url_scheme变成了“f”,(这也就是报错信息中最后的“f”)。根据代码,url_scheme既不为“”,也不包含
(‘http’,’https’),则只能为raise报错。
原因回答原处为 :http://blog.163.com/dxy1016@126/blog/static/122332581201691224015296/
参考:
https://www.cnblogs.com/angellst/p/7510486.html
相关文章推荐
- happybase1.0 报错:ThriftPy does not support generating module with path in protocol 'd'
- ThriftParserError: ThriftPy does not support generating module with path in protocol 'd'
- This version does not support documents saved in the Xcode 8 format. Open this document with Xcode 8
- Cocos2d-x 2.2.3 使用NDK配置安卓编译环境问题之 Cannot find module with tag 'CocosDenshion/android' in import path
- Cocos2dx 2.0.2版本Android环境出错:Cannot find module with tag 'CocosDenshion/android' in import path
- Cannot find module with tag 'transcode-1.1.5/avilib' in import path
- Android NDK: jni/Android.mk: Cannot find module with tag 'cocos2dx' in import path解决办法
- Cannot find module with tag 'Android NDK Profiler' in import path解决办法
- webpack打包遇到locals[0] does not appear to be a `module` object with Hot Module replacement API enabled. You should disable react-transform-hmr in production by using `env` section in Babel configuration
- This version does not support documents saved in the Xcode 8 format. Open this document with Xcode 8
- This version does not support documents saved in the Xcode 8 format. Open this document with Xcode 8
- Android NDK: jni/Android.mk: Cannot find module with tag 'cocos2dx' in import path解决办法
- This version does not support documents saved in the Xcode 8 format. Open this document with Xcode 8
- Android NDK: jni/Android.mk: Cannot find module with tag 'cocos2dx' in import path解决办法
- Cocos2dx 2.0.2版本Android环境出错:Cannot find module with tag 'CocosDenshion/android' in import path
- 错误: Could not edit the data in the folder or database selected. The current version does not support editing (base, consistent, or closed)
- Cannot find module with tag 'cpufeatures' in import path
- This version does not support documents saved in the Xcode 8 format. Open this document with Xcode 8
- Warning: stream_socket_enable_crypto() [streams.crypto]: this stream does not support SSL/crypto in
- C++开发python扩展模块:ImportError: dynamic module does not define init function (initRabbit)解决办法