Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pycodec2.cpython-39-x86_64-linux-gnu.so: undefined symbol: codec2_bytes_per_frame #30

Closed
manuel-masiello opened this issue Nov 28, 2023 · 7 comments
Assignees
Labels

Comments

@manuel-masiello
Copy link

manuel-masiello commented Nov 28, 2023

Hello. Thank you for your work. Unfortunately I can't use the library.

Here is an error that I cannot resolve.
This is how I produced the error:

$ conda create -n Test -c conda-forge tensorflow-gpu pip jupyterlab python
$ conda activate Test
$ pip install pycodec2
$ python

>>> import pycodec2            
                                                                                                                                                                                                 
Traceback (most recent call last):                                                                                                                                                                                                          
  File "<stdin>", line 1, in <module>                                                                                                                                                                                                       
  File "/home/manuel/anaconda3/envs/Test/lib/python3.11/site-packages/pycodec2/__init__.py", line 1, in <module>                                                                                                                            
    from .pycodec2 import *                                                                                                                                                                                                                 
ImportError: /home/manuel/anaconda3/envs/Test/lib/python3.11/site-packages/pycodec2/pycodec2.cpython-311-x86_64-linux-gnu.so: undefined symbol: codec2_bytes_per_frame


@manuel-masiello
Copy link
Author

manuel-masiello commented Nov 28, 2023

I think there is an error in the latest version of the package because it works with the previous one:

pip install pycodec2==2.1.0

@manuel-masiello
Copy link
Author

Actually, you don't need Conda to get the error. Here is a very simple example in Google Colab:

Google colab link with the issue

@gregorias
Copy link
Owner

gregorias commented Nov 28, 2023

Thank you for raising the issue.

Could you check the compatibility chart with your codec2 version (https://github.com/gregorias/pycodec2#codec-2-compatibility)? You might be using an older version of codec2, which is incompatible with the newest release.

@gregorias gregorias self-assigned this Nov 28, 2023
@gregorias
Copy link
Owner

Closing as abandoned. Let me know if you find that compatibility wasn't the issue. It's fine to use 2.1.0 BTW, new Pycodec2 versions only change what Codec2 version they use.

@x4dr
Copy link

x4dr commented Dec 20, 2023

have the same issue, steps to reproduce in a fresh venv:
install pycodec2, [check codec2 version], import codec2

[maric/tmp] % python -m virtualenv venv
created virtual environment CPython3.11.6.final.0-64 in 123ms
  creator CPython3Posix(dest=/home/maric/tmp/venv, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/maric/.local/share/virtualenv)
    added seed packages: pip==23.2.1, setuptools==68.2.2, wheel==0.41.2
  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
[maric/tmp] % cd venv 
[tmp/venv] % . ./bin/activate
(venv) [tmp/venv] % pip install pycodec2
Collecting pycodec2
  Obtaining dependency information for pycodec2 from https://files.pythonhosted.org/packages/04/49/75a8c9c1bca0cca5c226d42019f81d57e3acb74949f56585c0f706457655/pycodec2-3.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
  Downloading pycodec2-3.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.0 kB)
Collecting numpy>=1.22 (from pycodec2)
  Obtaining dependency information for numpy>=1.22 from https://files.pythonhosted.org/packages/b6/ab/5b893944b1602a366893559bfb227fdfb3ad7c7629b2a80d039bb5924367/numpy-1.26.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
  Downloading numpy-1.26.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (61 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.2/61.2 kB 2.1 MB/s eta 0:00:00
Downloading pycodec2-3.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (646 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 646.4/646.4 kB 3.5 MB/s eta 0:00:00
Downloading numpy-1.26.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.2 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 18.2/18.2 MB 4.4 MB/s eta 0:00:00
Installing collected packages: numpy, pycodec2
Successfully installed numpy-1.26.2 pycodec2-3.0.0

[notice] A new release of pip is available: 23.2.1 -> 23.3.2
[notice] To update, run: pip install --upgrade pip
(venv) [tmp/venv] % pacman -Q codec2
codec2 1:1.2.0-1
(venv) ?1[tmp/venv] % echo 'import pycodec2' | python

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/maric/tmp/venv/lib/python3.11/site-packages/pycodec2/__init__.py", line 1, in <module>
    from .pycodec2 import *
ImportError: /home/maric/tmp/venv/lib/python3.11/site-packages/pycodec2/pycodec2.cpython-311-x86_64-linux-gnu.so: undefined symbol: codec2_bytes_per_frame
(venv) ?1[tmp/venv] % 

Feature request: probing for codec2 version and a better error message depending on whats broken/missing
i assume that installing with pip means no setup.py is necessary?

@gregorias gregorias reopened this Dec 20, 2023
@gregorias gregorias added the bug label Dec 20, 2023
@gregorias
Copy link
Owner

I investigated the wheel in question. It's faulty. It contains an old codec2 shared object. I intend to fix the distribution soon, which should resolve your immediate issue.

Regarding messaging, there's not much I can do. Those errors are from the linking process over which I have no real control. Best approach is to educate future users on what that means and how to debug.

@gregorias
Copy link
Owner

I've released a fixed 3.0.1 version on PyPI. It should work now. PTAL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants