The bioBakery help forum

Halla install error

Hi there!

I ran pip install halla successfully in Ubuntu 18.04, but when I run halla, it gave the following error:

$ /home/jessie/.local/bin/halla --help
Error: package or namespace load failed for ‘methods’ in dyn.load(file, DLLpath = DLLpath, …):
unable to load shared object ‘/exeh_3/jessie/software/R-4.1.0/lib/R/library/methods/libs/methods.so’:
/exeh_3/jessie/software/R-4.1.0/lib/R/library/methods/libs/methods.so: undefined symbol: ALTREP_LENGTH
Error: package or namespace load failed for ‘utils’ in dyn.load(file, DLLpath = DLLpath, …):
unable to load shared object ‘/exeh_3/jessie/software/R-4.1.0/lib/R/library/utils/libs/utils.so’:
/exeh_3/jessie/software/R-4.1.0/lib/R/library/utils/libs/utils.so: undefined symbol: IS_ASCII
Error: package or namespace load failed for ‘grDevices’ in dyn.load(file, DLLpath = DLLpath, …):
unable to load shared object ‘/exeh_3/jessie/software/R-4.1.0/lib/R/library/grDevices/libs/grDevices.so’:
/exeh_3/jessie/software/R-4.1.0/lib/R/library/grDevices/libs/grDevices.so: undefined symbol: R_GE_linearGradientColour
Error: package or namespace load failed for ‘graphics’ in dyn.load(file, DLLpath = DLLpath, …):
unable to load shared object ‘/exeh_3/jessie/software/R-4.1.0/lib/R/library/grDevices/libs/grDevices.so’:
/exeh_3/jessie/software/R-4.1.0/lib/R/library/grDevices/libs/grDevices.so: undefined symbol: R_GE_linearGradientColour
Error: package or namespace load failed for ‘stats’ in dyn.load(file, DLLpath = DLLpath, …):
unable to load shared object ‘/exeh_3/jessie/software/R-4.1.0/lib/R/library/grDevices/libs/grDevices.so’:
/exeh_3/jessie/software/R-4.1.0/lib/R/library/grDevices/libs/grDevices.so: undefined symbol: R_GE_linearGradientColour
Error: package or namespace load failed for ‘methods’ in dyn.load(file, DLLpath = DLLpath, …):
unable to load shared object ‘/exeh_3/jessie/software/R-4.1.0/lib/R/library/methods/libs/methods.so’:
/exeh_3/jessie/software/R-4.1.0/lib/R/library/methods/libs/methods.so: undefined symbol: ALTREP_LENGTH
During startup - Warning messages:
1: package “methods” in options(“defaultPackages”) was not found
2: package ‘utils’ in options(“defaultPackages”) was not found
3: package ‘grDevices’ in options(“defaultPackages”) was not found
4: package ‘graphics’ in options(“defaultPackages”) was not found
5: package ‘stats’ in options(“defaultPackages”) was not found
6: package ‘methods’ in options(“defaultPackages”) was not found
R[write to console]: Error in dyn.load(file, DLLpath = DLLpath, …) :
unable to load shared object ‘/exeh_3/jessie/software/R-4.1.0/lib/R/library/methods/libs/methods.so’:
/exeh_3/jessie/software/R-4.1.0/lib/R/library/methods/libs/methods.so: undefined symbol: ALTREP_LENGTH

Traceback (most recent call last):
File “/home/jessie/.local/bin/halla”, line 5, in
from scripts.halla import main
File “/home/jessie/.local/lib/python3.7/site-packages/scripts/halla.py”, line 10, in
from halla import HAllA, AllA
File “/home/jessie/.local/lib/python3.7/site-packages/halla/init.py”, line 1, in
from .main import HAllA, AllA
File “/home/jessie/.local/lib/python3.7/site-packages/halla/main.py”, line 2, in
from .hierarchy import HierarchicalTree
File “/home/jessie/.local/lib/python3.7/site-packages/halla/hierarchy.py”, line 1, in
from .utils.similarity import get_similarity_function, similarity2distance
File “/home/jessie/.local/lib/python3.7/site-packages/halla/utils/similarity.py”, line 6, in
from rpy2.robjects.packages import importr
File “/home/jessie/.local/lib/python3.7/site-packages/rpy2/robjects/init.py”, line 19, in
from rpy2.robjects.robject import RObjectMixin, RObject
File “/home/jessie/.local/lib/python3.7/site-packages/rpy2/robjects/robject.py”, line 58, in
class RObjectMixin(object):
File “/home/jessie/.local/lib/python3.7/site-packages/rpy2/robjects/robject.py”, line 70, in RObjectMixin
__show = _get_exported_value(‘methods’, ‘show’)
File “/home/jessie/.local/lib/python3.7/site-packages/rpy2/rinterface_lib/conversion.py”, line 45, in _
cdata = function(*args, **kwargs)
File “/home/jessie/.local/lib/python3.7/site-packages/rpy2/rinterface.py”, line 680, in call
raise embedded.RRuntimeError(_rinterface._geterrmessage())
rpy2.rinterface_lib.embedded.RRuntimeError: Error in dyn.load(file, DLLpath = DLLpath, …) :
unable to load shared object ‘/exeh_3/jessie/software/R-4.1.0/lib/R/library/methods/libs/methods.so’:
/exeh_3/jessie/software/R-4.1.0/lib/R/library/methods/libs/methods.so: undefined symbol: ALTREP_LENGTH

I googled this question, but still failed to solve it. Any suggestion will be greatly appreciated. Thanks in advance!

Best regards,
Jessie

Did you have R installed before installing HAllA? What output do you get from the following python code?

import rpy2.robjects as robjects
print(robjects.r(".libPaths()"))

Dear Andrew Ghazi,

Thank you for very much for your quick reply. I have installed R before installing HAIIA. And the following is the output for your code:

$ python
Python 3.7.7 (default, Mar 26 2020, 15:48:22)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type “help”, “copyright”, “credits” or “license” for more information.

import rpy2.robjects as robjects
Error: package or namespace load failed for ‘methods’ in dyn.load(file, DLLpath = DLLpath, …):
unable to load shared object ‘/exeh_3/jessie/software/R-4.1.0/lib/R/library/methods/libs/methods.so’:
/exeh_3/jessie/software/R-4.1.0/lib/R/library/methods/libs/methods.so: undefined symbol: ALTREP_LENGTH
Error: package or namespace load failed for ‘utils’ in dyn.load(file, DLLpath = DLLpath, …):
unable to load shared object ‘/exeh_3/jessie/software/R-4.1.0/lib/R/library/utils/libs/utils.so’:
/exeh_3/jessie/software/R-4.1.0/lib/R/library/utils/libs/utils.so: undefined symbol: IS_ASCII
Error: package or namespace load failed for ‘grDevices’ in dyn.load(file, DLLpath = DLLpath, …):
unable to load shared object ‘/exeh_3/jessie/software/R-4.1.0/lib/R/library/grDevices/libs/grDevices.so’:
/exeh_3/jessie/software/R-4.1.0/lib/R/library/grDevices/libs/grDevices.so: undefined symbol: R_GE_linearGradientColour
Error: package or namespace load failed for ‘graphics’ in dyn.load(file, DLLpath = DLLpath, …):
unable to load shared object ‘/exeh_3/jessie/software/R-4.1.0/lib/R/library/grDevices/libs/grDevices.so’:
/exeh_3/jessie/software/R-4.1.0/lib/R/library/grDevices/libs/grDevices.so: undefined symbol: R_GE_linearGradientColour
Error: package or namespace load failed for ‘stats’ in dyn.load(file, DLLpath = DLLpath, …):
unable to load shared object ‘/exeh_3/jessie/software/R-4.1.0/lib/R/library/grDevices/libs/grDevices.so’:
/exeh_3/jessie/software/R-4.1.0/lib/R/library/grDevices/libs/grDevices.so: undefined symbol: R_GE_linearGradientColour
Error: package or namespace load failed for ‘methods’ in dyn.load(file, DLLpath = DLLpath, …):
unable to load shared object ‘/exeh_3/jessie/software/R-4.1.0/lib/R/library/methods/libs/methods.so’:
/exeh_3/jessie/software/R-4.1.0/lib/R/library/methods/libs/methods.so: undefined symbol: ALTREP_LENGTH
During startup - Warning messages:
1: package “methods” in options(“defaultPackages”) was not found
2: package ‘utils’ in options(“defaultPackages”) was not found
3: package ‘grDevices’ in options(“defaultPackages”) was not found
4: package ‘graphics’ in options(“defaultPackages”) was not found
5: package ‘stats’ in options(“defaultPackages”) was not found
6: package ‘methods’ in options(“defaultPackages”) was not found
R[write to console]: Error in dyn.load(file, DLLpath = DLLpath, …) :
unable to load shared object ‘/exeh_3/jessie/software/R-4.1.0/lib/R/library/methods/libs/methods.so’:
/exeh_3/jessie/software/R-4.1.0/lib/R/library/methods/libs/methods.so: undefined symbol: ALTREP_LENGTH

Traceback (most recent call last):
File “”, line 1, in
File “/home/jessie/.local/lib/python3.7/site-packages/rpy2/robjects/init.py”, line 19, in
from rpy2.robjects.robject import RObjectMixin, RObject
File “/home/jessie/.local/lib/python3.7/site-packages/rpy2/robjects/robject.py”, line 58, in
class RObjectMixin(object):
File “/home/jessie/.local/lib/python3.7/site-packages/rpy2/robjects/robject.py”, line 70, in RObjectMixin
__show = _get_exported_value(‘methods’, ‘show’)
File “/home/jessie/.local/lib/python3.7/site-packages/rpy2/rinterface_lib/conversion.py”, line 45, in _
cdata = function(*args, **kwargs)
File “/home/jessie/.local/lib/python3.7/site-packages/rpy2/rinterface.py”, line 680, in call
raise embedded.RRuntimeError(_rinterface._geterrmessage())
rpy2.rinterface_lib.embedded.RRuntimeError: Error in dyn.load(file, DLLpath = DLLpath, …) :
unable to load shared object ‘/exeh_3/jessie/software/R-4.1.0/lib/R/library/methods/libs/methods.so’:
/exeh_3/jessie/software/R-4.1.0/lib/R/library/methods/libs/methods.so: undefined symbol: ALTREP_LENGTH

print(robjects.r(".libPaths()"))
Traceback (most recent call last):
File “”, line 1, in
NameError: name ‘robjects’ is not defined

My R sessionInfo is:

library(eva)
library(XICOR)
sessionInfo()
R version 4.1.0 (2021-05-18)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.3 LTS

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1

locale:
[1] LC_CTYPE=en_HK.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_HK.UTF-8 LC_COLLATE=en_HK.UTF-8
[5] LC_MONETARY=en_HK.UTF-8 LC_MESSAGES=en_HK.UTF-8
[7] LC_PAPER=en_HK.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_HK.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] XICOR_0.3.3 eva_0.2.6

loaded via a namespace (and not attached):
[1] compiler_4.1.0 Matrix_1.3-3 parallel_4.1.0 grid_4.1.0
[5] lattice_0.20-44

Many thanks again!

Best regards,
Jessie

It seems your rpy2 installation is broken, try reinstalling that then manually using rpy2 to install eva and XICOR like so: R packages — rpy2 2.9.4 documentation

Dear Andrew Ghazi,

I tried your method but still failed. I installed rpy2 from source by typing:

tar -zxf rpy2-3.4.5.tar.gz
cd rpy2-3.4.5
python setup.py build install

