0

I've compiled a ".proto" file using protoc. When I try to use it, it says I needed google.protobuf installed. I downloaded and extracted the file (source), and I've successfuly installed it using python setup.py install. When I try to import the module, it says it doesn't exist. I can't figure out why.

Edit: Using Python 2.7.6

Martin Thoma
  • 124,992
  • 159
  • 614
  • 958
Sam1342
  • 23
  • 3
  • 1) check your python's `sys.path`, vs where the installer put protobuf. 2) consider using `virtualenv` -- it makes installing packages easier, and ensures that a specific Python can find a specific library it uses. – johntellsall Jun 14 '14 at 18:43
  • what os are you using? – Padraic Cunningham Jun 14 '14 at 18:43
  • I don't want to setup virtual env just for this module. Also, I've installed modules before, I'm just trying to understand why this isn't working. – Sam1342 Jun 14 '14 at 18:50
  • @PadraicCunningham I'm using Windows 8. – Sam1342 Jun 14 '14 at 18:51
  • **Always** use virtualenv. Anything else is plain wrong and would lead you to different and strange problems. python 3 even has this functionality baked into the standard library. For this question sake, try to run a python shell (in the same env) and try importing the module. if you can't do that, then you did something wrong with the module installation – alonisser Jun 14 '14 at 18:55
  • @alonisser, why would you always have to use virtualenv? – Padraic Cunningham Jun 14 '14 at 18:56
  • 1
    @PadraicCunningham the long answer: https://medium.com/@alonisser/things-i-wish-pip-learned-from-npm-f712fa26f5bc The short answer is already in shavenwarthog first comment. It's the only way you can protect your self from system installed packages, dependency hell etc – alonisser Jun 14 '14 at 18:58
  • @alonisser I can't import the module. I'm pretty sure I did everything right, as I have done it before, and it seemed like it installed okay. I tested and built it and everything worked as it should, I just can't figure out either where it is or what it's called. Have any idea's on what I should do? Would it help to show the installation code? – Sam1342 Jun 14 '14 at 19:04

0 Answers0