Do you have a copy of the Sword Python Bindings available for Python 2.5 on XP? I tried placing the _Sword.pyd file and Sword.pyo file from your Windows distribution in site-packages but Python cannot find the Sword module. |
|||
|
BPBibleFlexible Bible Study |
User loginNavigation |
|
The .pyo file is the
The .pyo file is the optimized version; running python -O will pick it up.
If you copy it to Sword.pyc it should work. If it doesn't I can send you the .pyc file.
Thanks, but now get errors
Thanks, that seems to work for finding the module, but when running bpbible.py I get this error,
Traceback (most recent call last):
File "C:/Scripts/bpbible-0.4/bpbible.py", line 29, in
import config, guiconfig
File "C:\Scripts\bpbible-0.4\config.py", line 118, in
from util.configmgr import ConfigManager
File "C:\Scripts\bpbible-0.4\util\configmgr.py", line 7, in
from swlib.pysw import SW
File "C:\Scripts\bpbible-0.4\swlib\pysw.py", line 36, in
TOP = SW.SW_POSITION(POS_TOP)
AttributeError: 'module' object has no attribute 'SW_POSITION'
I have tried with line 36 commented out but it still hangs on the next SW call.
Tim
Try the Sword.py file here
Try the Sword.py file here (and remove the Sword.pyc):
http://benpmorgan.googlepages.com/Sword.py
That got it!
Thanks. Bpbible will now open. This saves me the hassle of trying to compile the sword.pyd file with SWIG. Bpbible is a helpful app.
Tim
Sword Python Bindings
I have also tried to run the python source and have run into the following error. Any ideas?
I pulled the _sword.pyd file out of the windows distribution and put it in the swlib folder which got me past an error in line 7 of the sword.py pgm. I also downloaded the sword.py file mentioned before and deleted the sword.pyc. here is the python run output:
>>>
21:28:08 Importing wx
21:28:08 importing wx.xrc
21:28:08 /importing wx
Traceback (most recent call last):
File "C:\BP\bpbible-0.4.5\bpbible.py", line 29, in
import config, guiconfig
File "C:\BP\bpbible-0.4.5\config.py", line 1, in
from backend.verse_template import VerseTemplate, SmartVerseTemplate
File "C:\BP\bpbible-0.4.5\backend\verse_template.py", line 3, in
from swlib.pysw import process_digits
File "C:\BP\bpbible-0.4.5\swlib\pysw.py", line 1, in
import Sword as SW
File "C:\BP\bpbible-0.4.5\swlib\Sword.py", line 74, in
ENC_SCSU = _Sword.ENC_SCSU
AttributeError: 'module' object has no attribute 'ENC_SCSU'
>>>
That one was out of date;
That one was out of date; I've uploaded a new file to the same place.
Slightly closer
Hi,
That updated code got me just a little bit closer. Here is my program output. Could it be I need an updated _Sword.pyd in the swlib? thanks for the help
>>>
21:33:01 Importing wx
21:33:02 importing wx.xrc
21:33:02 /importing wx
Traceback (most recent call last):
File "C:\BP\bpbible-0.4.5\bpbible.py", line 29, in
import config, guiconfig
File "C:\BP\bpbible-0.4.5\config.py", line 1, in
from backend.verse_template import VerseTemplate, SmartVerseTemplate
File "C:\BP\bpbible-0.4.5\backend\verse_template.py", line 3, in
from swlib.pysw import process_digits
File "C:\BP\bpbible-0.4.5\swlib\pysw.py", line 7, in
from util.unicode import to_str, to_unicode
File "C:\BP\bpbible-0.4.5\util\unicode.py", line 1, in
import Sword as SW
ImportError: No module named Sword
>>>
Are you sure that the
Are you sure that the Sword.py file is sitting in your python path somewhere? That error message means that it couldn't find the Sword.py file.
Have you put the Sword.py file in the swlib folder? If so, you should probably put it in the base level folder, or in the python site-packages directory.
Working now
Thanks for the tip. I moved both sword.py and _sword.pyd to C:\Python25\Lib\site-packages. Then I added c:\python25 and the path to my base bpbible directory to the path. now it is working great. Thanks for the help.
SWIG files for python 2.6
Hi Ben
do you have the Sword.py and _Sword.pyd for a python2.6 distro? Using the same files that worked with 2.5 produces the following error:
C:\BP\bpbible-0.4.5>python bpbible.py
08:30:13 Importing wx
08:30:13 importing wx.xrc
08:30:13 /importing wx
Traceback (most recent call last):
File "bpbible.py", line 29, in
import config, guiconfig
File "C:\BP\bpbible-0.4.5\config.py", line 1, in
from backend.verse_template import VerseTemplate, SmartVerseTemplate
File "C:\BP\bpbible-0.4.5\backend\verse_template.py", line 3, in
from swlib.pysw import process_digits
File "C:\BP\bpbible-0.4.5\swlib\pysw.py", line 1, in
import Sword as SW
File "C:\python26\lib\site-packages\Sword.py", line 25, in
_Sword = swig_import_helper()
File "C:\python26\lib\site-packages\Sword.py", line 24, in swig_import_helper
return _mod
UnboundLocalError: local variable '_mod' referenced before assignment
Thanks for your help
Tim
Try the files
Try the files here:
http://sites.google.com/site/benpmorgan/Sword-py2.6.zip?attredirects=0
Sword Python bindings for 2.6
Those binding programs worked...
Thanks