How to change django version in PyCharm?

前端 未结 7 1325
说谎
说谎 2021-02-14 09:39

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?

相关标签:
7条回答
  • 2021-02-14 09:40

    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.

    0 讨论(0)
  • 2021-02-14 09:42

    In default settings of project.

    File -> Default Settings -> Default Project -> Project Interpretatoe
    
    0 讨论(0)
  • 2021-02-14 09:47

    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.

    0 讨论(0)
  • 2021-02-14 09:48

    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.

    0 讨论(0)
  • 2021-02-14 09:55

    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.

    0 讨论(0)
  • 2021-02-14 10:04

    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.

    0 讨论(0)
提交回复
热议问题