cpycppyy api not found
With cppyy 2.1.0 (installed by pip) i get the warning
/usr/local/lib/python3.8/dist-packages/cppyy/__init__.py:318: UserWarning: CPyCppyy API not found (tried: /usr/local/lib/python3.8/dist-packages/../../../include/python3.8); set CPPYY_API_PATH envar to the 'CPyCppyy' API directory to fix
warnings.warn("CPyCppyy API not found (tried: %s); set CPPYY_API_PATH envar to the 'CPyCppyy' API directory to fix" % apipath_extra)
same in venv (installed by pipenv):
/home/gateway/.local/share/virtualenvs/cmmlpipy-EDRQn1Yr/lib/python3.8/site-packages/cppyy/__init__.py:318: UserWarning: CPyCppyy API not found (tried: /home/gateway/.local/share/virtualenvs/cmmlpipy-EDRQn1Yr/lib/python3.8/site-packages/../../../include/site/python3.8); set CPPYY_API_PATH envar to the 'CPyCppyy' API directory to fix
warnings.warn("CPyCppyy API not found (tried: %s); set CPPYY_API_PATH envar to the 'CPyCppyy' API directory to fix" % apipath_extra)
According to pipenv it is installed:
cppyy==2.1.0
- cppyy-backend [required: ==1.14.6, installed: 1.14.6]
- cppyy-cling [required: >=6.25.1, installed: 6.25.1]
- cppyy-cling [required: ==6.25.1, installed: 6.25.1]
- CPyCppyy [required: ==1.12.7, installed: 1.12.7]
- cppyy-backend [required: >=1.14.6, installed: 1.14.6]
- cppyy-cling [required: >=6.25.1, installed: 6.25.1]
- cppyy-cling [required: >=6.25.1, installed: 6.25.1]
Should find that in a regular installation by himself? Due to the truncated path, i don't know where exactly to look at..
Docker Ubuntu 20.04 CPython 3.8.10 GCC 9.4.0 WSL2 Ubuntu 20.04 CPython 3.8.5 GCC 9.3.0 (venv)
After that I get a segmentation violation, don't know if it is due to this warning (just on Docker, not on WSL2, there it just does not work anymore. Worked with cppyy 1.7.1 on both environments):
0x00007f755a8e97ae in <unknown> from /usr/local/lib/python3.8/dist-packages/cppyy_backend/lib/libcppyy_backend.so
0x00007f755a8e9ef6 in Cppyy::CallI(long, void*, unsigned long, void*) at /tmp/pip-install-w15h9p76/cppyy-backend/src/clingwrapper.cxx:887 from /usr/local/lib/python3.8/dist-packages/cppyy_backend/lib/libcppyy_backend.so
0x00007f755865a8b4 in <unknown> from /usr/local/lib/python3.8/dist-packages/libcppyy.cpython-38-x86_64-linux-gnu.so
0x00007f75586688c6 in CPyCppyy::CPPMethod::ExecuteFast(void*, long, CPyCppyy::CallContext*) at /tmp/pip-install-w15h9p76/cpycppyy/src/CPPMethod.cxx:182 from /usr/local/lib/python3.8/dist-packages/libcppyy.cpython-38-x86_64-linux-gnu.so
0x00007f75586671e5 in CPyCppyy::CPPMethod::Execute(void*, long, CPyCppyy::CallContext*) at /tmp/pip-install-w15h9p76/cpycppyy/src/CPPMethod.cxx:853 from /usr/local/lib/python3.8/dist-packages/libcppyy.cpython-38-x86_64-linux-gnu.so
0x00007f75586657df in CPyCppyy::CPPFunction::Call(CPyCppyy::CPPInstance*&, _object* const*, unsigned long, _object*, CPyCppyy::CallContext*) at /tmp/pip-install-w15h9p76/cpycppyy/src/CPPFunction.cxx:89 from /usr/local/lib/python3.8/dist-packages/libcppyy.cpython-38-x86_64-linux-gnu.so
0x00007f755867ea3f in <unknown> from /usr/local/lib/python3.8/dist-packages/libcppyy.cpython-38-x86_64-linux-gnu.so
0x000000000056fb87 in _PyEval_EvalFrameDefault + 0x57d7 from python3
Ok got it. That path is not truncated, it is three folders up :) So I set
CPPYY_API_PATH="/home/gateway/.local/share/virtualenvs/cmmlpipy-EDRQn1Yr/include/site/python3.8/"
but wasn't working either, because your code is adding CPyCppyy, but folder is named cpycppyy (Casing matters in Linux). After renaming the folder the warning is gone.
So there are 2 issues: Going up the tree seems to not work under Ubuntu and folder name is small-cased on installation
How to reproduce? My main Linux box is actually a Ubuntu 20.04.2 distro, and I've never seen a lower case appear. Is it a pipenv thing? (I haven't yet used it.)
Also happens on docker:
FROM ubuntu:20.04
RUN apt-get update && \
apt-get install -y python3 python3-dev python3-pip iputils-ping && \
apt-get clean
RUN mkdir -p /usr/src/
WORKDIR /usr/src/
COPY requirements*.txt ./
RUN pip3 --no-cache-dir install -r requirements.txt
requirements.txt
-i https://pypi.org/simple
aioconsole==0.3.1; python_version >= '3.6'
aiohttp==3.7.4.post0
aiomonitor==0.4.5
async-timeout==3.0.1; python_full_version >= '3.5.3'
attrs==21.2.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
certifi==2021.5.30
chardet==4.0.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
charset-normalizer==2.0.4; python_version >= '3'
cppyy-backend==1.14.6
cppyy-cling==6.25.1
cppyy==2.1.0
cpycppyy==1.12.7
idna==3.2; python_version >= '3'
multidict==5.1.0; python_version >= '3.6'
pymongo==3.12.0
requests==2.26.0
terminaltables==3.1.0
typing-extensions==3.10.0.0
urllib3==1.26.6; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4'
yarl==1.6.3; python_version >= '3.6'
Dumb question perhaps (haven't tried/tested), but does it change if cpycppyy==1.12.7 is written as CPyCppyy==1.12.7 in requirements.txt? Aside, it's best to let cppyy deal with its dependencies, e.g. the above would fail if the python used were pypy-c (which doesn't need/can't use CPyCppyy).
EDIT: it works then. So not that dumb the question :)
the requirements.txt is automatically generated by pipenv. According to PEP-0426: All comparisons of distribution names MUST be case insensitive they just use small letters for dists.
So it should work with both versions..
But the violation is still the same :(
*** Break *** segmentation violation
Generating stack trace...
0x00007f44f053f075 in CommandParser::ParseKeyValue(char const*, KeyValue*) + 0x2f5 from library/libmlpi.so.1.29.1
0x00007f44f053f433 in CommandParser::Parse(char const*) + 0xa3 from library/libmlpi.so.1.29.1
0x00007f44f04bc0c7 in mlpiApiConnect + 0x167 from library/libmlpi.so.1.29.1
0x00007f44f1b22022 in <unknown function>
0x00007f44f42577ae in <unknown> from /usr/local/lib/python3.8/dist-packages/cppyy_backend/lib/libcppyy_backend.so
0x00007f44f4257ef6 in Cppyy::CallI(long, void*, unsigned long, void*) at /tmp/pip-install-t8fkepng/cppyy-backend/src/clingwrapper.cxx:887 from /usr/local/lib/python3.8/dist-packages/cppyy_backend/lib/libcppyy_backend.so
0x00007f44f1fc88b4 in <unknown> from /usr/local/lib/python3.8/dist-packages/libcppyy.cpython-38-x86_64-linux-gnu.so
0x00007f44f1fd68c6 in CPyCppyy::CPPMethod::ExecuteFast(void*, long, CPyCppyy::CallContext*) at /tmp/pip-install-t8fkepng/CPyCppyy/src/CPPMethod.cxx:182 from /usr/local/lib/python3.8/dist-packages/libcppyy.cpython-38-x86_64-linux-gnu.so
0x00007f44f1fd51e5 in CPyCppyy::CPPMethod::Execute(void*, long, CPyCppyy::CallContext*) at /tmp/pip-install-t8fkepng/CPyCppyy/src/CPPMethod.cxx:853 from /usr/local/lib/python3.8/dist-packages/libcppyy.cpython-38-x86_64-linux-gnu.so
0x00007f44f1fd37df in CPyCppyy::CPPFunction::Call(CPyCppyy::CPPInstance*&, _object* const*, unsigned long, _object*, CPyCppyy::CallContext*) at /tmp/pip-install-t8fkepng/CPyCppyy/src/CPPFunction.cxx:89 from /usr/local/lib/python3.8/dist-packages/libcppyy.cpython-38-x86_64-linux-gnu.so
0x00007f44f1feca3f in <unknown> from /usr/local/lib/python3.8/dist-packages/libcppyy.cpython-38-x86_64-linux-gnu.so
0x000000000056fb87 in _PyEval_EvalFrameDefault + 0x57d7 from python3
0x00000000005f5956 in _PyFunction_Vectorcall + 0x1b6 from python3
0x000000000056acb6 in _PyEval_EvalFrameDefault + 0x906 from python3
or just
*** Break *** segmentation violation
malloc(): invalid size (unsorted)
*** Break *** abort
The current comparison is on directory names (i.e. whether the path exists), so making it case-insensitive is clunky. I'm thinking of maybe moving the headers to cppyy itself or to add them to a "run-time" package that would also contain the PCH or PCMs (which would make installation on Windows easier).
As for the crash, that is inside the C++ code that was bound (CommandParser::ParseKeyValue). I.e. can be anything and is unlikely to be cppyy related; that'd only be the case if it provides faulty input parameters, but this is a function two calls down. What's the signature of mlpiApiConnect? I'd like to see whether any of the arguments is an oddball.
Haha you're absolutely right. I'm sorry. Thought the crash is related to that CPyCppyy-Issue, because it appeared on the Update. I checked all the diffs, went forth and back.. But I changed one more thing not covered by git: Reading the env-file on docker run --env-file .env. And docker does not like inline comments unlike pipenv.. So handed over the string with #, which crashed the underlying function mlpiApiConnect (from this crappy lib).
Sorry for wasting your time, shall I post a new issue with just that casing-problem to have a clean issue-report?