4

I am currently working on a Django project and want to install an additional Django (app) package called "tinymce". I've installed Anaconda just recently and I'm not used to commands related to conda. I often used to pip install packages from the command prompt. But now I'm really confused if I really should just use the same pip install or use some other conda commands (if there are any) to install that package. Also, does that affect anything, if I am to frequently use that packages?

FYI: I'm on Windows & using Python 3.7 using the recent Anaconda release.

Firebolt
  • 97
  • 2
  • 8
  • 4
    Possible worth reading is [using-pip-in-a-conda-environment/](https://www.anaconda.com/using-pip-in-a-conda-environment/) – FlyingTeller Nov 18 '19 at 12:55
  • 2
    Unless conda's virtual environment is active, packages aren't installed in it. If they are installed in it, they won't work globally and vice-versa. It's just that packages from one environment don't interfare with the other. – Abhyudai Nov 18 '19 at 12:55
  • @FlyingTeller what if I've already pip installed some packages? & that points exactly to my question, will it be available both in & out of the conda environment ? – Firebolt Nov 18 '19 at 12:59
  • 1
    If you do `conda activate ` and then `pip install `, then `some module` will be installed only in that env. If you do `conda deactivate`, then the module that you installed in the environment will no longer be available – FlyingTeller Nov 18 '19 at 13:25
  • Does this answer your question? [Specific reasons to favor pip vs. conda when installing Python packages](https://stackoverflow.com/questions/54834579/specific-reasons-to-favor-pip-vs-conda-when-installing-python-packages) – merv Nov 18 '19 at 20:54
  • @merv yes, it somewhat does answer my question, but I would also like to know what happens when I've only installed Anaconda (& whatever that comes with it) and no other Python Installations. In this case, does it create different environments, like inside & out of conda-env? What would the `pip install` command do, install the package in the conda env or is there new env for seperate Python installation? – Firebolt Nov 19 '19 at 03:35

1 Answers1

5

Before you start installing packages, you should decide on how you want to manage your packages for different projects. I'd recommend that you create a dedicated conda environment for each project. Then you have to activate the respective environment whenever you want to work on a project. But packages installed for one project don't interfere with those for another. It helps to install Miniconda rather than Anaconda, because that keeps the conda base environment clean.

You write that you're used to calling pip install, but you don't mention Python virtual envs nor conda environments. That sounds as if you're typically installing packages globally on your machine. Sooner or later, that's going to create a mess.

If you decide to use conda environments, you have to remember to always activate the environment for your project before installing packages for that project. Then both pip install and conda install will put packages into that environment. When I have a choice, I prefer to install packages with conda from its default channels. conda has better dependency management than pip, and conda can handle non-Python dependencies. But packages sometimes have different names in conda and pip, so it might be extra effort to translate installation instructions for pip into similar commands for conda.

Roland Weber
  • 3,395
  • 12
  • 26
  • Wow, now this is one clear way of answering. Thank you for clearing my doubt. Now, I hope to manage all my projects without much interference from different environments & looks like its safe to say that I shall use conda for package installations from now on. Thank you. – Firebolt Nov 22 '19 at 02:59