Question
Tosh Ohta · Aug 30, 2018

Caché-Python Binding doesn't work

Hello,

I'm trying to set Caché-Python Binding on Mac, but there is a problem.

I performed installation and configuration of Caché-Python binding module based on the manual (URL)
including setting of PATH and LD_LIBRARY_PATH in "bash_profile", 
and they seems to be done successfully (there was no error in the process).

However, when I execute test python file (test.py), it failed with error massage as below.
-----------------------Error Massage----------------------
Traceback (most recent call last):
  File "test.py", line 2, in <module>
    import intersys.pythonbind3
  File "/$USER$/.pyenv/versions/anaconda3-4.3.1/envs/py3.6.0/lib/python3.6/site-packages/pythonbind3-1.0-py3.6-macosx-10.7-x86_64.egg/intersys/pythonbind3.py", line 1, in <module>
    import intersys.pythonbind31
ImportError: dlopen(/$USER$/.pyenv/versions/anaconda3-4.3.1/envs/py3.6.0/lib/python3.6/site-packages/pythonbind3-1.0-py3.6-macosx-10.7-x86_64.egg/intersys/pythonbind31.cpython-36m-darwin.so, 2): Library not loaded: @executable_path/libcbind.dylib
  Referenced from: /$USER$/.pyenv/versions/anaconda3-4.3.1/envs/py3.6.0/lib/python3.6/site-packages/pythonbind3-1.0-py3.6-macosx-10.7-x86_64.egg/intersys/pythonbind31.cpython-36m-darwin.so
  Reason: image not found
---------------------------------------------------------------

None of the things I have searched doesn't work in my case.

It would be appreciated if you could share a good idea or solution.
Thank you for in advance.

FYI: my development environment is as below:

  • Machine / OS:          MacBook Pro / MacOS High Sierra (ver.10.13.6)
  • Python version:       3.6.0 (installed via Anaconda) 

    *I used "setup3.py" file in the binding module installation because of the Python version

  • Caché version:         2017.2 (evaluation edition)
0
0 812
Discussion (3)2
Log in or sign up to continue

Hi Tosh,

it seems your path is not correctly setup as the process is not able to identify the underlying C binding libraries. I assume you are using the 64-bit version of Python. Also I want to point out that we currently only support Python 3 up to version 3.3 as later versions introduced quite significant changes in string handling. We are working on supporting versions beyond 3.3 at the moment.

HTH,

Stefan

Hey Stefan,

From what I can tell, this path variable issue is a common issue that MANY users are experiencing.  Would it be possible to provide more specific instruction? Perhaps more detailed documentation? Or a video post to Youtube?

I've read through all the docs on the python binding & I followed the instructions:

---I've downloaded Cache (C:\InterSystems\TryCache\bin)

---My system meets the client requirements for the python binding (https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY...)

---My 64-bit windows environment & paths are setup to run Microsoft C/C++ with Visual Studio 2017. In addition my vcvars64.bat path is set to C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build

---I execute the setup3.py file in my C:\InterSystems\TryCache\dev\python directory. It runs and prompts me for the cache installation directory, in which I paste in C:/InterSystems/TryCache/bin. 

--I then run test.py and this is what I see in powershell. A message that seems to say python doesnt know anything about the intersys module.

Hi Stefan,

I really appreciate your valuable advice.
I’ve downgraded Python to 3.3 right way.

However, the problem haven’t been solved yet at this time.
As you pointed out, I also suspect the PATH of C binding library “libcbind.dylib” cannot be identified.

Actually, the 64bit version of Python is installed in my machine, but the installed Cache version is also 64bit.
I think this should work....

I've double-checked ~/.bash_profile, where I set PATHs, but I don't know what is wrong.
Would it be possible to provide me with additional advice  if there are any points to be reviewed in the “~/.bash_profile” below?

------------------------~/.bash_profile---------------------------
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
export PATH=/$USER$/InterSystems/Cache/bin:$PATH
export DYLD_LIBRARY_PATH=/$USER$/InterSystems/Cache/bin:$DYLD_LIBRARY_PATH
------------------------------------------------------------------------------

It would be really appreciated if you could provide me with additional advice.

Thank you for your support.