Python Forum
Running Miniconda on a Linux-Box: adding the vscode and Spyder to the whole system
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Running Miniconda on a Linux-Box: adding the vscode and Spyder to the whole system
#1
good day dear community,

Running Miniconda on a Linux-Box: adding the vscode and Spyder to the whole system

i have done lots of setups - for example i am running Anaconda both on Win and MX-Linux.

well now i want to give conda a try:

well i guess it is a bit more tricky:

can we do it like so:


we need a snippet that helps to create a directory to install miniconda into it,
After we have set up this - then we can start to download the latest python 3 based install script for Linux 64 bit,

Done so we an go ahead and try to execute or run the install script which helps us :- subsequently we can at the end delete the install script,

Then - at this point we can do the adding and intializing of Conda:

--a conda initialize to our bash or the so called zsh shell.


That said: If we follow ths path then we at the  can do  a cool restart of the shell and conda will be ready to go.

mkdir -p ~/miniconda3
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
rm -rf ~/miniconda3/miniconda.sh
~/miniconda3/bin/conda init bash
~/miniconda3/bin/conda init zsh
If we are here we can go ahead: # note: we just have done one important thing. We ve fetched Anaconda via wget

that wen very nice.
now we can do even more: the miniconda.sh has got some cool basic options.
Most notably we can say that we just have used -b to be able to run the whole thing unattended, which means that all of the agreements are automatically accepted without user prompt. I like this option very very much. It is pretty cool. But there is even more.

-u updates any existing installation in the directory of install if there is one. -p is the directory to install into.


here i have a litte - lets say - cheat sheet that helps us with the usage:

see more /root/miniconda3/miniconda.sh [options]

Installs Miniconda - the version - see 3 xyz

-b           run install in batch mode (without manual intervention),
             it is expected the license terms are agreed upon
-f           no error if install prefix already exists
-h           print this help message and exit
-p PREFIX    install prefix, defaults to /root/miniconda3, must not contain spaces.
-s           skip running pre/post-link/install scripts
-u           update an existing installation
-t           run package tests after installation (may install conda-build)
at the end oft theday we have even more options

Silent/Logged
A quick and easy way to silence everything or to log it to a file during an automated install is to wrap the script into a bash function, or save it to its own file, and call the file. I like the function method since I can still copy it right into a terminal, or keep my install script as one single file.
install_miniconda () {
mkdir -p ~/miniconda3
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
rm -rf ~/miniconda3/miniconda.sh
~/miniconda3/bin/conda init bash
~/miniconda3/bin/conda init zsh
}
normal
But wait: What do we do now: note: now we need to have packages and all that things.

how to do now more -

a. the installation of all the packages
b.. the installation of VSCode and Spyder and Jupyter notebook!?


any idea or tipp!?
Wordpress - super toolkits a. http://wpgear.org/ :: und b. https://github.com/miziomon/awesome-wordpress :: Awesome WordPress: A curated list of amazingly awesome WordPress resources and awesome python things https://github.com/vinta/awesome-python
Reply
#2
(Jun-21-2021, 04:33 PM)apollo Wrote: i have done lots of setups - for example i am running Anaconda both on Win and MX-Linux.

well now i want to give conda a try:
Yes and i answer in some of them,but i know how much if this you have understand or have taken in.
As you ask most the same question and seems not to grabs the basic of this.

Conda is the Package,Installer manager for Anaconda/Miniconda,
same as pip is Package,Installer manager for Python.
Anaconda/Miniconda come with conda(so you can not give conda a try alone).

(Jun-21-2021, 04:33 PM)apollo Wrote: a. the installation of all the packages
You install with conda(preferably) or pip.
First activate (base) environment always.
Then if i do run it look like this, install pandas
# Activate (base) environment  
(miniforge3-4.10.1-3) tom@tom-VirtualBox:~$ conda activate

# Check version
(base) (miniforge3-4.10.1-3) tom@tom-VirtualBox:~$ conda -V
conda 4.10.1

# Python version
(base) (miniforge3-4.10.1-3) tom@tom-VirtualBox:~$ python -V
Python 3.9.4

# See that is use MiniConda
(base) (miniforge3-4.10.1-3) tom@tom-VirtualBox:~$ which python
/home/tom/.pyenv/versions/miniforge3-4.10.1-3/bin/python

# Install pandas
(base) (miniforge3-4.10.1-3) tom@tom-VirtualBox:~$ conda install -c conda-forge pandas
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /home/tom/.pyenv/versions/miniforge3-4.10.1-3

  added / updated specs:
    - pandas


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    libblas-3.9.0              |       9_openblas          11 KB  conda-forge
    libcblas-3.9.0             |       9_openblas          11 KB  conda-forge
    libgfortran-ng-9.3.0       |      hff62375_19          22 KB  conda-forge
    libgfortran5-9.3.0         |      hff62375_19         2.0 MB  conda-forge
    liblapack-3.9.0            |       9_openblas          11 KB  conda-forge
    libopenblas-0.3.15         |pthreads_h8fe5266_1         9.2 MB  conda-forge
    numpy-1.21.0               |   py39hdbf815f_0         6.2 MB  conda-forge
    pandas-1.2.5               |   py39hde0f152_0        12.1 MB  conda-forge
    python-dateutil-2.8.1      |             py_0         220 KB  conda-forge
    pytz-2021.1                |     pyhd8ed1ab_0         239 KB  conda-forge
    ------------------------------------------------------------
                                           Total:        29.8 MB

The following NEW packages will be INSTALLED:

  libblas            conda-forge/linux-64::libblas-3.9.0-9_openblas
  libcblas           conda-forge/linux-64::libcblas-3.9.0-9_openblas
  libgfortran-ng     conda-forge/linux-64::libgfortran-ng-9.3.0-hff62375_19
  libgfortran5       conda-forge/linux-64::libgfortran5-9.3.0-hff62375_19
  liblapack          conda-forge/linux-64::liblapack-3.9.0-9_openblas
  libopenblas        conda-forge/linux-64::libopenblas-0.3.15-pthreads_h8fe5266_1
  numpy              conda-forge/linux-64::numpy-1.21.0-py39hdbf815f_0
  pandas             conda-forge/linux-64::pandas-1.2.5-py39hde0f152_0
  python-dateutil    conda-forge/noarch::python-dateutil-2.8.1-py_0
  pytz               conda-forge/noarch::pytz-2021.1-pyhd8ed1ab_0


Proceed ([y]/n)? y


Downloading and Extracting Packages
libopenblas-0.3.15   | 9.2 MB    | ###################################################################################### | 100% 
libgfortran-ng-9.3.0 | 22 KB     | ###################################################################################### | 100% 
pandas-1.2.5         | 12.1 MB   | ###################################################################################### | 100% 
liblapack-3.9.0      | 11 KB     | ###################################################################################### | 100% 
libgfortran5-9.3.0   | 2.0 MB    | ###################################################################################### | 100% 
libcblas-3.9.0       | 11 KB     | ###################################################################################### | 100% 
libblas-3.9.0        | 11 KB     | ###################################################################################### | 100% 
pytz-2021.1          | 239 KB    | ###################################################################################### | 100% 
numpy-1.21.0         | 6.2 MB    | ###################################################################################### | 100% 
python-dateutil-2.8. | 220 KB    | ###################################################################################### | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

# Test that it works
(base) (miniforge3-4.10.1-3) tom@tom-VirtualBox:~$ python
Python 3.9.4 | packaged by conda-forge | (default, May 10 2021, 22:13:33) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas as pd
>>> 
>>> pd.__version__
'1.2.5'
>>> exit()
Or you make a new environment as i show in this Thread.
Reply
#3
hello dear Snippsat,

many many thanks for the quick answer. I am very glad that you are here in this place of great help and excellent support.

note: i have seen / encountered some situations of dependencies hell with VSCode /in combination with PlatformIo and other things -while the vsCode was not configured well.

so i am a bit unsecure regarding the basic setup of VScode - but with Anaconda - it looks manageable and above all. With your great support i feel encouraged to go ahead.

As allways: youre help is so great and i am very glad to be part of this awesome community,

have a great day.

greetings apollo Smile
Wordpress - super toolkits a. http://wpgear.org/ :: und b. https://github.com/miziomon/awesome-wordpress :: Awesome WordPress: A curated list of amazingly awesome WordPress resources and awesome python things https://github.com/vinta/awesome-python
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Looking for Linux system logging daemon j.crater 3 5,333 Oct-20-2016, 05:40 AM
Last Post: j.crater

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020