Python path in post-processing is wrong, "import [module] failed"
Version: 0.5 RC3-RC6
OS: OS X Leopard, OS X Snow Leopard
Install-type: OSx .app
Skin (if applicable): Plush
Firewall Software: None
Are you using IPV6? no
Is the issue reproducible? yes
I have two systems, one running Leopard (Python v2.5) and the other Snow Leopard (python v2.6). It used to be only the Snow Leopard machine that gave me problems running Python scripts, now it is happening on both systems.
I get these errors on most Python modules that need to be imported. I've seen these errors throughout the forum.
Code: Select all
'import site' failed; use -v for traceback
Traceback (most recent call last):
File "/Users/zakharm/Documents/scripts/xbmc2.py", line 4, in <module>
import urllib, sys
ImportError: No module named urllib
#!/usr/bin/env python
import urllib, sys
urllib.urlopen("http://192.168.2.51:3000/xbmcCmds/xbmcHttp?command=ExecBuiltIn¶meter=XBMC.updatelibrary(video)")
http://forums.sabnzbd.org/index.php?topic=3451.0
Solution from imthenachoman:
I was having same problem. I had to change the python path used by SabNZBD.
Look near the top middle of imthenachnoman's code:
http://forums.sabnzbd.org/index.php?topic=3562.msg25576
Code: Select all
import sys
# This script does not work well with the current default python path SabNZBD sets
# Set it to the same python path as OS X defaults
osx_python_path = [
sys.path[0],
"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python26.zip",
"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6",
"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-darwin",
"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac",
"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac/lib-scriptpackages",
"/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python",
"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk",
"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-old",
"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload",
"/Library/Python/2.6/site-packages",
"/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/PyObjC",
"/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/wx-2.8-mac-unicode"
]
sys.path = osx_python_path