Install Spyder5 in Linux Mint Cinnamon 21

alpfa4a
  1 year ago
  0

Install Spyder5 in Linux Mint Cinnamon 21

=================================================================================

 

Requirements

  • «virtualenv»
  • «python3-pip»

Method

  • «virtualenv»

Create a Directory for your projects

~$ mkdir ~/Test
~$ cd ~/Test
~/Test$ virtualenv --version                         # Check if it is installed
If no...
~/Test$ sudo apt install python3-pip
~/Test$ pip3 install virtualenv


Create the virtual environment for your projects in the `Test` folder 
~/Test$ virtualenv Test

Activate the virtual environment for the `Test` folder
~/Test$ source Test/bin/activate virtualenv

 activates the virtual environment for the `Test` folder, it can be seen in the change that has been made in the console:

(Tess) user@hostname:~/Test$                      # Virtual Environment Enabled
*************************************************************************************************************
Note

To disable the virtual environment for the `Test` folder, the following command is used
(Tess) user@hostname:~/Test$ deactivate           # to disable Virtual Environment
*****************************************************************************************************************

Now with our virtual environment Activated, we are going to install `Spyder`
(Tess) user@hostname:~/Test$ pip3 install spyder


The `pip3 install spyder` command downloads the packages required for Spyder to work fully, as you can see it installs the latest and
more complete version --> spyder-5.4.0

By default, the installer does not download the `matplotlib` package, which is essential for generating the plots of your functions.

We can install the `matplotlib` package in our virtual environment, with the command:
(Tess) user@hostname:~/Test$ pip3 install matplotlib
To start Spyder, from the console with virtual space Enabled, we execute the command `spyder`
(Tess) user@hostname:~/Test$ spyder
The Spyder 5 graphical interface will open. Now we have the powerful Spyder scientific environment to work our Linux projects with Python. 


Sources and more information:
    https://pypi.org/project/spyder/

    https://docs.spyder-ide.org/current/index.html

    https://docs.spyder-ide.org/current/installation.html

    https://www.delftstack.com/howto/python/how-to-create-and-activate-a-python-virtual-environment/

Create Launcher (Desktop Entry)
===============================
In the folder ~/.local/share/applications/ create a file with the launcher information and save it as:

spyder.desktop
#!/usr/bin/env xdg-open
[Desktop Entry]
Type=Application
Version=5.4.0
Name=Spyder IDE
GenericName=Spyder
Comment=The Scientific Python Development Environment
Icon=~/Prueba/Prueba/share/icons/spyder.png
Exec=~/Prueba/Prueba/bin/spyder %f
Terminal=False
MimeType=text/x-python;
Categories=Development;Science;IDE;Qt;GNOME;GTK;Utility;TextEditor;
Keywords=Development;Science;IDE;Qt;
StartupNotify=true
StartupWMClass=Spyder

I hope it is useful.
Merry Christmas