I want to uninstall Python3 and just use 2.7
720
The problem is with what is called dependencies.
Those apps depend on "python3" being installed to function properly.
You can still install any other version of python you want, but will need to specifically call that version at the command-line.
Related videos on Youtube
![mudassir sheikh](https://lh4.googleusercontent.com/-DTAiBoPmtwA/AAAAAAAAAAI/AAAAAAAAA6Y/9dGSN4XPRzU/photo.jpg?sz=256)
Author by
mudassir sheikh
Updated on September 18, 2022Comments
-
mudassir sheikh almost 2 years
Following is my cascasde dropdown list query. Countries list loading up but non of the states loading up in my dropdown list. if someone can help me to rectify the query please.
public ActionResult CountryList() { var countries = db.Countries.OrderBy(x=>x.CountryName).ToList(); // IQueryable countries = Country.GetCountries(); if (HttpContext.Request.IsAjaxRequest()) { return Json(new SelectList( countries, "CountryID", "CountryName"), JsonRequestBehavior.AllowGet ); } return View(countries); } public ActionResult StateList(int CountryID) { IQueryable <State> states= db.States. Where(x => x.CountryID == CountryID); if (HttpContext.Request.IsAjaxRequest()) return Json(new SelectList( states, "StateID", "StateName"), JsonRequestBehavior.AllowGet ); return View(states); }
following is the View file also containg java script:
@section scripts { <script type="text/javascript"> $(function () { $.getJSON("/Dropdown/Countries/List",function (data) { var items = "<option>---------------------</option>"; $.each(data, function (i, country) { items += "<option value='" + country.Value + "'>" + country.Text + "</option>"; }); $("#Countries").html(items); }); $("#Countries").change(function () { $.getJSON("/Dropdown/States/List/" + $("#Countries > option:selected").attr("value"), function (data) { var items = "<option>---------------------</option>"; $.each(data, function (i, state) { items += "<option value='" + state.Value + "'>" + state.Text + "</option>"; }); $("#States").html(items); }); }); }); </script> } <h1>@ViewBag.Title</h1> @using (Html.BeginForm()) { <label for="Countries">Countries</label> <select id="Countries" name="Countries"></select> <br /><br /> <label for="States">States</label> <select id="States" name="States"></select> <br /><br /> <input type="submit" value="Submit" /> }
-
dobey over 10 yearsWhy? If you want to use 2.7 for your own code, use
/usr/bin/python
, though you should really be writing new code with python3. -
dobey over 10 yearsYes, it is widely used. That should be pretty obvious from the apt-get remove suggesting other dependencies to be removed.
-
serhiyb almost 8 yearsCan you also include your javascript code that execute ajax calls?
-
Marlon Vidal almost 8 yearsCall .ToList() method on your states object
-
mudassir sheikh almost 8 yearsIQueryable <State> states= db.States. Where(x => x.CountryID == CountryID).ToList(); ...... this code showing red line
-
Oluwafemi almost 8 yearsWhat stops you from using
$('#Countries').val();
? -
Developer almost 8 yearsWhen you call .ToList(), that is not IQueryable, thats gonna be IEnumerable. Just use var states=
-
SDsolar almost 7 yearsIt is not used here. All it does is take up the limited space on my systems and backups.
-
dobey almost 7 years@SDsolar Core parts of Ubuntu do require python3. If you wish to remove things and understand what you're doing, then do it. I'm not sure why you made such comments on this nearly 4 year old question.
-
SDsolar almost 7 yearsGoogle doesn't notice the age when it puts one of these questions at the top of the list when I search. Meanwhile, I have decided to leave it be. TNX.
-
-
UnworthyToast over 10 yearsMakes sense. I could swear that those apps (like rhythmbox, firefox, etc) were all installed prior to my Python3 install though, when I only had the default Python 2.7.5+ pre-installed.
-
UnworthyToast over 10 yearsI have both 2.7 and 3 installed. I know it may not make sense to uninstall 3, it's for curiosity somewhat at this point. I can't remember why I originally wanted to. I guess I thought it was messing something on the OS up haha.
-
dobey over 10 years@virtualxtc That's not exactly true. Rhythmbox depends on python >= 2.7 (but 3.0 does not satisfy that, as the package name is not python).
-
virtualxtc over 10 years@dobey I think what you meant to say was: "Rhythmbox depends on python >= 2.7 (but 2.7 does not satisfy that, as the package name is not python) - and thanks; I hadn't considered that.
-
dobey over 10 years@virtualxtc No, I meant what I said.
python
is only available as python 2.x. The python 3.x package ispython3
. Rhythmbox in <= 13.10 cannot be installed without python 2.7 (in the default archive packages). -
virtualxtc over 10 yearsOk, so now I'm confused as to whether UnworthyToast's question was answered. If Rhythmbox depends on "python" >= 2.7, why using apt to remove "python3" cause it to also remove Rhythmbox? UnworthyToast - Did you have python 2.7 installed when you ran the "apt-get remove python3" command?
-
SDsolar almost 7 yearsI know why I want to remove it - My Raspbian systems run from 32GB SD cards. My Ubuntu 16.04 LTS systems run on 160 GB SSD drives. It takes up a lot of space on the primary drives and in every backup. And I never use it on purpose.
-
virtualxtc almost 7 years
-
dobey almost 7 years@virtualxtc Yes. And in the nearly 4 years since the previous commentary on this question, many packaging bugs have likely been resolved, and dependencies have further changed.