Can not install tensorflow


I am just setup a new droplet and update/upgrade and when I pip install tensorflow it was killed

(my_env) root@cryptofeed:~# pip install tensorflow Collecting tensorflow Downloading tensorflow-2.4.0-cp38-cp38-manylinux2010_x86_64.whl (394.8 MB) |████████████████████████████████| 394.7 MB 24.4 MB/s eta 0:00:01Killed (my_env) root@cryptofeed:~#

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi @paveen,

Most probably the droplet’s RAM was not enough and the server killed the process. In such cases, I recommend creating swap in order for the droplet to handle processes that take more RAM than what it has.

How to add Swap File First SSH to your droplet

ssh root@YourDropletIP

Once inside, create a file that will be used for swap:

sudo fallocate -l 1G /swapfile

If faillocate is not installed or if you get an error message saying fallocate failed: Operation not supported then you can use the following command to create the swap file:

sudo dd if=/dev/zero of=/swapfile bs=1024 count=1048576

Only the root user should be able to write and read the swap file. To set the correct permissions type:

chmod 600 /swapfile

Use the mkswap utility to set up the file as Linux swap area:

sudo mkswap /swapfile

Enable the swap with the following command:

sudo swapon /swapfile

To make the change permanent open the /etc/fstab file and append the following line:

/swapfile swap swap defaults 0 0

Regards, KFSys