4

I am using Ubuntu 18.04.4 LTS. I use conda instead of pip. My Django version was 2.2.1. After I run

conda install -c anaconda django

in my terminal, my Django version is 2.2.5.

How can I upgrade/update it to the current version 3.0.3?

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
catmantiger
  • 1,150
  • 9
  • 11
  • 1
    It depends whether there is a stable conda version. You could try `conda install django=3.0.3` but there's no guarantee that will work. You could also just pip install it if you have set anaconda as your system python (at least on Windows) but I've seen it advised against using pip (I've done it tonnes of times with libraries with no issue, but that's not to say it won't break something) – roganjosh Feb 08 '20 at 14:07
  • Thank you @roganjosh. But it doesn't work. I got PackagesNotFoundError: – catmantiger Feb 08 '20 at 14:19
  • This is a duplicate of https://stackoverflow.com/questions/38411942/anaconda-conda-install-a-specific-package-version – AMC Feb 08 '20 at 18:34

2 Answers2

7

I recommend you always use

conda install -c conda-forge <somepackage>

On the other hand, if you do not specify the version, conda will install the most recent one that is compatible with your other libraries in that environment. That is, if you have other libraries that are not compatible even if version 3 is the latest one, conda will install version 2 for example. If you explicitly say

conda install -c conda-forge django=3.0.3

Conda will try to install that version, but the installation will only be successful if there are no compatibility problems. In case of compatibility problems you will be warned by the installer itself, e.g. "the somepackage version compatible with Django 3.0.3 must be >= 2.5". This way you'll know which libraries are preventing you from installing your latest version of django.

I invite you to create a new (empty) environment, and only install Django and Python with conda-forge, and I assure you that even if you don't put Django=3.0.3, it will install that version, because it won't have any external conflicting libraries.

Nouvellie
  • 533
  • 4
  • 9
0

I faced problem while running django application in environment for a while I didn't find anything but at last I decided to check each libraries version and started with django and with good's sake it was django version which had conflicted running the app.

go on updating to current enviroment .......