pip install in conda env yields undefined symbol: _ZSt28__throw_bad_array_new_lengthv
Package installation doesn't work in conda env and yields the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/alexis/singbrain/repo/POT/ot/__init__.py", line 22, in <module>
from . import lp
File "/home/alexis/singbrain/repo/POT/ot/lp/__init__.py", line 22, in <module>
from .emd_wrap import emd_c, check_result, emd_1d_sorted
ImportError: /home/alexis/singbrain/repo/POT/ot/lp/emd_wrap.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZSt28__throw_bad_array_new_lengthv
To Reproduce
Steps to reproduce the behavior:
conda create -n pot python=3.7conda activate potpip install .- In a python prompt:
import ot
Environment (please complete the following information):
- OS: Ubuntu 21.10
- Python version: 3.7
- How was POT installed (source,
pip,conda): pip
Output of the following code snippet:
import platform; print(platform.platform())
import sys; print("Python", sys.version)
import numpy; print("NumPy", numpy.__version__)
import scipy; print("SciPy", scipy.__version__)
import ot; print("POT", ot.__version__)
Linux-5.13.0-19-generic-x86_64-with-debian-11.0
Python 3.7.7 (default, Mar 26 2020, 15:48:22)
[GCC 7.3.0]
NumPy 1.19.1
SciPy 1.5.2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/alexis/singbrain/repo/POT/ot/__init__.py", line 22, in <module>
from . import lp
File "/home/alexis/singbrain/repo/POT/ot/lp/__init__.py", line 22, in <module>
from .emd_wrap import emd_c, check_result, emd_1d_sorted
ImportError: /home/alexis/singbrain/repo/POT/ot/lp/emd_wrap.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZSt28__throw_bad_array_new_lengthv
From what I read, it could be that I am not using the right version of gcc, but it might be worth documenting here!
Hell @alexisthual,
I think this bug may come from a local compilation of POT. Could you try to import ot not in the POT folder in your environment? It should work.
I just started a python prompt from a different folder, imported ot and got the same error :open_mouth:
Hello, do you still have the bug?
Hi!
I just tried the same procedure again, and got a different error this time:
〉python
Python 3.7.15 (default, Nov 7 2022, 22:00:21)
[GCC 11.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ot
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/alexis/singbrain/repo/POT/ot/__init__.py", line 22, in <module>
from . import lp
File "/home/alexis/singbrain/repo/POT/ot/lp/__init__.py", line 22, in <module>
from .emd_wrap import emd_c, check_result, emd_1d_sorted
ModuleNotFoundError: No module named 'ot.lp.emd_wrap'
can you try the impoart from another folder? the cpp file is not compiled locally but if you are in thje POT repo it is trying to import the local version
in anay case you should install with pîp install pot or diecrtly using the git url for master version
can you try the impoart from another folder? the cpp file is not compiled locally but if you are in thje POT repo it is trying to import the local version
You are right, changing folders solved this issue! :heavy_check_mark:
ok i'm closing this then, since pot need ompilation you should not import from the source unless you install it with developor compile with -inplace