bear / python-twitter

A Python wrapper around the Twitter API.
Apache License 2.0
3.41k stars 955 forks source link

Import "twitter" could not be resolved Pylance (reportMissingImports) #717

Closed Komas19-new closed 2 years ago

Komas19-new commented 2 years ago

Hello, when i try to make a twitter bot it keep saying "Import "twitter" could not be resolved Pylance (reportMissingImports)" Im sure that i did pip install python-twitter

config.py code:

import twitter
def getApi(consumer_key, consumer_secret, access_token_key, access_token_secret):
    return twitter.api(consumer_key='(hidden)',
                  consumer_secret='(hidden)',
                  access_token_key='(hidden)',
                  access_token_secret='(hidden)')

import twitter has twitter underlined by yellow line.

the main.py has no errors/warning so there is no point for me to show it.

Komas19-new commented 2 years ago

Starting the main.py shows this

Traceback (most recent call last):
  File "c:\Users\*****\Desktop\Twitter Bot Rickroll\main.py", line 1, in <module>
    from config import getApi
  File "c:\Users\*****\Desktop\Twitter Bot Rickroll\config.py", line 1, in <module>
    import twitter
ModuleNotFoundError: No module named 'twitter'