Installing Anaconda On Linux If Miniconda already installed - linux

I am using a CentOs Distribution of Linux and have miniconda already installed along with conda environments that I created with it. I am trying to install anaconda now. Do I have to uninstall miniconda first? I have some environments that I created with miniconda that I would like to keep. Is it possible to keep those environments if I uninstall it? The reason I need anaconda is I'd like to create environments inside my singularity container. How would it be possible to keep both? Thanks.

Both Miniconda and Anaconda include Conda, so no need to install both. Given either, a new environment with all the Anaconda distribution packages can be created using
conda create --name my_anaconda_env anaconda
Note that Python versions can be specified as part of this, e.g.,
conda create --name my_anaconda37_env anaconda python=3.7

Related

Do I have to install CUDA in every single conda env [duplicate]

I have multiple environments under my conda management, as shown below
ss-MacBook-Pro$ conda env list
# conda environments:
#
base * /miniconda2
testenv /miniconda2/envs/testenv
testenvpy3 /miniconda2/envs/testenvpy3
Can I install a package that becomes effective across multiple environments? By reading the documentation, I got the impression that it is NOT possible, because if I do
conda install package-name
it will only get installed into the base environment (the current active environment), but it does not apply to other environments. I remember I can somehow achieve install a package effective to multiple environments under virtualenv before.
Can someone share the suggestion?
conda install only installs packages for the current (activated) environment. Files will be installed in the directory for the specific environment. If you want a specific package in all environments, you'll have to conda install that package for each of your environments (base, testenv, testenvpy3).
To switch between environments you just need to activate the one you switch to. The syntax depends Anaconda version or your OS. For newer Anaconda versions, conda activate <env name> works, and for older versions, source activate <env name> for Unix systems and activate <env name> for Windows.
I'm sure you've looked at this already, but here's a helpful link.

Installing python3.6 on virtualenv

I have python3.7 installed on my windows 10 laptop
But i need python3.6 for a specific project
Can i install it in virtualenv which will override python3.7 in that environment?
I don't know whether this may be an appropriate solution for you. But this is what I generally follow. Just install Anaconda in your system and create an environment according to your needs. For your case create an environment for Python 3.6.
conda create --name py36 python=3.6
//This lines will create an environment named py36
You then install libraries according to your needs in that environment. You work in that environment without interfering with the libraries of the other environment. To use anaconda kindly follow Anaconda cheatsheet. You will get everything that you need.

Multiple versions of Anaconda & Python installation

I have three questions.
One, can I install multiple versions of Python on my machine. I have a 4 Gb RAM system.
Two, can I install multiple versions of Anaconda?
Three, what is the difference between jupyter notebook & jupyter lab?
Please help. I am a new user.
can I install multiple versions of Python on my machine?
Yes, and the conda package manager (which comes with the Anaconda distribution) will help with that. You can create a separate conda environment for each Python version you want to use by running:
conda create --name mypy36env python=3.6
conda activate mypy36env
For details on how to create and manage conda environments, take a look at the docs
can I install multiple versions of Anaconda?
You can but because of the answer above you don't need to and shouldn't. Instead of multiple Anaconda versions, just create multiple environments with the versions of packages you need.
You can create an environment with specific versions of Python and the Anaconda distribution with:
conda create -n anaconda201903 python=3.6 anaconda==2019.03
what is the difference between jupyter notebook & jupyter lab?
From the JupyterLab docs:
JupyterLab is the next-generation web-based user interface for Project Jupyter.
Basically JupyterLab is a new interface that allows you to create and run the same Jupyter notebooks you did in the past, but it also has much more functionality than the old interface.
For a bit more details, check this blog post.

conda_env package is not available upon downgrading Python version to 3.6

I'm trying to create a Docker image with Conda and Python 3.6 installed. I have installed Anaconda 3 with the default Python 3.7. Then I used the following command to downgrade to Python 3.6:
conda install -y python=3.6
This results in Python 3.6 successfully installing, but when I subsequently execute conda --version, it gives me the error
'conda' module not found
I found that under python3.6/site-packages folder there are no Conda-related packages and instead all these packages are found under python3.7/site-packages.
It used to work before. Is there a way to get conda packaged under python3.6 folder?
Srikanth,
You should always try creating a new environment when you are working with some old version of any library.
conda create -n myenv python=3.4
If you want to install specific packages in this environment, you can use
conda install -n myenv tensorflow
Refer to this documentation for more information:
docs.conda.io

How to set up Anaconda so that it doesn't affect other environments like 'homebrew python pip' and Pyenv on MacOS?

It is well known that Anaconda installation on macOS can cause trouble with other widely used package/environment managers like Homebrew, Pyenv, Virtualenv, etc.
The majority of the solutions I've found are 'Anaconda-centric', i.e. using Anaconda as the main python manager and setup conda env for homebrew etc.
However, I am looking for a solution that's kind of 'Homebrew-centric', and setup Anaconda as a compliment. Anaconda should be set up in a way that when ever conda is used, it will work with its own Python, own packages. And leave the rest of system untouched.
The motivation for such solution is because that, for example, when one's main work-flow use homebrew Python3 (python3), homebrew pip (pip3) and Pyenv (pyenv) with requirement.txt. And occasionally using Anaconda when a project is required.
Rather than using Anaconda I would suggest using Miniconda, which includes only Python and conda (and a few support packages). Miniconda does not include all of the packages in Anaconda by default, but they can all be installed (with conda install anaconda). Once you download Miniconda, you can install it into your home folder at /Users/username/miniconda3. During the installation, you will be asked if you want to add some initialization code to your .bash_profile. Either choose yes or (if you chose no), then you can run
/Users/username/miniconda3/bin/conda init
to add the conda initialization to your .bash_profile. By default, this will activate the base environment, so you can change the default setting so the environment is not activated by default:
conda config --set auto_activate_base false
You'll probably need to open a new terminal so the conda command is available. Then, when you want to use a conda environment, you can conda activate that environment, but otherwise, conda's Python should not be on your PATH.

Resources