Jupyter ImportError: dlopen cannot load (solved)

When import fastai in Jupyter I see the following error:
" ImportError: dlopen: cannot load any more object with static TLS "

My Jupyter server is running on AWS EC2 my laptop’s browser connects to it over SSH tunnel.

Before seeing this error I also saw the “missing cv2” error, but after running “conda env update” and “source activate fastai” commands, this “missing cv2” error is gone and then I start seeing the dlopen error. No idea about how to do it.

Refer to this picture,

thank you in advance!

See if any other Python programs are running that might be consuming resources or locking resources. This will show you the commands running that have Python in them:

ps auxwww|grep python

you can try killall python

thanks @parrt!!!. but I don’t see any other python processes running on the AWS EC2 instances.

BTW, I created this instance from the AMI: “Ubuntu Server 14.04 LTS (HVM), SSD Volume Type” does it matter? or I should use this one “Ubuntu Server 16.04 LTS (HVM), SSD Volume Type”?

I created mine with an image that had deep learning libraries on it. Did you create a t2.medium?

The first Google result indicates that it probably has something to do with opencsv: https://github.com/tensorflow/models/issues/523

Thank you @parrt, now it works!

From the above link people suggest amending some source code. But I am afraid modifying the fastai source code may not be practical. So I just terminate and create a new EC2 from another image, then set up from scratch and it works now.

In summary, here is my troubling shooting history in case anyone else is interested in:

my first Ubuntu image is “Ubuntu Server 16.04 LTS (HVM)” from Oregon, this image originally has about 80% (of 50GB) disk occupied, causing writing body error if I download the big csv data file, so I abandon it.

My second Ubuntu image is Ubuntu Server 14.04 LTS (HVM) from Oregon, it keeps prompting several ImportError when I run fastai lesson sample such as: cv2 (which can be solved by running source activate fastai, libSM (which can be solved by running sudo apt install python-qt4), and dlopen (which probably needs to change fastai source code per https://github.com/tensorflow/models/issues/523. This may not be easy for me to handle.)

Finally “Ubuntu Server 16.04 LTS (HVM)” from OHIO is good for all the things after solving the missing cv2 and libSM issues (like I mentioned above). The dlopen issue never shows up on this instance.

So, for some importing problems, I think AMI image from different region matters.

I’ve not tested on Ubuntu 14 at all, so safer to stick with 16.