It wasn't able to find the module because PYTHONPATH was only set for the
terminal in which you ran the export command. You will need to set it in
your .bashrc (or equivalent) to enable it for all terminals.

To see the current value from within the Python interpreter, do "import
sys" and then "print(sys.path)". This shows all of the directories searched
for openbabel.py. You can also edit sys.path from within Python.

- Noel

On Fri, 11 Jan 2019 at 02:55, Tayeb Kakeshpour <tayeb...@gmail.com> wrote:

> I suggest installing openbabel through anaconda which solved a similar
> issue for me. For that, you will need two steps:
>
> 1) Install anaconda: google how to do this. The installation is designed
> to be simple, so users with less experience with Linux can use it.
> 2) after installation of anaconda, type “conda install -c openbabel
> openbabel” in your terminal. You could also google the second step.
>
> After this you will have obabel working both with terminal and python.
>
> I did this last year and everything went through smoothly. I hope it works
> for you too.
>
> -Tayeb
>
> Tayeb Kakeshpour
> Graduate Research Assistant
> Jackson Research Group
> Michigan State University
> Department of Chemistry
> 578 S. Shaw Lane, room 535
> East Lansing, MI 48824
> kakes...@msu.edu
>
>
>
> On Jan 8, 2019, at 10:49 AM, Ruben Kuiper <ruben.kui...@hotmail.com>
> wrote:
>
> Hi there,
>
> I'm trying to install Open Babel 2.4.1 on Fedora 29 and then access it
> through Python 2.7.15, but when I try to I receive the following error
> message: ImportError: No module named openbabel.
> I'm pretty sure I did not receive any error messages during the
> installation, so I'm wondering where it went wrong.
> These are the commands I ran in order to install Open Babel, after downloading
> and extracting Eigen 3.3.7 and downloading openbabel-2.4.1.tar.gz:
>
> $ *tar zxf openbabel-2.4.1.tar.gz*
> *$ mkdir build*
> *$ cd build*
> *$ cmake ../openbabel-2.4.1
> -DEIGEN3_INCLUDE_DIR=/home/my_name/Downloads/eigen-eigen-323c052e1731
> -DEIGEN3_VERSION_OK=ON -DPYTHON_BINDINGS=ON
> -DPYTHON_INCLUDE_DIR=/usr/include/python2.7
> -DPYTHON_LIBRARY=/usr/lib64/python2.7/config/libpython2.7.so
> <http://libpython2.7.so>*
> *$ make*
> *$ sudo make install*
> *$ export PYTHONPATH=/usr/local/lib:$PYTHONPATH*
>
> After that I opened Python in Terminal and received the aforementioned
> error message by entering "import openbabel".
> Any ideas on how I might fix this problem?
>
> Thanks in advance,
>
> Ruben.
>
> PS: I'm not very experienced with Linux or programming, so please keep
> that in mind when trying to explain something.
>
> _______________________________________________
> OpenBabel-discuss mailing list
> OpenBabel-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>
> _______________________________________________
> OpenBabel-discuss mailing list
> OpenBabel-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to