0

When i import below code in terminal thats fine

import pokitdok

but when i try that in pycharm i get below error

Traceback (most recent call last):
File "/home/rponnapureddy/Desktop/ramnath/pok.py", line 3, in <module>
import pokitdok
File "/home/rponnapureddy/Desktop/ramnath/pokitdok.py", line 30, in  <module>
url = json.loads(url)
File "/usr/local/lib/python2.7/dist-packages/simplejson/__init__.py",  line 505, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python2.7/dist-packages/simplejson/decoder.py", line 370, in decode
obj, end = self.raw_decode(s)
File "/usr/local/lib/python2.7/dist-packages/simplejson/decoder.py", line 400, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
simplejson.scanner.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

already installed simple json also sudo pip install simplejson and one more thing is in terminal and pycharm both using same python version 2.7.6 only then why did that error

jedwards
  • 29,432
  • 3
  • 65
  • 92
ram
  • 73
  • 1
  • 7
  • We'd need to see the contents of `/home/rponnapureddy/Desktop/ramnath/pokitdok.py` (as well as the contents of whatever json you're trying to decode) -- but looks like you have a malformed json. – jedwards Mar 16 '15 at 09:51
  • 2
    Are you trying to pass a *URL* to `json.loads()` there? `json.loads()` cannot load data from the web for you, you'd need to load it with another library first, then pass the *resulting downloaded text* into that function instead. – Martijn Pieters Mar 16 '15 at 09:54
  • See [Python urllib2: Receive JSON response from url](https://stackoverflow.com/q/13921910) – Martijn Pieters Mar 16 '15 at 09:55
  • i did not try any json functions . when i import "import pokidik" i got above error – ram Mar 16 '15 at 10:17
  • `File "/home/rponnapureddy/Desktop/ramnath/pokitdok.py", line 30, in url = json.loads(url)` says that you did try to do it inside pokidik – irqed Mar 16 '15 at 11:23

0 Answers0