I want to use sinoeibody from python to get weibo posts

Asked 2 years ago, Updated 2 years ago, 19 views

I would like to use the program below to get a post on weibo from python.

Program Contents

 from snspy import APIClient
from snspy import TwitterMixin #suppose you are using Twitter

APP_KEY='294703483'#appkey
APP_SECRET='a2ef9de0a580edb7a26daf2804d27624'#appsecret
CALLBACK_URL='https://api.weibo.com/oauth2/authorize' #callbackurl
YOUR_ACCESS_TOKEN='2.00skPOWG0zpXw_e8253b9b7c9GKIdE'

client=APICclient(TwitterMixin,
               app_key=APP_KEY, app_secret=APP_SECRET, redirect_uri=CALLBACK_URL,
               access_token=YOUR_ACCESS_TOKEN, expires=EXPIRES_TIME)

print client.status.user_timeline.get()

US>Program execution
Error Contents

[root@localhost Desktop] #python suerte.py
Traceback (most recent call last):
File "suerte.py", line 2, in <module>
from snspy import APIClient
ImportError: No module named snspy

For information on python to sinaweibody, refer to michaeliao.
ACCES TOKEN, unlike MichaelLiao, was acquired from weibo guide {"access_token":"2.00skPOWG0zpXw_e8253b9b7c9GKIdE", "remind_in": "157679999", "expires_in":157679999, "uid": "5973036902"}

I would appreciate it if you could let me know why the error occurs.
Thank you for your cooperation.

python

2022-09-30 19:34

3 Answers

ImportError: No module named snspy

You cannot find the module snspy you are importing.

Search for at python%20snfpr=1"rel ""noflower ""nofr>

So you can install sinaweibopy.
If you look at
setup.py, you will not see snspy as the module to be installed.

py_modules=['weibo'],

For this reason, installing sinaweibopy with pip etc. does not include snspy.

If you want to use snspy, you may need to download the file directly.


2022-09-30 19:34

snspy.py is this file, but I don't think there is a definition of TwitterMixin in this file.


2022-09-30 19:34

As you can see in the error message, the module snspy could not be found.
Files on snspy.py must be in the same directory as suerte.py.


2022-09-30 19:34

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.