BerkeleyLearnVerify / Scenic

A compiler and scenario generator for the Scenic scenario description language.
https://scenic-lang.org/
Other
271 stars 93 forks source link

ValueError: No FCL available despite package being installed. #150

Closed abadithela closed 10 months ago

abadithela commented 1 year ago

Hi,

I've installed Scenic on MacBook Pro (Apple M2 chip). I followed the installation instructions here to install from the Scenic repository. For scenic --version, I get: Scenic 3.0.0b2.

However, on running the suggested example, scenic examples/webots/vacuum/vacuum_simple.scenic, I get the following error:

Beginning scenario construction...
  Pruning scenario...
    Region containment constraint pruning attempted but could not compute percentage for <MeshSurfaceRegion> and <IntersectionRegion>.
  Pruned scenario in 0.002727 seconds.
Scenario constructed in 0.47 seconds.
Traceback (most recent call last):
  File "/Users/apurvabadithela/anaconda3/envs/scenic_env/bin/scenic", line 5, in <module>
    from scenic.__main__ import dummy
  File "/Users/apurvabadithela/software/Scenic/src/scenic/__main__.py", line 270, in <module>
    scene, _ = generateScene()
  File "/Users/apurvabadithela/software/Scenic/src/scenic/__main__.py", line 213, in generateScene
    scene, iterations = errors.callBeginningScenicTrace(
  File "/Users/apurvabadithela/software/Scenic/src/scenic/core/errors.py", line 282, in callBeginningScenicTrace
    return func()
  File "/Users/apurvabadithela/software/Scenic/src/scenic/__main__.py", line 214, in <lambda>
    lambda: scenario.generate(maxIterations=maxIterations, verbosity=args.verbosity)
  File "/Users/apurvabadithela/software/Scenic/src/scenic/core/scenarios.py", line 387, in generate
    scenes, iterations = self.generateBatch(1, maxIterations, verbosity, feedback)
  File "/Users/apurvabadithela/software/Scenic/src/scenic/core/scenarios.py", line 417, in generateBatch
    scene, iterations = self._generateInner(remainingIts, verbosity, feedback)
  File "/Users/apurvabadithela/software/Scenic/src/scenic/core/scenarios.py", line 467, in _generateInner
    rejection = self.checker.checkRequirements(sample)
  File "/Users/apurvabadithela/software/Scenic/src/scenic/core/sample_checking.py", line 26, in checkRequirements
    return self.checkRequirementsInner(sample)
  File "/Users/apurvabadithela/software/Scenic/src/scenic/core/sample_checking.py", line 94, in checkRequirementsInner
    rejected = req.falsifiedBy(sample)
  File "/Users/apurvabadithela/software/Scenic/src/scenic/core/requirements.py", line 281, in falsifiedBy
    return self.falsifiedByInner(sample)
  File "/Users/apurvabadithela/software/Scenic/src/scenic/core/requirements.py", line 316, in falsifiedByInner
    cm = trimesh.collision.CollisionManager()
  File "/Users/apurvabadithela/anaconda3/envs/scenic_env/lib/python3.10/site-packages/trimesh/collision.py", line 174, in __init__
    raise ValueError(
ValueError: No FCL Available! Please install the python-fcl library

I double-checked to make sure I have the python-fcl package --- I tried installing it again and ran conda list and it shows that python-fcl is installed:

python-fcl                0.7.0.4                  pypi_0    pypi

I investigated further by looking at what is throwing the error inside trimesh/collision.py --- it seems that fcl is not importing correctly. To find the error, I opened an interactive Python session in the terminal and typed import fcl and it returned with the following error:

import fcl
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/apurvabadithela/anaconda3/envs/scenic_env/lib/python3.10/site-packages/fcl/__init__.py", line 2, in <module>
    from .fcl import (
ImportError: dlopen(/Users/apurvabadithela/anaconda3/envs/scenic_env/lib/python3.10/site-packages/fcl/fcl.cpython-310-darwin.so, 0x0002): symbol not found in flat namespace '__ZNK3fcl17CollisionGeometryIdE34computeMomentofInertiaRelatedToCOMEv'

Could you please help me fix this ValueError? Thanks.

shumbo commented 1 year ago

@abadithela There is an instruction on how to install python-fcl on Apple Silicon Macs.

https://scenic-lang.readthedocs.io/en/latest/install_notes.html#installing-python-fcl-on-apple-silicon

Could you try following the instruction? I'd be happy to help if it doesn't work.

Eric-Vin commented 10 months ago

Closing this due to inactivity. Please let us know if there are any remaining issues.