Giter Site home page Giter Site logo

Comments (9)

ssalentin avatar ssalentin commented on May 20, 2024

Hi! Can you try starting python and just importing the pybel module? As I can see from the error log above, the problem result from an import there and not from openbabel, which is a different module.

from plip.

Darakah avatar Darakah commented on May 20, 2024

Python 2.7.10 (default, Oct 23 2015, 18:05:06)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

import pybel
Traceback (most recent call last):
File "", line 1, in
File "/Users/gaby/Library/Python/2.7/lib/python/site-packages/pybel/init.py", line 61, in
from . import canonicalize
File "/Users/gaby/Library/Python/2.7/lib/python/site-packages/pybel/canonicalize.py", line 14, in
from .parser.language import rev_abundance_labels
File "/Users/gaby/Library/Python/2.7/lib/python/site-packages/pybel/parser/init.py", line 5, in
from .parse_bel import BelParser
File "/Users/gaby/Library/Python/2.7/lib/python/site-packages/pybel/parser/parse_bel.py", line 16, in
from .modifiers import *
File "/Users/gaby/Library/Python/2.7/lib/python/site-packages/pybel/parser/modifiers/init.py", line 3, in
from .fragment import FragmentParser
File "/Users/gaby/Library/Python/2.7/lib/python/site-packages/pybel/parser/modifiers/fragment.py", line 59, in
from pyparsing import pyparsing_common as ppc, Keyword, Optional
ImportError: cannot import name pyparsing_common

thus i tried to install pybel using pip:

sudo -H pip install pybel
Password:
Collecting pybel
Downloading PyBEL-0.6.1.tar.gz (341kB)
100% |████████████████████████████████| 348kB 378kB/s
Collecting requests (from pybel)
Using cached requests-2.18.1-py2.py3-none-any.whl
Collecting requests_file (from pybel)
Using cached requests-file-1.4.2.tar.gz
Collecting networkx (from pybel)
Using cached networkx-1.11-py2.py3-none-any.whl
Requirement already satisfied: pyparsing in /usr/local/lib/python2.7/site-packages (from pybel)
Collecting py2neo (from pybel)
Using cached py2neo-3.1.2.tar.gz
Collecting click (from pybel)
Using cached click-6.7-py2.py3-none-any.whl
Collecting sqlalchemy (from pybel)
Using cached SQLAlchemy-1.1.11.tar.gz
Collecting onto2nx (from pybel)
Using cached onto2nx-0.1.0-py2.py3-none-any.whl
Collecting ndex (from pybel)
Using cached ndex-3.0.11.23-py2-none-any.whl
Collecting configparser (from pybel)
Downloading configparser-3.5.0.tar.gz
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/local/lib/python2.7/site-packages (from requests->pybel)
Collecting certifi>=2017.4.17 (from requests->pybel)
Using cached certifi-2017.4.17-py2.py3-none-any.whl
Collecting idna<2.6,>=2.5 (from requests->pybel)
Using cached idna-2.5-py2.py3-none-any.whl
Collecting urllib3<1.22,>=1.21.1 (from requests->pybel)
Using cached urllib3-1.21.1-py2.py3-none-any.whl
Collecting six (from requests_file->pybel)
Using cached six-1.10.0-py2.py3-none-any.whl
Collecting decorator>=3.4.0 (from networkx->pybel)
Using cached decorator-4.0.11-py2.py3-none-any.whl
Collecting SPARQLWrapper (from onto2nx->pybel)
Using cached SPARQLWrapper-1.8.0.zip
Collecting pygments (from onto2nx->pybel)
Using cached Pygments-2.2.0-py2.py3-none-any.whl
Collecting rdflib-jsonld (from onto2nx->pybel)
Using cached rdflib-jsonld-0.4.0.tar.gz
Collecting rdflib (from onto2nx->pybel)
Using cached rdflib-4.2.2.tar.gz
Collecting pyfiglet (from onto2nx->pybel)
Using cached pyfiglet-0.7.5.tar.gz
Collecting colorama (from onto2nx->pybel)
Using cached colorama-0.3.9-py2.py3-none-any.whl
Collecting requests-toolbelt (from ndex->pybel)
Using cached requests_toolbelt-0.8.0-py2.py3-none-any.whl
Collecting isodate (from rdflib->onto2nx->pybel)
Using cached isodate-0.5.4.tar.gz
Building wheels for collected packages: pybel, requests-file, py2neo, sqlalchemy, configparser, SPARQLWrapper, rdflib-jsonld, rdflib, pyfiglet, isodate
Running setup.py bdist_wheel for pybel ... done
Stored in directory: /var/root/Library/Caches/pip/wheels/54/c0/6a/dbeaf2c9edf054b04c45c3cf859788479f2393f275b1e47003
Running setup.py bdist_wheel for requests-file ... done
Stored in directory: /var/root/Library/Caches/pip/wheels/3e/34/3a/c2e634ca7b545510c1b3b7d94dea084e5fdb5f33558f3c3a81
Running setup.py bdist_wheel for py2neo ... done
Stored in directory: /var/root/Library/Caches/pip/wheels/72/76/d9/1dffb7c4c4161e2c0282b86d3e26df26ac442f17397c7bd44f
Running setup.py bdist_wheel for sqlalchemy ... done
Stored in directory: /var/root/Library/Caches/pip/wheels/ee/a7/64/0f699856164b752e1d398f9b7abc6c831074906fd10088932d
Running setup.py bdist_wheel for configparser ... done
Stored in directory: /var/root/Library/Caches/pip/wheels/1c/bd/b4/277af3f6c40645661b4cd1c21df26aca0f2e1e9714a1d4cda8
Running setup.py bdist_wheel for SPARQLWrapper ... done
Stored in directory: /var/root/Library/Caches/pip/wheels/3c/b6/36/90a0877c0a7ac2933a16c446b535af632831b3fd692e1910fe
Running setup.py bdist_wheel for rdflib-jsonld ... done
Stored in directory: /var/root/Library/Caches/pip/wheels/29/6e/5f/cfd2be5ff8aae1c451b13b38398b7951931dc04f2219b198b0
Running setup.py bdist_wheel for rdflib ... done
Stored in directory: /var/root/Library/Caches/pip/wheels/a3/b4/d6/fd8c885ff4bbb84ca5aaadfecb67a3cc23862550494a0cc577
Running setup.py bdist_wheel for pyfiglet ... done
Stored in directory: /var/root/Library/Caches/pip/wheels/22/64/50/061d962f0938800687c7d965aec42c3c3b5344634f2242f3d8
Running setup.py bdist_wheel for isodate ... done
Stored in directory: /var/root/Library/Caches/pip/wheels/61/c0/d2/6b4a10c222ba9261ab9872a8f05d471652962284e8c677e5e7
Successfully built pybel requests-file py2neo sqlalchemy configparser SPARQLWrapper rdflib-jsonld rdflib pyfiglet isodate
Installing collected packages: certifi, idna, urllib3, requests, six, requests-file, decorator, networkx, py2neo, click, sqlalchemy, isodate, rdflib, SPARQLWrapper, pygments, rdflib-jsonld, pyfiglet, colorama, onto2nx, requests-toolbelt, ndex, configparser, pybel
Successfully installed SPARQLWrapper-1.8.0 certifi-2017.4.17 click-6.7 colorama-0.3.9 configparser-3.5.0 decorator-4.0.11 idna-2.5 isodate-0.5.4 ndex-3.0.11.23 networkx-1.11 onto2nx-0.1.0 py2neo-3.1.2 pybel-0.6.1 pyfiglet-0.7.5 pygments-2.2.0 rdflib-4.2.2 rdflib-jsonld-0.4.0 requests-2.18.1 requests-file-1.4.2 requests-toolbelt-0.8.0 six-1.10.0 sqlalchemy-1.1.11 urllib3-1.21.1

