如何解决python包在静态TLS块错误中无法分配内存的问题

2024-04-25 23:47:40 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用ubuntu20.04和conda4.8.3。我已使用pippip install --force-reinstall --no-cache-dir gmsh-dev)在我的一个环境中安装了一个包,但当我尝试在jupyter笔记本中导入该包时,我遇到以下错误:

OSError: /home/alid/miniconda3/envs/new_env/lib/python3.9/site-packages/gmsh-git-Linux64-sdk/lib/libgmsh.so: cannot allocate memory in static TLS block

我不知道我有什么问题,非常感谢你的帮助


Tags: installpipnodevcache环境lib错误
1条回答
网友
1楼 · 发布于 2024-04-25 23:47:40

基于how others solved similar problems,尝试将其添加到LD_PRELOAD

## set the env var for "new_env" environment
conda env config vars set -n new_env LD_PRELOAD='/home/alid/miniconda3/envs/new_env/lib/python3.9/site-packages/gmsh-git-Linux64-sdk/lib/libgmsh.so'

## test importing
conda run -n new_env python -c "import gmsh"

the documentation on managing environment variables in Conda envs

相关问题 更多 >