0

There has been this constant error while trying to run my code and i'm unable to understand what it means and how to make it right.

C:\code\sentimentanalysis\venv\sentiment analysis\Scripts\python.exe" C:/code/sentimentanalysis/main.py Traceback (most recent call last):
File "C:/code/sentimentanalysis/main.py", line 1, in import sys,tweepy,csv,re File "C:\Users\Vermaaka\AppData\Local\Programs\Python\Python37\lib\site-packages\tweepy__init__.py", line 17, in from tweepy.streaming import Stream, StreamListener File "C:\Users\Vermaaka\AppData\Local\Programs\Python\Python37\lib\site-packages\tweepy\streaming.py", line 358 def _start(self, async): ^ SyntaxError: invalid syntax

Process finished with exit code 1


I have already installed all the packages before starting with this project. Please help.

2
  • Are you using python 3.7? If so, try using python 3.5? (Most modules are written for python 3.5, as python 3.7 is not officially released yet). The error indicates syntax error in streaming.py in the Tweepy package. This might be due to python 3.7? Commented Jul 20, 2018 at 11:30
  • Hi, thankyou so much for replying. I uninstalled Python 3.7 and installed Python 3.4. I added the path ans path variable for the same and deleted the previous variables and path. However, now by running my code it shows: "C:\code\sentimentanalysis\venv\sentiment analysis\Scripts\python.exe" C:/code/sentimentanalysis/main.py Fatal Python error: initfsencoding: unable to load the file system codec ModuleNotFoundError: No module named 'encodings' Current thread 0x00002f6c (most recent call first): Process finished with exit code -1073740791 (0xC0000409) Commented Jul 23, 2018 at 7:23

1 Answer 1

1

async is a reserved keyword from Python 3.7, which is why it raises a SyntaxError.

You should use python 3.6 (or lower) with Tweepy.

Python 3.7 is not supported by Tweepy.

Sign up to request clarification or add additional context in comments.

3 Comments

Hi, thankyou so much for replying. I uninstalled Python 3.7 and installed Python 3.4. I added the path ans path variable for the same and deleted the previous variables and path. However, now by running my code it shows: "C:\code\sentimentanalysis\venv\sentiment analysis\Scripts\python.exe" C:/code/sentimentanalysis/main.py Fatal Python error: initfsencoding: unable to load the file system codec ModuleNotFoundError: No module named 'encodings' Current thread 0x00002f6c (most recent call first): Process finished with exit code -1073740791 (0xC0000409)
Can I share my code with you maybe and could you try running it on your system. I've been stuck with this since days now.
This is a different error. It says that python cannot find a module named encodings installed. Maybe try what they suggest in here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.