Forums

ImportError: No module named prawcore.exceptions

I get this error when trying to run my script. It mentions line 8, which is this:

from prawcore.exceptions import PrawcoreException

Here are all the include statements:

1
2
3
4
5
6
7
8
9
#!/usr/bin/python
import praw
import pickle
import signal
import sys
import os
import datetime
from prawcore.exceptions import PrawcoreException
import time

Which version of Python are you using? I think we only have prawcore installed by default for Python 3.6. If you're using a different Python version, you can install new modules by following these instructions.

I'm using 3.6

.

05:31 ~ $ python --version
Python 2.7.6
05:31 ~ $ pip2.7 install --user praw
Requirement already satisfied (use --upgrade to upgrade): praw in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied (use --upgrade to upgrade): six==1.10 in /usr/local/lib/python2.7/dist-packages 
(from praw)
Requirement already satisfied (use --upgrade to upgrade): decorator<4.1,>=4.0.9 in /usr/local/lib/python2.7/dist- 
packages (from praw)
Requirement already satisfied (use --upgrade to upgrade): requests>=2.3.0 in /usr/local/lib/python2.7/dist- 
packages (from praw)
Requirement already satisfied (use --upgrade to upgrade): update-checker==0.11 in 
/usr/local/lib/python2.7/dist-packages (from praw)
05:37 ~ $ pip install --user praw                                                                                                       
Requirement already satisfied (use --upgrade to upgrade): praw in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied (use --upgrade to upgrade): six==1.10 in /usr/local/lib/python2.7/dist-packages 
(from praw)
Requirement already satisfied (use --upgrade to upgrade): decorator<4.1,>=4.0.9 in /usr/local/lib/python2.7/dist- 
packages (from praw)
Requirement already satisfied (use --upgrade to upgrade): requests>=2.3.0 in /usr/local/lib/python2.7/dist- 
packages (from praw)
Requirement already satisfied (use --upgrade to upgrade): update-checker==0.11 in 
/usr/local/lib/python2.7/dist-packages (from praw)

[edit by admin: formatting]

Are you running it from the editor? Or from a bash command line? If it's the latter, could you try running pip3.6 show prawcore and let us know what it prints out?

Ah, I see that you did actually try to post that information earlier and it got caught in a spam filter. I've unspammed it now, so it appears above my previous post.

I believe that prawcore is a different package, so you'll need to install it separately if you're using Python 2.7:

pip2.7 install --user prawcore

Ok i installed it but now i get this error:

exception __init__() got multiple values for keyword argument 'user_agent'

You're passing the user_agent keyword argument into a constructor multiple times. Find the line that that exception is pointing to and remove one of the user_agent= arguments.

I'm not passing the user_agent keyword argument into a constructor multiple times

Ok, then look at the traceback and follow the execution back to try to work out where the extra argument is coming from .