Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

pip package install but i got SyntaxError: invalid syntax in (venv)

i used pip to install tweepy package, if i run pip list commend i see tweepy 3.3.0 there installed but when i run my code i got this error

Traceback (most recent call last):
  File "/home/ramib/Desktop/project/PracticeProject/MiningTwitterData.py", line 9, in <module>
    import tweepy
  File "/home/ramib/Desktop/project/venv/lib/python3.10/site-packages/tweepy/__init__.py", line 17, in <module>
    from tweepy.streaming import Stream, StreamListener
  File "/home/ramib/Desktop/project/venv/lib/python3.10/site-packages/tweepy/streaming.py", line 340
    def _start(self, async):
                     ^^^^^
SyntaxError: invalid syntax

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

tweepy 3.3.0 is over 8 years old and does not work on Python 3.10. async is being used as a parameter name here, but it became a keyword in Python 3.7 (having been deprecated as a variable name since Python 3.5), making such usage invalid.

You probably want to install the latest version of tweepy instead. pip install tweepy should do this.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading