4

I'm working and learning python with python 3.7 IDLE and PyCharm, but now I have to use Anaconda for a few different problems.

My question is, is it possible to install Anaconda in the same machine but without interfering the old python 3.7 that I already have installed? because in one I'm using Django as well and such, but Anaconda will be mainly for data processing, I and don't want them both to interact with each other or overwrite packages.

Shall I use something like a virtual environment to install Anaconda? if so, what's the best way.

I'm new into this, thank you for help!

Y. D4.
  • 43
  • 1
  • 4
  • What exactly do you want from Anaconda? What is your OS? – roganjosh Jan 24 '19 at 20:27
  • 4
    @DevonOliver I don't think it is a duplicate, if OP has to use the Anaconda distribution, then using virtualenv will be less appropriate than using conda to manage virtual environments. – FabienP Jan 24 '19 at 21:44
  • thank you for the help and info : ) – Y. D4. Jan 24 '19 at 22:35
  • According to the following solution, you can retain existing Python installation and packages and just create a new virtual environment for Anaconda related stuff via Miniconda: https://stackoverflow.com/a/54853356/1047213 – Hari Sep 29 '20 at 12:48

2 Answers2

4

Anaconda comes with its own virtual environment manager conda. This means that Anaconda will by default be independent of your system python 3.7, and packages will not interact with each other.

One solution to manage both python installs in a clean way could be to use conda environments for both. The cleanest IMO would be to:

  • install Miniconda (minimal install for the conda manager)
  • create an environment called anaconda and install all packages from the distribution (which is done with conda create -n anaconda anaconda)
  • create an environment called py37 and install all packages from you current python 3.7 install

You can then use conda activate py37 to use django, and conda activate anaconda to process data. No interaction between the two, and a very simple way to switch between both. Please see the conda documentation for details.

Of course, using virtualenv or pipenv would allow you to separate environments in a similar manner. But note that only conda will allow you to do so using features from the Anaconda distribution, which looks to be a requirement from your question.

FabienP
  • 3,018
  • 1
  • 20
  • 25
  • 2
    You might need to be careful about your path, to be sure you were getting the python from conda on all occassions, and not the already installed non-conda install of python. Aside from that, I agree with this answer. – lexual Jan 24 '19 at 21:52
  • thank you for the help and info : ) – Y. D4. Jan 24 '19 at 22:35
1

I'd recommend you using a virtual env for every project.

Here's a pretty informative video: https://www.youtube.com/watch?v=N5vscPTWKOk

And the venv docs: https://docs.python.org/3/library/venv.html