then tried importing pybel again (obtained same error):

Python 2.7.10 (default, Oct 23 2015, 18:05:06)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

import pybel
Traceback (most recent call last):
File "", line 1, in
File "/Users/gaby/Library/Python/2.7/lib/python/site-packages/pybel/init.py", line 61, in
from . import canonicalize
File "/Users/gaby/Library/Python/2.7/lib/python/site-packages/pybel/canonicalize.py", line 14, in
from .parser.language import rev_abundance_labels
File "/Users/gaby/Library/Python/2.7/lib/python/site-packages/pybel/parser/init.py", line 5, in
from .parse_bel import BelParser
File "/Users/gaby/Library/Python/2.7/lib/python/site-packages/pybel/parser/parse_bel.py", line 16, in
from .modifiers import *
File "/Users/gaby/Library/Python/2.7/lib/python/site-packages/pybel/parser/modifiers/init.py", line 3, in
from .fragment import FragmentParser
File "/Users/gaby/Library/Python/2.7/lib/python/site-packages/pybel/parser/modifiers/fragment.py", line 59, in
from pyparsing import pyparsing_common as ppc, Keyword, Optional
ImportError: cannot import name pyparsing_common

obtained same error.

Python version issue?

i don't know if this is the reason however
if i use python 2.7.10

Python 2.7.10 (default, Oct 23 2015, 18:05:06)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

from pyparsing import pyparsing_common
Traceback (most recent call last):
File "", line 1, in
ImportError: cannot import name pyparsing_common

using python 3.6

