Anastasia Sidorova
Anastasia Sidorova

Reputation: 97

Cannot connect to google cloud datalab after installing python library

After installing LightFM library through the second way:

    %%bash
    echo "pip install lightfm" >> /content/datalab/.config/startup.sh
    cat /content/datalab/.config/startup.sh

I cannot connect to datalab instance using datalab connect command.

In the log files I see that datalab each time tries to install LightFM and finally breakimg down with error:

    Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-_irDy2/lightfm/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-0GIvgP-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-_irDy2/lightfm/

I think the deletion of the instance would not help. How can I solve this? Thank you

Upvotes: 1

Views: 360

Answers (1)

yelsayed
yelsayed

Reputation: 5532

Deleting the instance would help, but you don't have to do that.

Fixing this isn't straighforward unfortunately, I've opened an issue for this to be fixed in Datalab here.

You can ssh to the VM running Datalab, either by clicking the SSH button from the cloud console, or by running gcloud compute ssh user@vm if you have gcloud installed locally.

Once you're in the machine, you can find the startup.sh script and remove the erroneous line. Assuming you used the default settings when creating the instance, the file should be under /mnt/disks/datalab-pd/content/datalab/.config/. If you don't have an editor to use for this, you can install one, or you can just wipe the file (rename it to something else if you want to keep it around).

It's probably a good idea to make sure the commands you're adding to the startup script are not going to fail by running them first.

Upvotes: 3

Related Questions