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

libfmt error #148

Open
richardrl opened this issue Oct 29, 2024 · 6 comments
Open

libfmt error #148

richardrl opened this issue Oct 29, 2024 · 6 comments

Comments

@richardrl
Copy link

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[6], line 1
----> 1 from projectaria_tools.core import data_provider, mps
      2 from projectaria_tools.core.mps.utils import (
      3     filter_points_from_confidence,
      4     get_gaze_vector_reprojection,
      5     get_nearest_eye_gaze,
      6     get_nearest_pose,
      7 )
      8 from projectaria_tools.core.stream_id import StreamId

File /samsung4tb/conda_envs/projectarea_tools_py311/lib/python3.11/site-packages/projectaria_tools/__init__.py:16
      1 # Copyright (c) Meta Platforms, Inc. and affiliates.
      2 #
      3 # Licensed under the Apache License, Version 2.0 (the "License");
   (...)
     14 
     15 # This makes the modules discoverable when doing dir(projectaria_tools)
---> 16 from . import core  # noqa

File /samsung4tb/conda_envs/projectarea_tools_py311/lib/python3.11/site-packages/projectaria_tools/core/__init__.py:21
      1 # Copyright (c) Meta Platforms, Inc. and affiliates.
      2 #
      3 # Licensed under the Apache License, Version 2.0 (the "License");
   (...)
     14 
     15 # This makes the modules discoverable when doing dir(projectaria_tools.core)
     17 """
     18 A pybind11 binding for projectaria_tools core module
     19 """
---> 21 from . import (  # noqa
     22     calibration,
     23     data_provider,
     24     image,
     25     mps,
     26     sensor_data,
     27     sophus,
     28     stream_id,
     29     vrs,
     30     vrs_health_check,
     31 )

File /samsung4tb/conda_envs/projectarea_tools_py311/lib/python3.11/site-packages/projectaria_tools/core/calibration.py:19
      1 # Copyright (c) Meta Platforms, Inc. and affiliates.
      2 #
      3 # Licensed under the Apache License, Version 2.0 (the "License");
   (...)
     12 # See the License for the specific language governing permissions and
     13 # limitations under the License.
     15 """
     16 A pybind11 binding for projectaria_tools calibration submodule.
     17 """
---> 19 from _core_pybinds.calibration import *  # noqa

ImportError: libfmt.so.9: cannot open shared object file: No such file or directory
@richardrl
Copy link
Author

I think this issue is because I tried to install projectaria_tools inside a micromamba environment, and for some reason the pybind inside that environment is not looking for the .so files inside the environment.

@richardrl
Copy link
Author

I was originally using the mps_quickstart.ipynb notebook and no matter what I did with LD_LIBRARY_PATH, it wouldn't load.

export LD_LIBRARY_PATH=/samsung4tb/conda_envs/projectarea_tools_py311/lib
$ python3
Python 3.11.9 | packaged by conda-forge | (main, Apr 19 2024, 18:36:13) [GCC 12.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

import projectaria_tools

However it worked in command line

@SeaOtocinclus
Copy link
Contributor

If you use Jupyter Notebook, be sure to use the one of your Python environments, else it will not work (since it will load different path, and so load a different python env)

See https://facebookresearch.github.io/projectaria_tools/docs/data_utilities/installation/troubleshooting#python-module-import-error

I.e When using Pixi (a package manager) you can load the notebook from the environment as

# activate the env
pixi shell
# Run Jupyter (from the env) and open the notebook (pixi, use a direct path to ensure jupyter will take the right python path)
.pixi/envs/default/bin/jupyter notebook

@richardrl
Copy link
Author

Hi, thanks the tip. I was using the micromamba enviroment as my kernel inside the Jupyer notebook - is that what you mean? The error happened even though I did this.

@SeaOtocinclus
Copy link
Contributor

What I meant is did you run Jupyter Notebook from your python environment?
So let's summarize what you have encountered.

  • everything works if you use a classic python environment
  • you have the issue with libfmt only if you use micromamba

Am I right?

  • We got some project using projectaria_tools and using mamba (ATEK and we never saw this error before.

Wonder what the underlying issue is...

@richardrl
Copy link
Author

@SeaOtocinclus Thanks for your hint. Yes, previously it seems I did not start the jupyter notebook from the right python env. I did now - it doesn't work by default - but after using the LD_LIBRARY_PATH export above it also works in Jupyter Notebook.

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

No branches or pull requests

2 participants