python3
Python 3.6.0 (v3.6.0:41df79263a11, Dec 22 2016, 17:23:13)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

from pyparsing import pyparsing_common

i went to the location of each of the 2 pyparsing.py (for 2.7 and for 3) and did
grep pyparsing_common pyparsing.py

i didn't find any hits in the 2.7 pyparsing.py while found a lot of hits in 3.6 pyparsing.py

thus i tried to remove the 2.7 pyparsing.py and re-install a new version (however, permission denied even when i changed user and loged as root) and when i tried changing it manually (copying the 3.6 version) "file not available to writing" although i have rw-------
thus i doubt this might be the problem?

i couldn't use the 3.6 python version because using 3.6 openbabel for some reason does not install properly that is why i am using 2.7. this is the error that i obtain when i try.

pip3.6 install --ignore-installed plip
Collecting plip
Using cached plip-1.3.0.tar.gz
Collecting openbabel (from plip)
Using cached openbabel-2.4.1.tar.gz
Collecting numpy (from plip)
Using cached numpy-1.13.0-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Collecting lxml (from plip)
Using cached lxml-3.8.0-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Installing collected packages: openbabel, numpy, lxml, plip
Running setup.py install for openbabel ... error
Complete output from command /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;file='/private/var/folders/nz/v_szcmrx6fn3tww6c1xlzt5w0000gn/T/pip-build-9koal6v_/openbabel/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /var/folders/nz/v_szcmrx6fn3tww6c1xlzt5w0000gn/T/pip-j6r3agxu-record/install-record.txt --single-version-externally-managed --compile:
running install
running build_ext
Open Babel location automatically determined by pkg-config:
- include_dirs: ['/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m', '/usr/local/include/openbabel-2.0']
- library_dirs: ['/usr/local/lib']
building '_openbabel' extension
swigging openbabel-python.i to openbabel-python_wrap.cpp
swig -python -c++ -small -O -templatereduce -naturalvar -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -I/usr/local/include/openbabel-2.0 -o openbabel-python_wrap.cpp openbabel-python.i
/usr/local/include/openbabel-2.0/openbabel/obconversion.h:369: Warning 325: Nested struct not currently supported (StreamState ignored)
/usr/local/include/openbabel-2.0/openbabel/isomorphism.h:159: Warning 325: Nested class not currently supported (Functor ignored)
/usr/local/include/openbabel-2.0/openbabel/spectrophore.h:571: Warning 312: Nested struct not currently supported (ignored).
/usr/local/include/openbabel-2.0/openbabel/spectrophore.h:578: Warning 312: Nested struct not currently supported (ignored).
creating build
creating build/temp.macosx-10.6-intel-3.6
/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -I/usr/local/include/openbabel-2.0 -c openbabel-python_wrap.cpp -o build/temp.macosx-10.6-intel-3.6/openbabel-python_wrap.o
In file included from openbabel-python_wrap.cpp:3394:
/usr/local/include/openbabel-2.0/openbabel/griddata.h:74:12: warning: 'OpenBabel::OBGridData::GetValue' hides overloaded virtual function [-Woverloaded-virtual]
double GetValue(int i, int j, int k) const;
^
/usr/local/include/openbabel-2.0/openbabel/base.h:229:32: note: hidden overloaded virtual function 'OpenBabel::OBGenericData::GetValue' declared here: different number of parameters (0 vs 3)
virtual const std::string &GetValue() const
^
In file included from openbabel-python_wrap.cpp:3394:
/usr/local/include/openbabel-2.0/openbabel/griddata.h:76:12: warning: 'OpenBabel::OBGridData::GetValue' hides overloaded virtual function [-Woverloaded-virtual]
double GetValue (vector3 pos) const;
^
/usr/local/include/openbabel-2.0/openbabel/base.h:229:32: note: hidden overloaded virtual function 'OpenBabel::OBGenericData::GetValue' declared here: different number of parameters (0 vs 1)
virtual const std::string &GetValue() const
^
In file included from openbabel-python_wrap.cpp:3400:
/usr/local/include/openbabel-2.0/openbabel/reaction.h:39:15: error: no member named 'shared_ptr' in namespace 'std'
std::vector<obsharedptr > _reactants;
^~~~~~~~~~~
/usr/local/include/openbabel-2.0/openbabel/shared_ptr.h:25:23: note: expanded from macro 'obsharedptr'
#define obsharedptr OB_SHARED_PTR_IMPLEMENTATION
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/openbabel-2.0/openbabel/babelconfig.h:153:43: note: expanded from macro 'OB_SHARED_PTR_IMPLEMENTATION'
#define OB_SHARED_PTR_IMPLEMENTATION std::shared_ptr
~~~~~^
In file included from openbabel-python_wrap.cpp:3400:
/usr/local/include/openbabel-2.0/openbabel/reaction.h:39:27: error: 'OBMol' does not refer to a value
std::vector<obsharedptr > _reactants;
^
/usr/local/include/openbabel-2.0/openbabel/mol.h:107:14: note: declared here
class OBAPI OBMol: public OBBase
^
In file included from openbabel-python_wrap.cpp:3400:
/usr/local/include/openbabel-2.0/openbabel/reaction.h:39:34: error: expected member name or ';' after declaration specifiers
std::vector<obsharedptr > _reactants;
^
/usr/local/include/openbabel-2.0/openbabel/reaction.h:40:15: error: no member named 'shared_ptr' in namespace 'std'
std::vector<obsharedptr > _products;
^~~~~~~~~~~
/usr/local/include/openbabel-2.0/openbabel/shared_ptr.h:25:23: note: expanded from macro 'obsharedptr'
#define obsharedptr OB_SHARED_PTR_IMPLEMENTATION
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/openbabel-2.0/openbabel/babelconfig.h:153:43: note: expanded from macro 'OB_SHARED_PTR_IMPLEMENTATION'
#define OB_SHARED_PTR_IMPLEMENTATION std::shared_ptr
~~~~~^
In file included from openbabel-python_wrap.cpp:3400:
/usr/local/include/openbabel-2.0/openbabel/reaction.h:40:27: error: 'OBMol' does not refer to a value
std::vector<obsharedptr > _products;
^
/usr/local/include/openbabel-2.0/openbabel/mol.h:107:14: note: declared here
class OBAPI OBMol: public OBBase
^
In file included from openbabel-python_wrap.cpp:3400:
/usr/local/include/openbabel-2.0/openbabel/reaction.h:40:34: error: expected member name or ';' after declaration specifiers
std::vector<obsharedptr > _products;
^
/usr/local/include/openbabel-2.0/openbabel/reaction.h:41:3: error: no type named 'shared_ptr' in namespace 'std'
obsharedptr _ts;
^~~~~~~~~~~
/usr/local/include/openbabel-2.0/openbabel/shared_ptr.h:25:23: note: expanded from macro 'obsharedptr'
#define obsharedptr OB_SHARED_PTR_IMPLEMENTATION
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/openbabel-2.0/openbabel/babelconfig.h:153:43: note: expanded from macro 'OB_SHARED_PTR_IMPLEMENTATION'
#define OB_SHARED_PTR_IMPLEMENTATION std::shared_ptr
~~~~~^
In file included from openbabel-python_wrap.cpp:3400:
/usr/local/include/openbabel-2.0/openbabel/reaction.h:41:14: error: expected member name or ';' after declaration specifiers
obsharedptr _ts;
~~~~~~~~~~~^
/usr/local/include/openbabel-2.0/openbabel/reaction.h:42:3: error: no type named 'shared_ptr' in namespace 'std'
obsharedptr _agent;
^~~~~~~~~~~
/usr/local/include/openbabel-2.0/openbabel/shared_ptr.h:25:23: note: expanded from macro 'obsharedptr'
#define obsharedptr OB_SHARED_PTR_IMPLEMENTATION
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/openbabel-2.0/openbabel/babelconfig.h:153:43: note: expanded from macro 'OB_SHARED_PTR_IMPLEMENTATION'
#define OB_SHARED_PTR_IMPLEMENTATION std::shared_ptr
~~~~~^
In file included from openbabel-python_wrap.cpp:3400:
/usr/local/include/openbabel-2.0/openbabel/reaction.h:42:14: error: expected member name or ';' after declaration specifiers
obsharedptr _agent;
~~~~~~~~~~~^
/usr/local/include/openbabel-2.0/openbabel/reaction.h:56:26: error: no type named 'shared_ptr' in namespace 'std'
void AddReactant(const obsharedptr sp)
^~~~~~~~~~~
/usr/local/include/openbabel-2.0/openbabel/shared_ptr.h:25:23: note: expanded from macro 'obsharedptr'
#define obsharedptr OB_SHARED_PTR_IMPLEMENTATION
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/openbabel-2.0/openbabel/babelconfig.h:153:43: note: expanded from macro 'OB_SHARED_PTR_IMPLEMENTATION'
#define OB_SHARED_PTR_IMPLEMENTATION std::shared_ptr
~~~~~^
In file included from openbabel-python_wrap.cpp:3400:
/usr/local/include/openbabel-2.0/openbabel/reaction.h:56:37: error: expected ')'
void AddReactant(const obsharedptr sp)
^
/usr/local/include/openbabel-2.0/openbabel/reaction.h:56:19: note: to match this '('
void AddReactant(const obsharedptr sp)
^
/usr/local/include/openbabel-2.0/openbabel/reaction.h:59:25: error: no type named 'shared_ptr' in namespace 'std'
void AddProduct(const obsharedptr sp)
^~~~~~~~~~~
/usr/local/include/openbabel-2.0/openbabel/shared_ptr.h:25:23: note: expanded from macro 'obsharedptr'
#define obsharedptr OB_SHARED_PTR_IMPLEMENTATION
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/openbabel-2.0/openbabel/babelconfig.h:153:43: note: expanded from macro 'OB_SHARED_PTR_IMPLEMENTATION'
#define OB_SHARED_PTR_IMPLEMENTATION std::shared_ptr
~~~~~^
In file included from openbabel-python_wrap.cpp:3400:
/usr/local/include/openbabel-2.0/openbabel/reaction.h:59:36: error: expected ')'
void AddProduct(const obsharedptr sp)
^
/usr/local/include/openbabel-2.0/openbabel/reaction.h:59:18: note: to match this '('
void AddProduct(const obsharedptr sp)
^
/usr/local/include/openbabel-2.0/openbabel/reaction.h:62:33: error: no type named 'shared_ptr' in namespace 'std'
void SetTransitionState(const obsharedptr sp)
^~~~~~~~~~~
/usr/local/include/openbabel-2.0/openbabel/shared_ptr.h:25:23: note: expanded from macro 'obsharedptr'
#define obsharedptr OB_SHARED_PTR_IMPLEMENTATION
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/openbabel-2.0/openbabel/babelconfig.h:153:43: note: expanded from macro 'OB_SHARED_PTR_IMPLEMENTATION'
#define OB_SHARED_PTR_IMPLEMENTATION std::shared_ptr
~~~~~^
In file included from openbabel-python_wrap.cpp:3400:
/usr/local/include/openbabel-2.0/openbabel/reaction.h:62:44: error: expected ')'
void SetTransitionState(const obsharedptr sp)
^
/usr/local/include/openbabel-2.0/openbabel/reaction.h:62:26: note: to match this '('
void SetTransitionState(const obsharedptr sp)
^
/usr/local/include/openbabel-2.0/openbabel/reaction.h:65:23: error: no type named 'shared_ptr' in namespace 'std'
void AddAgent(const obsharedptr sp)
^~~~~~~~~~~
/usr/local/include/openbabel-2.0/openbabel/shared_ptr.h:25:23: note: expanded from macro 'obsharedptr'
#define obsharedptr OB_SHARED_PTR_IMPLEMENTATION
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/openbabel-2.0/openbabel/babelconfig.h:153:43: note: expanded from macro 'OB_SHARED_PTR_IMPLEMENTATION'
#define OB_SHARED_PTR_IMPLEMENTATION std::shared_ptr
~~~~~^
In file included from openbabel-python_wrap.cpp:3400:
/usr/local/include/openbabel-2.0/openbabel/reaction.h:65:34: error: expected ')'
void AddAgent(const obsharedptr sp)
^
/usr/local/include/openbabel-2.0/openbabel/reaction.h:65:16: note: to match this '('
void AddAgent(const obsharedptr sp)
^
/usr/local/include/openbabel-2.0/openbabel/reaction.h:68:3: error: no type named 'shared_ptr' in namespace 'std'
obsharedptr GetReactant(const unsigned i)
^~~~~~~~~~~
/usr/local/include/openbabel-2.0/openbabel/shared_ptr.h:25:23: note: expanded from macro 'obsharedptr'
#define obsharedptr OB_SHARED_PTR_IMPLEMENTATION
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/openbabel-2.0/openbabel/babelconfig.h:153:43: note: expanded from macro 'OB_SHARED_PTR_IMPLEMENTATION'
#define OB_SHARED_PTR_IMPLEMENTATION std::shared_ptr
~~~~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
2 warnings and 20 errors generated.
error: command '/usr/bin/clang' failed with exit status 1

