Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import 时报错 #6

Open
hillerliao opened this issue May 8, 2016 · 3 comments
Open

import 时报错 #6

hillerliao opened this issue May 8, 2016 · 3 comments

Comments

@hillerliao
Copy link

In [3]: from shanbay import Shanbay

ImportError Traceback (most recent call last)
in ()
----> 1 from shanbay import Shanbay

ImportError: cannot import name Shanbay

In [4]:

@mozillazg
Copy link
Owner

不知道你安装的是哪个版本的 shanbay,使用的是哪个版本的 python ?刚试了一下可以正常 import:

(test)$ pip install shanbay
Collecting shanbay
  Downloading shanbay-0.3.4-py2.py3-none-any.whl
...
Installing collected packages: six, html5lib, requests, beautifulsoup4, oauthlib, requests-oauthlib, shanbay
Successfully installed beautifulsoup4-4.4.1 html5lib-0.9999999 oauthlib-1.1.1 requests-2.10.0 requests-oauthlib-0.6.1 shanbay-0.3.4 six-1.10.0
(test)$ python
Python 3.5.1 (default, Dec 28 2015, 13:12:17) 
[GCC 4.8.2 20140120 (Red Hat 4.8.2-16)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from shanbay import Shanbay
>>> 

@hillerliao
Copy link
Author

import shanbay
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/dist-packages/shanbay/init.py", line 22, in
from .api import API # noqa
File "/usr/local/lib/python2.7/dist-packages/shanbay/api.py", line 9, in
from requests_oauthlib import OAuth2Session, TokenUpdated
File "/usr/local/lib/python2.7/dist-packages/requests_oauthlib/init.py", line 3, in
from .oauth2_auth import OAuth2
File "/usr/local/lib/python2.7/dist-packages/requests_oauthlib/oauth2_auth.py", line 3, in
from oauthlib.oauth2 import is_secure_transport
ImportError: cannot import name is_secure_transport

抱歉,之前是我文件命名与模块名重名了。不过现在是这个问题。

@mozillazg
Copy link
Owner

看报错信息应该是 oauthlib 或 requests_oauthlib 的版本问题,试试安装最新版本的 oauthlib 和 requests_oauthlib 。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants