Jacob
Jacob

Reputation: 15297

How to change django version in PyCharm?

I've installed new PyCharm that uses django v1.71(default), but I would like to change it to v1.68.

How can we achieve this with PyCharm?

Upvotes: 13

Views: 15558

Answers (7)

sina sheikhzahed
sina sheikhzahed

Reputation: 169

You can open your project in pycharm and then change your django version by this method:

menu->file->setting->project:(your project_name)

In package list click on the package you want(here the package we want is Django).

You can delete a package with minus(-) sign and install a package with plus(+) sign...

For example if your previous Django version is 3.0 you can delete it and install even an older version.

Upvotes: 0

Bar Horing
Bar Horing

Reputation: 5955

The best way is to use virtualenv: create a new virtual environment, install the python you want and keep the path to this version's python.exe file.

Open PyCharm and go to settings:

enter image description here

Upvotes: 2

rage mon
rage mon

Reputation: 53

Go to file>>settings>>Project Interpreter and click the plus sign at the right edge of the popup window and look for django and install it. You need internet access though. It will install the new version.

Upvotes: 2

chinskiy
chinskiy

Reputation: 2715

Also you can add to your project requirements.txt file to make sure whether the current interpreter contains required package, if not - PyCharm ask you to install them.

Upvotes: 2

Peter
Peter

Reputation: 1798

You don't do that with Pycharm, Pycharm just detects the installed version. You change the version with pip:

pip uninstall django # just for explicity
pip install django==1.6.8

Make sure you use virtual environments if you run multiple applications on the same machine.

Upvotes: 13

Matthias
Matthias

Reputation: 13222

Go to Settings->Project Interpreter.

Double-click the Django package. Activate the check box Specify version and select the version you want.

Press the button Install Package.

Django will use pip in the background to install the package.

Upvotes: 13

Vlad
Vlad

Reputation: 69

In default settings of project.

File -> Default Settings -> Default Project -> Project Interpretatoe

Upvotes: 3

Related Questions