----------------------------------------

Command "/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;file='/private/var/folders/nz/v_szcmrx6fn3tww6c1xlzt5w0000gn/T/pip-build-9koal6v_/openbabel/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /var/folders/nz/v_szcmrx6fn3tww6c1xlzt5w0000gn/T/pip-j6r3agxu-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/nz/v_szcmrx6fn3tww6c1xlzt5w0000gn/T/pip-build-9koal6v_/openbabel/


I am going to try installing it on our university Linux server today and check if this problem persists (there i can change python models).

Thanks a lot and sorry for the bothersome problem.
Thanks in advance!

from plip.

ssalentin avatar ssalentin commented on May 20, 2024

It may be that your OpenBabel version doesn't match your Python bindings for some reason.

You could try to remove OpenBabel and pybel and then compile OpenBabel with Python bindings (i.e. pybel) from source.

https://openbabel.org/docs/dev/Installation/install.html

from plip.

o7o avatar o7o commented on May 20, 2024

@Darakah
Have (could) you check the path and version for mac native python and homebrew python?

I think, you should change homebrew python as default and install plip -again-
but I do not know if homebrew will install openbabel with python binding like macports did.

In my Mac (Yosemite), I have two python version: 2.7.10 (mac native) and 2.7.13 (macports).

Note:
I have succeed install PLIP (version 1.3.4b) and running it (multicore) on Mac OS Yosemite within python-2.7 from macports.
Here my python module list:
appdirs (1.4.3) Beaker (1.8.1) biopython (1.69) certifi (2017.4.17) Cython (0.25.2) docopt (0.6.2) funcsigs (0.4) libxml2-python (2.9.4) lxml (3.7.3) Mako (1.0.6) MarkupSafe (0.23) matplotlib (1.4.3) mock (1.3.0) nose (1.3.7) Numeric (24.2) numpy (1.13.0) openbabel (2.4.1) pbr (1.3.0) pip (9.0.1) plip (1.3.4) Pmw (2.0.0) pycairo (1.10.0) pymol (1.8.6.0) pyparsing (2.2.0) python-dateutil (2.4.2) pytz (2015.4) scipy (0.19.1) setuptools (36.0.1) six (1.10.0) termcolor (1.1.0) Tkinter (0.0.0)

