33

I'm using Anaconda 5.1 and Python 3.6 on a Windows 10 machine.

I'm having quite a few problems ; I tried to add some useful tools such as lightGBM, tensorflow, keras, bokeh,... to my conda environment but once I've used

conda install -c conda-forge packagename

on all of these, I end up having downgrading and upgrading of different packages that just mess with my installation and I can't use anything anymore after those installations.

I wonder if it were possible to have multiples versions of packages & dependencies living alongside each other which won't kill my install?

Sorry if my question seems noobish and thanks for your help,

Nate

Nathan Furnal
  • 2,236
  • 3
  • 12
  • 25

4 Answers4

7

You could try disabling transitive deps updates by passing --no-update-dependencies or --no-update-deps to conda install command. Ex: conda install --no-update-deps pandas.

Laksitha Ranasingha
  • 4,321
  • 1
  • 28
  • 33
  • 2
    The problem is that different packages sometimes require different dependencies so I can't just not update them. They can't seem to all behave properly in the same environment and it drives me crazy to be honest. – Nathan Furnal Mar 20 '18 at 00:39
  • 3
    +1 Solved my problem with `tensorflow` and `jupyter`. For some reason, I couldn't install any other package after I installed `tensorflow` in the conda environment - it would force me to uninstall it. This moved the unmovable object! – user3576467 Jul 08 '20 at 20:02
  • I still can't install `graphviz` without conflicts even with `conda install --no-update-deps graphviz`. It's ridiculous: https://stackoverflow.com/q/71968771/2745116 – stefanbschneider Apr 22 '22 at 12:50
3

Alright by searching around I was able to have everything up and running and it doesn't seem to be in conflict anymore, I had to uninstall Anaconda, reboot my computer and then reinstall it after my installation was broken though.

As long as packages and dependencies weren't messing around with each other, I was able to install lightgbm, folium and catboost in the regular (base) environment and use them. Those were installed straight with conda install -c conda-forge packagename, except for catboost which I linked. Do not forget to check for the different versions of conda, python and pip (wheel) which might affect your system.

Also, conda install nb_conda was installed to be able to select different environments in the Jupyter notebook straight away.

I got this from this helpful post and a mix of the answers below.

Then, when I wanted to install Tensorflow, Keras, theano what worked for me are the instructions in the second top comment in this thread though you should not forget to install jupyter again in the activated new environment you created.

After that, close everything, re-launch everything and in the top right corner of the Jupyter you should be able to pick the different environments and work from there.

I hope this will help someone else in the same predicament.

Nathan Furnal
  • 2,236
  • 3
  • 12
  • 25
  • 7
    "*I had to...*" sorry but this answer lacks evidence to support that conclusion. So many things were changed and in a non-methodical way that one cannot determine what actually had an effect. The `nb_conda` package is a stubborn myth (only `nb_conda_kernels` is needed) and Jupyter only needs to be installed in one location (see [this answer](https://stackoverflow.com/a/43197286/570918)). I would discourage users from following the recommendations given here. – merv May 11 '21 at 00:43
-1

I was trying to install pyrobuf library and it shew a lot of conflicts. What worked for me is

conda update --prefix /Users/<your_username>/opt/anaconda3 anaconda
Besp
  • 47
  • 7
-5

You can try using different conda environments. For example:

conda create -n myenv

Then you can activate your environment with:

conda activate myenv

and deactivate with:

conda deactivate

daro
  • 9
  • 2
  • 10
    Creating a new conda environment is irrelevant to the issue at hand, which is how to resolve package conflicts in an environment. – Elliott Collins Apr 16 '22 at 21:59