Need a downgrade of Django on MacOS - django

I'm currently using Django version-3.1.5 but for my university course it's recommended for testing version-2.2.17. Was wondering how to downgrade using MacOS Terminal? When I use pip3 install Django-2.2.17 I get a error message saying I'm already on a newer version of Django.

Install using the command
pip3 install django==2.2.17
This will install the version you have specified.

Related

pip can't find django 3.x - ERROR: No matching distribution found for django==3.0.4

When I run:
pip3 install django==3.0.5
I get the error
ERROR: Could not find a version that satisfies the requirement django==3.0.5 (from versions: 1.1.3, ... 2.2.11, 2.2.12) ERROR: No matching distribution found for django==3.0.4
I need to update some references somewhere, but I am not sure how. Plz Help.
As noted in the comments, Django 3.x is only available for Python 3.6 or greater. If you attempt to install Django 3 while using an older version of Python (e.g. Python 3.5 in the case of the OP), pip will be unable to find a matching package.
The solution is to simply upgrade to a more modern version of Python.
You got the version wrong... The latest official version is 3.0.5. Do instead
pip install Django==3.0.5
Read more about it here.
Update
After the new comments was able to se you're using Python 3.5. thing is, according to the documentation, for to use Django version 3.0.x one needs Python version 3.6, 3.7 or 3.8.
So, as a Linux user and assuming you can simply update to a newer version, you can use the terminal with the following commands to get a newer version of Python (for instances, 3.7.0 version)
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install python3.7
Python version you have installed is not supporting by that Django version.

Cannot install "psycopg2" on Windows 10 with Python 3.8

Yesterday I uninstalled python 3.7 version by mistake. Then I install python again (this time 3.8 version) and again set up my environment. But I could not start my Django project which has Postgres connection. Actually I cannot install "psycopg2" in my environment. I searched for hours and implement every solutions I get from online but it does not work. Let me tell you what I did so far.
First it said to add Postgres in my PATH so I added C:\Program Files\PostgreSQL\12\bin\ in my PATH.
A new problem then arise with a huge ERROR report with 2 vital Error.
ERROR: Failed building wheel for psycopg2
..........................
Running setup.py install for psycopg2 ... error
I try to upgrade wheel but it says,
Requirement already up-to-date
http://initd.org/psycopg/docs/install.html#install-from-source
I learned from this site that psycopg2 requires python2 version. So I installed python 2.7 also.
I reinstalled PostgreSQL but it does not work.
I deleted my virtual environment and create again but it does not work.
Some says they solve this problem by running pip install psycopg2-binary But it does not work for me.
Please help me to get rid of this. I stuck for hours.
When you asked this question, Python 3.8 had been released very recently so there were not any wheels for Python 3.8 yet.
At the time, my suggestion was to install Python 3.7.X and install the binary wheel with:
pip install psycopg2-binary
Since then, binary wheels have been released for Python 3.8, so the above command should work with Python 3.8.X as well.
I wouldn't try to build from source on Windows if it can be avoided.
Finally, you misunderstood the section of the docs about Python 2. You only need Python 2.7 if you are running Python 2. For Python 3, which you should be using for all new projects, it currently supports Python 3.4 to 3.8.
use:
sudo apt install python3-dev libpq-dev
then try doing:
pip3 install psycopg2
Hope it works for you!!
This problem mainly occurs due to this -- " error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/"
Now to install psycopg2, first you need to install visual studio from Microsoft - https://visualstudio.microsoft.com/visual-cpp-build-tools/
now you need to install the c++ desktop development tool with all its default components selected.
After successful visual studio c++ desktop development kit installation, you can now install psycopg2 successfully in your machine.

Unable to Install Tensorflow (MemoryError)

I tried to install Tensorflow on Linux Ubuntu 16.04 from source and using pip and I keep getting the following error return base64.b64encode(b).decode("ascii")
MemoryError. I tried to google this problem but only found a website written in Chinese (probably) http://juncollin.hatenablog.com/entry/2017/03/05/025318 that doesn't really help.
Try installing without caching: pip install --no-cache-dir tensorflow.

django update version without pip

I want to update my django version (1.8 ->1.9).
My current version was installed using pip (pip install Django) .
Now I need to install a newer version without pip.
I think I should run from the django package folder, using the setup.py file:
python setup.py install
[I've installed some other packages using a setup.py file .]
The question - will that create some problems? And, does the setup.py install method take care for uninstalling the older version? Or I have to uninstall manually somehow?
I don't have internet connection in this computer, so no pip.
Download a release (they are available on GitHub), and copy to your computer.
Then use pip install to install the archive. For example
pip install django-1.9.3.tar.gz
For more ways to use pip install, see the docs.

Uninstalling old version Django for upgrade to latest version

I want to upgrade Django from 1.2.5 to 1.3. I uninstalled 1.2.5 version, by the Ubuntu Software Center, for future upgrading, but it still in dist-packages and it still imported in python shell. What should I do? Would it be normal if I would brutally deleted the folder and egg from dist-packages?
It runs on Ubuntu 10.04
I recommend using setup-tools. Then run
easy_install --upgrade django
It will remove current django path from PYTHON_PATH and will add it's own path. To get easy_install do:
apt-get install python-setuptools
For both actions sudo is needed.
Go to the /usr/local/lib/python2.6/dist-packages. Find django folder there and delete it. then download django 1.3 and run python setup.py install. This should do the trick.
Remove django version using pip:
pip uninstall django
And install the version you want, for example 1.5:
pip install django==1.5