Step for install:
install macports first, then use JPortsUI (GUI apps for Macports) for installing the required modules
install python27, pymol, and other the required modules

make sure that all modules are in the list with command
pip-2.7 list

if openbabel is not the same version with macports or not installed at all, install or upgrade it with command
pip-2.7 install openbabel or pip-2.7 install --upgrade openbabel

then install plip with pip-2.7 (get 1.3.0 version) or python2.7 (download source code and get 1.3.4 version)
pip-2.7 install plip
from the extracted folder of source code
python2.7 setup.py install

make symlink for running plipcmd in any folder
ln -s /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/plipcmd /opt/local/bin/plipcmd

get result:
Xxxx-MBP:~ xxxx$ plipcmd
usage: PLIP [-h] (-f INPUT [INPUT ...] | -i PDBID [PDBID ...]) [-o OUTPATH]
[-v] [-p] [-x] [-t] [-y] [--maxthreads MAXTHREADS]
[--breakcomposite] [--altlocation] [--debug] [--nofix]
[--dnareceptor] [--peptides PEPTIDES [PEPTIDES ...] | --intra
INTRA] [--keepmod]
PLIP: error: one of the arguments -f/--file -i/--input is required
Xxxx-MBP:~ xxxx$

from plip.

Darakah avatar Darakah commented on May 20, 2024

