-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
parse error #20
Comments
Hey @prasadseemakurthi, I'd like to understand the issue please? What error did you get? What Python version are you using? |
I receive the following error when entering the pvenv alias: The alias setting is: alias pvenv='virtualenv -p /Users/orlandov/anaconda/bin/python venv' As you can see, I have anaconda installed. Could I proceed with the assignment, but just not have my Twitter API keys as part of my activate script? Just have them listed in my python code? I know its not the secure way, but I will delete them once I am done with the assignment. Unless you can see from my error message what could be the cause, and the solution. Thanks, |
Hey Orlando, Do you also have Python natively installed as well? If so you can try to create a virtual environment with Using a virtual env is recommended to not clutter your global env with project specific packages (in this case For the keys you could consider setting them in your Btw let me know if you have any issues creating an app through the Twitter API obtaining keys, because it seems Twitter made this less accessible recently :( Let me know if I can help you further to progress this lesson. HTH |
Bob, I have Anaconda install and running python -m venv venv gives me the same error that you received in the video: As for obtaining keys from Twitter API, there is an additional form to fill out before they grant you the information. I will proceed with using Anaconda. I was able to install tweepy and wordcloud. I will figure out how to set my keys in an conda virtual environment. Hopefully its as easy as setting them in a virtualenv environment. Thanks |
I was able to set up my conda virtual environment variables by following the steps: https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#saving-environment-variables |
Hey Orlando, glad you got that part working. I forgot to share Martin's article about Anaconda including using its Did Twitter grant you app permissions? I heard others did not get a quick respond or were rejected, so just curious. Cheers |
Hey Bob, Thanks for Martin's article. Twitter response is around 25 to 30 seconds for the get_tweets function. |
Hey @oviera5 how is it going? Anything we need to fix here? |
The default code throws an error and below code fixes it
def get_movies_by_director():
directors = defaultdict(list)
with open(MOVIE_DATA, encoding='utf-8') as f:
for line in csv.DictReader(f):
try:
director = line['director_name']
movie = line['movie_title'].replace('\xa0', '')
if line['title_year']:
year = int(line['title_year'])
else:
year = 0
if line['imdb_score']:
score = float(line['imdb_score'])
else:
score = 0
except ValueError:
continue
The text was updated successfully, but these errors were encountered: