morris-lab / CellOracle

This is the alpha version of the CellOracle package
Other
290 stars 49 forks source link

ImportError: dlopen: cannot load any more object with static TLS #138

Open LJK1991 opened 1 year ago

LJK1991 commented 1 year ago

I am trying to install celloracle on a server for work. During the installation i had some errors, but following the troubleshooting the pip install celloracle completed succesfully.

When i then run python and try to import celloracle this error occurs

(celloracle_env) lucask$ python
Python 3.8.17 | packaged by conda-forge | (default, Jun 16 2023, 07:06:00)
[GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import celloracle
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/media/draco/lucask/mambaforge/envs/celloracle_env/lib/python3.8/site-packages/celloracle/__init__.py", line 8, in <module>
    from . import utility, network, network_analysis, go_analysis, data, data_conversion, oracle_utility
  File "/media/draco/lucask/mambaforge/envs/celloracle_env/lib/python3.8/site-packages/celloracle/utility/__init__.py", line 9, in <module>
    from .utility import (save_as_pickled_object, load_pickled_object,
  File "/media/draco/lucask/mambaforge/envs/celloracle_env/lib/python3.8/site-packages/celloracle/utility/utility.py", line 17, in <module>
    from sklearn.preprocessing import StandardScaler
  File "/media/draco/lucask/mambaforge/envs/celloracle_env/lib/python3.8/site-packages/sklearn/__init__.py", line 83, in <module>
    from .utils._show_versions import show_versions
  File "/media/draco/lucask/mambaforge/envs/celloracle_env/lib/python3.8/site-packages/sklearn/utils/_show_versions.py", line 14, in <module>
    from ._openmp_helpers import _openmp_parallelism_enabled
ImportError: dlopen: cannot load any more object with static TLS

I am not sure how to fix this, i installed everything in a seperate conda env (using mamba, if that matters). I tried to google and have looked through the Issues but could not find a solution.

Regards, Lucas

P.S. I am not sure if there is other information that is required to fix this problem. if so, please let me know how to obtain it and will provide it as quickly as possible

KenjiKamimoto-wustl122 commented 1 year ago

@LJK1991

Thank you for your feedback! I'm guessing this error is caused by sklearn. Can you please tell me installed sklearn version?

Although I'm not sure the exact cause of this error, these reports might be related. https://github.com/scikit-learn/scikit-learn/issues/14485 https://forum.qiime2.org/t/dlopen-cannot-load-any-more-object-with-static-tls/24970

LJK1991 commented 1 year ago

@KenjiKamimoto-wustl122, thanks for the quick response.

I had found the same thread and have tried re-installing scikit-learn on a few diffferent versions (0.20.3,1.2.0,1.3.0) however it does not seem to fix the issue. Currently i have it installed as 1.2.0

Python 3.8.17 | packaged by conda-forge | (default, Jun 16 2023, 07:06:00)
[GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sklearn
>>> sklearn.__version__
'1.2.0'
>>> import celloracle as co
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/media/draco/lucask/mambaforge/envs/celloracle_env/lib/python3.8/site-packages/celloracle/__init__.py", line 8, in <module>
    from . import utility, network, network_analysis, go_analysis, data, data_conversion, oracle_utility
  File "/media/draco/lucask/mambaforge/envs/celloracle_env/lib/python3.8/site-packages/celloracle/utility/__init__.py", line 18, in <module>
    from .load_hdf5 import load_hdf5
  File "/media/draco/lucask/mambaforge/envs/celloracle_env/lib/python3.8/site-packages/celloracle/utility/load_hdf5.py", line 5, in <module>
    from ..network_analysis import load_links
  File "/media/draco/lucask/mambaforge/envs/celloracle_env/lib/python3.8/site-packages/celloracle/network_analysis/__init__.py", line 9, in <module>
    from .network_construction import get_links
  File "/media/draco/lucask/mambaforge/envs/celloracle_env/lib/python3.8/site-packages/celloracle/network_analysis/network_construction.py", line 26, in <module>
    from ..network.net_core import Net
  File "/media/draco/lucask/mambaforge/envs/celloracle_env/lib/python3.8/site-packages/celloracle/network/__init__.py", line 7, in <module>
    from .net_util import load_net_from_patquets, getDF_TGxTF, getDF_peakxTF, load_net
  File "/media/draco/lucask/mambaforge/envs/celloracle_env/lib/python3.8/site-packages/celloracle/network/net_util.py", line 26, in <module>
    from velocyto.serialization import dump_hdf5, load_hdf5
  File "/media/draco/lucask/mambaforge/envs/celloracle_env/lib/python3.8/site-packages/velocyto/__init__.py", line 13, in <module>
    from .estimation import fit_slope, _fit1_slope, clusters_stats
  File "/media/draco/lucask/mambaforge/envs/celloracle_env/lib/python3.8/site-packages/velocyto/estimation.py", line 7, in <module>
    from .speedboosted import _colDeltaCor, _colDeltaCorLog10, _colDeltaCorSqrt
ImportError: dlopen: cannot load any more object with static TLS
>>> import velocyto
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/media/draco/lucask/mambaforge/envs/celloracle_env/lib/python3.8/site-packages/velocyto/__init__.py", line 13, in <module>
    from .estimation import fit_slope, _fit1_slope, clusters_stats
  File "/media/draco/lucask/mambaforge/envs/celloracle_env/lib/python3.8/site-packages/velocyto/estimation.py", line 7, in <module>
    from .speedboosted import _colDeltaCor, _colDeltaCorLog10, _colDeltaCorSqrt
ImportError: dlopen: cannot load any more object with static TLS
>>>

Although i get the same ImportError, it seems the source changed slightly, where first if mentioned the sklearn as a source packace it now does so with velocyto. I also get the same error when importing velocyto by itself.

I tried the same as i did with sklearn, using pip uninstall velocyto and subsequently pip install velocyto==0.x.x that did not work. i also tried https://github.com/velocyto-team/velocyto.py/issues/277 but that did not fix the issue.