Hi Sorry for the late reply,

The problem on my Mac was the version of pyparsing.py (it does not contain pyparsing_common).

the project that I am working on will be placed on the university servers, thus I tried to install it directly on the CentOS Linux server.

I was able to install it as a python package (using pip install plip) and then I installed pymol and added it to the PYTHONPATH and the LD_LIBRARY_PATH.
all imports worked correctly!

I followed the instructions of how to use it in a python script:

~  ssh -Y [email protected]
[email protected]'s password:
Last login: Wed Jul 5 13:39:22 2017 from 10.31.189.121
[galam@linuxdev ~]$ python
Python 2.7.12 |Continuum Analytics, Inc.| (default, Jul 2 2016, 17:42:40)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org

from plip.modules.preparation import PDBComplex
my_mol = PDBComplex()
my_mol.load_pdb('./4km6.pdb')
print my_mol
<plip.modules.preparation.PDBComplex instance at 0x7fd7ed44cf38>
my_mol.analyze()
Traceback (most recent call last):
File "", line 1, in
AttributeError: PDBComplex instance has no attribute 'analyze'


thus I decided to use plipcmd as a bash program, I cloned the repository, added plipcmd to the $PATH variable and tried to run it.

[galam@linuxdev ~]$ plipcmd
usage: PLIP [-h] (-f INPUT [INPUT ...] | -i PDBID [PDBID ...]) [-o OUTPATH]
[-v] [-p] [-x] [-t] [-y] [--maxthreads MAXTHREADS]
[--breakcomposite] [--altlocation] [--debug]
PLIP: error: one of the arguments -f/--file -i/--input is required

(made sure it was present)

It is not creating the pymol session or any pics:

[galam@linuxdev ~]$ ls
4km6.pdb plipfixed.4km6_Xj6F1E.pdb
[galam@linuxdev ~]$ plipcmd --pics -y -f plipfixed.4km6_Xj6F1E.pdb --maxthreads 1
[galam@linuxdev ~]$ ls
4km6.pdb plipfixed.4km6_Xj6F1E.pdb