The above commands run smoothly. However, when I run import rpy2.robjects as robjects in python. The same errors occured.

To debug, I typed:
$ python -m rpy2.situation
rpy2 version:
3.4.5
Python version:
3.7.7 (default, Mar 26 2020, 15:48:22)
[GCC 7.3.0]
Looking for R’s HOME:
Environment variable R_HOME: None
Calling R RHOME: /exeh_3/jessie/software/R-4.1.0/lib/R
Environment variable R_LIBS_USER: None
R’s additions to LD_LIBRARY_PATH:
/home/jessie/src/software/openssl/lib/:/home/jessie/src/software/openssl/lib/
R version:
In the PATH: R version 4.1.0 (2021-05-18) – “Camp Pontanezen”
Loading R library from rpy2: OK
Additional directories to load R packages from:
None
C extension compilation:
include:
[’/exeh_3/jessie/software/R-4.1.0/lib/R/include’]
libraries:
[‘R’, ‘pcre’, ‘lzma’, ‘bz2’, ‘z’, ‘rt’, ‘dl’, ‘m’, ‘icuuc’, ‘icui18n’]
library_dirs:
[’/usr/local/lib’, ‘/exeh_3/jessie/software/R-4.1.0/lib/R/lib’]
extra_compile_args:
[]
extra_link_args:
[’-Wl,–export-dynamic’, ‘-fopenmp’]

I noted the LD_LIBRARY_PATH is /home/jessie/src/software/openssl/lib/:/home/jessie/src/software/openssl/lib/, which turned out an invalid path (this path does not exist) that were included my .bashrc file. Therefore, I commented this line in .bashrc file and restarted a session. Then I reinstalled rpy2 using the same commands as above. This time the command ‘python -m rpy2.situation’ give the following output:
$ python -m rpy2.situation
rpy2 version:
3.4.5
Python version:
3.7.7 (default, Mar 26 2020, 15:48:22)
[GCC 7.3.0]
Looking for R’s HOME:
Environment variable R_HOME: None
Calling R RHOME: /exeh_3/jessie/software/R-4.1.0/lib/R
Environment variable R_LIBS_USER: None
R’s additions to LD_LIBRARY_PATH:
/exeh_3/jessie/software/R-4.1.0/lib/R/lib:/usr/local/lib:/exeh_3/jessie/src/jdk-16.0.1/lib/server
R version:
In the PATH: R version 4.1.0 (2021-05-18) – “Camp Pontanezen”
Loading R library from rpy2: OK
Additional directories to load R packages from:
None
C extension compilation:
include:
[’/exeh_3/jessie/software/R-4.1.0/lib/R/include’]
libraries:
[‘R’, ‘pcre’, ‘lzma’, ‘bz2’, ‘z’, ‘rt’, ‘dl’, ‘m’, ‘icuuc’, ‘icui18n’]
library_dirs:
[’/usr/local/lib’, ‘/exeh_3/jessie/software/R-4.1.0/lib/R/lib’]
extra_compile_args:
[]
extra_link_args:
[’-Wl,–export-dynamic’, ‘-fopenmp’]

The LD_LIBRARY_PATH became /exeh_3/jessie/software/R-4.1.0/lib/R/lib:/usr/local/lib:/exeh_3/jessie/src/jdk-16.0.1/lib/server

After this change, I ran ‘import rpy2.robjects as robjects’ in python, but still got the same error. I have no idea currently. How to install rpy2 correctly?

Thank you very much for your time and patience.

Best regards,
Jessie

Dear Andrew Ghazi,

I finally made it by changing the LD_LIBRARY_PATH in my ~/.bashrc file:
export LD_LIBRARY_PATH="/exeh_3/jessie/software/R-4.1.0/lib/R/lib:/usr/local/lib:$LD_LIBRARY_PATH"

Now HAllA can be used normally. Many thanks for your guidance!

Best regards,
Jessie

Great, glad you were able to get it sorted.