AstuteSource / chasten

:dizzy: Chasten Uses XML and XPATH to Check a Python Program's AST for Specified Patterns!
https://pypi.org/project/chasten/
GNU General Public License v2.0
7 stars 8 forks source link

Error while running chasten after fresh install #42

Closed simojo closed 12 months ago

simojo commented 1 year ago
simon@nixos /_scratch/chasten impure 127 chasten
Traceback (most recent call last):
  File "/home/simon/.cache/pypoetry/virtualenvs/chasten-LtXvhvXr-py3.11/bin/chasten", line 3, in <module>
    from chasten.main import cli
  File "/_scratch/chasten/chasten/main.py", line 13, in <module>
    from chasten import (
  File "/_scratch/chasten/chasten/database.py", line 9, in <module>
    from chasten import constants, enumerations, filesystem, output
  File "/_scratch/chasten/chasten/filesystem.py", line 10, in <module>
    import flatterer  # type: ignore
    ^^^^^^^^^^^^^^^^
  File "/home/simon/.cache/pypoetry/virtualenvs/chasten-LtXvhvXr-py3.11/lib/python3.11/site-packages/flatterer/__init__.py", line 8, in <module>
    import pandas
  File "/home/simon/.cache/pypoetry/virtualenvs/chasten-LtXvhvXr-py3.11/lib/python3.11/site-packages/pandas/__init__.py", line 16, in <module>
    raise ImportError(
ImportError: Unable to import required dependencies:
numpy:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

    https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  * The Python version is: Python3.11 from "/home/simon/.cache/pypoetry/virtualenvs/chasten-LtXvhvXr-py3.11/bin/python"
  * The NumPy version is: "1.25.2"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: libstdc++.so.6: cannot open shared object file: No such file or directory

I'm putting this here per @gkapfham. I will try telling ld about the location of the shared object file and get back to this issue.

simojo commented 12 months ago

Sure enough, it was ld. I solved this by executing the following command in bash:

export LD_LIBRARY_PATH="PATH_TO_GCC_INSTALL_DIR/lib:$LD_LIBRARY_PATH"

where PATH_TO_GCC_INSTALL_DIR is where you've installed gcc. This just appends the lib/ directory for gcc onto the LD_LIBRARY_PATH environment variable. Note that this was an issue on my pc and not an issue with chasten, but it's worth leaving here for others to use.