(i placed --maxthreads 1 because if i dont add it or i specify something larger than one i get a python traceback from multiprocessing module pool.py)

it does generate the results in xml and txt formats:

[galam@linuxdev ~]$ ls
4km6.pdb plipfixed.4km6_Xj6F1E.pdb
[galam@linuxdev ~]$ plipcmd -xt -f plipfixed.4km6_Xj6F1E.pdb --maxthreads 1
[galam@linuxdev ~]$ ls
4km6.pdb plipfixed.4km6_Xj6F1E.pdb report.txt report.xml
[galam@linuxdev ~]$

I obtain the correct results.

any idea to what is happening?
is it related to pymol and the absence of a display on the server? (note I did ssh -Y in case it required the display, however, nothing happened)

this is the output of plipcmd with the verbose option:

[galam@linuxdev ~]$ ls
4km6.pdb plipfixed.4km6_Xj6F1E.pdb
[galam@linuxdev ~]$ plipcmd -vxtpy -f plipfixed.4km6_Xj6F1E.pdb --maxthreads 1


  • Protein-Ligand Interaction Profiler v1.3.0 *

Starting analysis of plipfixed.4km6_Xj6F1E.pdb

PDB structure successfully read.
Analyzing 5 ligands...

LIG [SMALLMOLECULE] -- LIG:Z:1

Contains 3 aromatic ring(s).
Binding site atoms in vicinity (7.5 A max. dist: 128).
Ligand interacts with 6 binding site residue(s) in chain(s) A.
Complex uses 6 hydrogen bond(s), 1 pi-cation interaction(s), 2 water bridge(s).

NAG [SMALLMOLECULE] -- NAG:A:303

-> may be biologically irrelevant <-
Binding site atoms in vicinity (7.5 A max. dist: 36).
Ligand interacts with 2 binding site residue(s) in chain(s) A.
Complex uses 2 hydrogen bond(s).

CA [ION] -- CA:A:301

Binding site atoms in vicinity (7.5 A max. dist: 89).
No interactions for this ligand.

NAG [SMALLMOLECULE] -- NAG:A:304

-> may be biologically irrelevant <-
Binding site atoms in vicinity (7.5 A max. dist: 103).
Ligand interacts with 2 binding site residue(s) in chain(s) A.
Complex uses 3 hydrogen bond(s).

NAG [SMALLMOLECULE] -- NAG:A:302

-> may be biologically irrelevant <-
Binding site atoms in vicinity (7.5 A max. dist: 52).
Ligand interacts with 4 binding site residue(s) in chain(s) A.
Complex uses 4 hydrogen bond(s).
[galam@linuxdev ~]$ ls
4km6.pdb plipfixed.4km6_Xj6F1E.pdb
[galam@linuxdev ~]$

this is the output without maxthreads option:
[galam@linuxdev ~]$ plipcmd -vxtpy -f plipfixed.4km6_Xj6F1E.pdb


  • Protein-Ligand Interaction Profiler v1.3.0 *

Starting analysis of plipfixed.4km6_Xj6F1E.pdb

PDB structure successfully read.
Analyzing 5 ligands...

LIG [SMALLMOLECULE] -- LIG:Z:1

Contains 3 aromatic ring(s).
Binding site atoms in vicinity (7.5 A max. dist: 128).
Ligand interacts with 6 binding site residue(s) in chain(s) A.
Complex uses 6 hydrogen bond(s), 1 pi-cation interaction(s), 2 water bridge(s).

NAG [SMALLMOLECULE] -- NAG:A:303

-> may be biologically irrelevant <-
Binding site atoms in vicinity (7.5 A max. dist: 36).
Ligand interacts with 2 binding site residue(s) in chain(s) A.
Complex uses 2 hydrogen bond(s).

CA [ION] -- CA:A:301

Binding site atoms in vicinity (7.5 A max. dist: 89).
No interactions for this ligand.

NAG [SMALLMOLECULE] -- NAG:A:304

-> may be biologically irrelevant <-
Binding site atoms in vicinity (7.5 A max. dist: 103).
Ligand interacts with 2 binding site residue(s) in chain(s) A.
Complex uses 3 hydrogen bond(s).

NAG [SMALLMOLECULE] -- NAG:A:302

-> may be biologically irrelevant <-
Binding site atoms in vicinity (7.5 A max. dist: 52).
Ligand interacts with 4 binding site residue(s) in chain(s) A.
Complex uses 4 hydrogen bond(s).

