1

I'm running python 2.7 on windows. Both python27 and python27/scripts are added to the PATH, which I've verified on the command line. I used easy_install to download SOAPpy, and I have a simple python program that calls import SOAPpy at the top.

On the command line, running

python sample.py

works, as does importing in the interpreter. However running simply

sample.py

Tells me:

ImportError: No module named SOAPpy

I'm sure this is some sort of path error, but I don't understand what's going wrong. What's the difference between these two calls and how do I fix the issue? I'm sure this is a really newbie question but I'm not sure what to google. The fact that it works in the interpreter is making me scratch my head.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Jay Lemmon
  • 1,158
  • 1
  • 8
  • 22
  • 3
    Looks like a *different* Python interpreter has been registered to handle `.py` files. See http://docs.python.org/2/faq/windows.html#how-do-i-make-python-scripts-executable – Martijn Pieters Dec 05 '13 at 19:45
  • Also see [Windows insists associating .py files with the wrong version of Python](http://superuser.com/q/606916). – Martijn Pieters Dec 05 '13 at 19:53
  • If you have python 3.3 installed your issue is probably as described in http://stackoverflow.com/questions/15912063/how-do-i-run-python-2-and-3-in-windows-7/17245543#17245543 take a look at the accepted answer. – Steve Barnes Dec 05 '13 at 20:22
  • Indeed, looks like I had a python 2.7 install on a different drive that was executing the script. Calling 'import site; print (site.getsitepackages())' helped me track down where the different environments were running from – Jay Lemmon Dec 06 '13 at 22:04

0 Answers0