Problem importing modeller and _modeller modules
Hi, I'm trying to import modeller modules to python in order to create custom scripts for my needs. When I used the 32bit version of ubuntu (or debian), it works perfectly. When I try to run the same script in a 64bit OS, python cant find modeller. I added /usr/lib/modeller9.12/modlib/ to python path, and python can import modeller, but in the /usr/lib/modeller9.12/modlib/modeller/__init__.py it tries to import _modeller module, and that one I cant find/add.
I also added LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib/modeller9.12/modlib", with no success.
I'm using ubuntu 13.04 64bit, but I have this same problem in some other distros, like Mint linux (even 32bit on this one).
How can I locate and add the _modeller module to my pythonpath?
Thanks in advance
On 10/18/13 7:08 AM, Gustavo Machado Alvares de Lima wrote: > Hi, I'm trying to import modeller modules to python in order to create > custom scripts for my needs. When I used the 32bit version of ubuntu (or > debian), it works perfectly. When I try to run the same script in a > 64bit OS, python cant find modeller.
Did you install the .deb package? That should have made suitable symlinks so that everything works without any need for setting random environment variables (obviously you need to install the 32-bit .deb on a 32-bit system, and the 64-bit .deb on a 64-bit system). The .deb files are produced on an Ubuntu 9.10 system, but the Ubuntu folks do have a tendency to move the Python paths around between releases.
> in the /usr/lib/modeller9.12/modlib/modeller/__init__.py it tries to import > _modeller module, and that one I cant find/add.
If you want to go down this route, you'll have to add the directory that contains _modeller.so to your Python path as well. Setting LD_LIBRARY_PATH won't help here, because Python doesn't look in that path.
> I'm using ubuntu 13.04 64bit, but I have this same problem in some other > distros, like Mint linux (even 32bit on this one).
Did you install the RPM on your Mint system?
Ben Webb, Modeller Caretaker
Hi Ben,
I installed the .deb package 64bit, but for some reason it couldn't set pythonpaths correctly. I could solve the problem by adding to paths to pythonpath as you said, as follows:
export PYTHONPATH='$PYTHONPATH:/usr/lib/modeller9.12/lib/x86_64-intel8'' export PYTHONPATH='$PYTHONPATH:/usr/lib/modeller9.12/modlib/''
And that solved import problems, but a python problem (listed as bug since python 2.6) showed up:
undefined symbol: Py_InitModule4
And this was easily solved by editing line 113 in the /usr/include/python2.7/modsupport.h to
#define Py_InitModule4 Py_InitModule4_64
In Mint, I also installed .deb package, but I did not tested above solution yet, but it will probably work.
Thanks for your help.
Att, Gustavo Lima
On Fri, Oct 18, 2013 at 1:43 PM, Modeller Caretaker < modeller-care@salilab.org> wrote:
> On 10/18/13 7:08 AM, Gustavo Machado Alvares de Lima wrote: > >> Hi, I'm trying to import modeller modules to python in order to create >> custom scripts for my needs. When I used the 32bit version of ubuntu (or >> debian), it works perfectly. When I try to run the same script in a >> 64bit OS, python cant find modeller. >> > > Did you install the .deb package? That should have made suitable symlinks > so that everything works without any need for setting random environment > variables (obviously you need to install the 32-bit .deb on a 32-bit > system, and the 64-bit .deb on a 64-bit system). The .deb files are > produced on an Ubuntu 9.10 system, but the Ubuntu folks do have a tendency > to move the Python paths around between releases. > > > in the /usr/lib/modeller9.12/modlib/**modeller/__init__.py it tries to >> import >> _modeller module, and that one I cant find/add. >> > > If you want to go down this route, you'll have to add the directory that > contains _modeller.so to your Python path as well. Setting LD_LIBRARY_PATH > won't help here, because Python doesn't look in that path. > > > I'm using ubuntu 13.04 64bit, but I have this same problem in some other >> distros, like Mint linux (even 32bit on this one). >> > > Did you install the RPM on your Mint system? > > Ben Webb, Modeller Caretaker > -- > modeller-care@salilab.org http://www.salilab.org/**modeller/http://www.salilab.org/modeller/ > Modeller mail list: http://salilab.org/mailman/**listinfo/modeller_usagehttp://salilab.org/mailman/listinfo/modeller_usage >
On 10/18/13 9:04 PM, Gustavo Machado Alvares de Lima wrote: > Hi Ben, > > I installed the .deb package 64bit, but for some reason it couldn't set > pythonpaths correctly. I could solve the problem by adding to paths to > pythonpath as you said, as follows: > > export PYTHONPATH='$PYTHONPATH:/usr/lib/modeller9.12/lib/x86_64-intel8'' > export PYTHONPATH='$PYTHONPATH:/usr/lib/modeller9.12/modlib/'' > > And that solved import problems, but a python problem (listed as bug > since python 2.6) showed up: > > undefined symbol: Py_InitModule4
Sounds like you're trying to load the Python 2.3 extension into a newer Python - that won't work (but isn't a Python bug - they just changed the interface between 2.4 and 2.5). Trying adding /usr/lib/modeller9.12/lib/x86_64-intel8/python2.5/ to your PYTHONPATH instead.
BTW, what is the default value of sys.path on your system Python?
Ben Webb, Modeller Caretaker
participants (2)
-
Gustavo Machado Alvares de Lima
-
Modeller Caretaker