Generating visualizations in parallel on 5 cores ...Traceback (most recent call last):
File "/usr/local/psi4conda/bin/plipcmd", line 330, in
main(expanded_path, arguments.pdbid) # Start main script
File "/usr/local/psi4conda/bin/plipcmd", line 232, in main
process_pdb(inputstruct, config.OUTPATH)
File "/usr/local/psi4conda/bin/plipcmd", line 152, in process_pdb
parfn(complexes, processes=config.MAXTHREADS)
File "/usr/local/psi4conda/lib/python2.7/site-packages/plip/modules/mp.py", line 62, in simple_parallel
result = pool.map(universal_worker, pool_args(func, sequence, args))
File "/usr/local/psi4conda/lib/python2.7/multiprocessing/pool.py", line 251, in map
return self.map_async(func, iterable, chunksize).get()
File "/usr/local/psi4conda/lib/python2.7/multiprocessing/pool.py", line 567, in get
raise self._value
pymol.CmdException: Error:

NOTE: if i remove -py options and do not specify the maxthread thing it works properly.

[galam@linuxdev ~]$ ls
4km6.pdb plipfixed.4km6_Xj6F1E.pdb
[galam@linuxdev ~]$ plipcmd -vxt -f plipfixed.4km6_Xj6F1E.pdb


  • Protein-Ligand Interaction Profiler v1.3.0 *

Starting analysis of plipfixed.4km6_Xj6F1E.pdb

PDB structure successfully read.
Analyzing 5 ligands...

LIG [SMALLMOLECULE] -- LIG:Z:1

Contains 3 aromatic ring(s).
Binding site atoms in vicinity (7.5 A max. dist: 128).
Ligand interacts with 6 binding site residue(s) in chain(s) A.
Complex uses 6 hydrogen bond(s), 1 pi-cation interaction(s), 2 water bridge(s).

NAG [SMALLMOLECULE] -- NAG:A:303

-> may be biologically irrelevant <-
Binding site atoms in vicinity (7.5 A max. dist: 36).
Ligand interacts with 2 binding site residue(s) in chain(s) A.
Complex uses 2 hydrogen bond(s).

CA [ION] -- CA:A:301

Binding site atoms in vicinity (7.5 A max. dist: 89).
No interactions for this ligand.

NAG [SMALLMOLECULE] -- NAG:A:304

-> may be biologically irrelevant <-
Binding site atoms in vicinity (7.5 A max. dist: 103).
Ligand interacts with 2 binding site residue(s) in chain(s) A.
Complex uses 3 hydrogen bond(s).

NAG [SMALLMOLECULE] -- NAG:A:302

-> may be biologically irrelevant <-
Binding site atoms in vicinity (7.5 A max. dist: 52).
Ligand interacts with 4 binding site residue(s) in chain(s) A.
Complex uses 4 hydrogen bond(s).

Finished analysis. Find the result files in the working directory.

[galam@linuxdev ~]$ ls
4km6.pdb plipfixed.4km6_Xj6F1E.pdb report.txt report.xml
[galam@linuxdev ~]$

thanks a lot and sorry again!

from plip.

o7o avatar o7o commented on May 20, 2024

@Darakah
Sorry, I thought that you will use PLIP in your Mac Laptop and I never succeed installing PyMOL using native python from mac so I use macports. Indeed, PyMOL needs graphic driver to run well.

The problem on my Mac was the version of pyparsing.py (it does not contain pyparsing_common).
You can use macports as alternative.

the project that I am working on will be placed on the university servers, thus I tried to install it directly on the CentOS Linux server.
I have installed CentOS Linux Server with Graphics supported for my Lab (not CLI version). If you only access it from ssh, so you don't have -right to- access it (physically) directly.
I haven't try to install PLIP in CentOS Server yet, but PyMOL -as said before- need graphics to run. I think, without PyMOL and its python binding, you cannot get pymol session and interaction image as well.

I have succeed installed PLIP on Ubuntu Desktop 32bit/64bit and it run well with multicore supported.

from plip.

Darakah avatar Darakah commented on May 20, 2024

@o7o
Thanks for ur fast reply.
do you know of a solution ? like a headless graphic driver ? (i had a similar problem before and solved it by using request and selenium python libraries and automated it then replaced chrome with a headless driver and placed it on the server)

is there anything similar?
its just that the 3D images of interactions generated are extremely helpful in understanding the interactions and the docking.

its just that i am using it to analyze the obtained poses from a docking pipeline that i automated on a webpage.
Thanks again!

from plip.

o7o avatar o7o commented on May 20, 2024

I think only @ssalentin has the right answer for you because PLIP has online version you can access till now at:
https://projects.biotec.tu-dresden.de/plip-web/plip

sorry, I haven't try PLIP on any CLI server.

from plip.

ssalentin avatar ssalentin commented on May 20, 2024

We are running our server on Ubuntu with graphics support. If you have custom projects (such as your docking analysis on a webpage), you might consider using JSMol and recreating the visualization from the XML files. We did that also for the interactive 3D diagram on the web service.

from plip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.