2

I'm trying to use "reticulate" package to import 'mycode.py'. There are many questions on StackOverflow, but no one of them can solve my problem.

I did in 2 ways but I get quite the same error.

1) source_python("/user/mycode.py")

and I get this error:

Error in py_run_file_impl(file, local, convert) : ImportError: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /user/.conda/envs/myenv/lib/python3.7/site-packages/scipy/sparse/_sparsetools.cpython-37m-x86_64-linux-gnu.so)

2) import_from_path('mycode', path='/user/', convert=TRUE)

and I get this error:

Error in py_module_import(module, convert = convert) : ImportError: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /user/.conda/envs/myenv/lib/python3.7/site-packages/scipy/sparse/_sparsetools.cpython-37m-x86_64-linux-gnu.so)
utilizzatore
  • 33
  • 1
  • 3

1 Answers1

0

This is probably due to the compatibility between the version of libstdc++.so that come with Anaconda and the one installed on your system.

  1. Confirm that there is an libstdc++.so.6.0.xx in ~/anaconda3/lib/ (xx is replacement for the latest version, I think 27 is the very latest):

    ls libstdc++.so.6.0.*

  2. Confirm that there is a symlink libstdc++.so.6 in ~/anaconda3/lib/:

    ls libstdc++.so.6

  3. Remove the existing symlink (if it points to another version of libstdc++.so):

    rm ~/anaconda3/lib/libstdc++.so.6

  4. Relink it to libstdc++.so.6.0.xx:

    ln -s libstdc++.so.6.0.xx libstdc++.so.6

Jacques Gaudin
  • 15,779
  • 10
  • 54
  • 75