Install Pip Dmg

  1. Double-click the icon labeling the file python-3.4.1-macosx10.6.dmg. A file folder named Python 3.4.1 containing the Python.mpkg file will appear. Control-click on the Python.mpkg file and select open. If the following pop-up window appears enter you password and click Install Python. An Install Python pop-up window will appear.
  2. Note that many other databases are supported, the main criteria being the existence of a functional SQLAlchemy dialect and Python driver. Searching for the keyword 'sqlalchemy + (database name)' should help get you to the right place.
  3. Jun 23, 2020 Enough explanation, here’s how to install an OS X app from a DMG file: Find the downloaded file, which usually ends up in your Desktop or Downloads folder. Double-click the.DMG file to mount it. A new Finder window showing its contents should appear. If the window also contains a shortcut icon to “Applications”, drag and drop the app.

In this video I am going to show you how to install pip for Python on Windows 10. Either pip is installed directly through Python or it needs to be installed. Pip can be downloaded and installed using command-line by going through the following steps: Download the get-pip.py file and store it in the same directory as python is installed. Change the current path of the directory in the command line to the path of the directory where the above file exists. Run the command given below: python get-pip.py.

The Java Development Kit (JDK), officially named 'Java Platform Standard Edition' or 'Java SE', is needed for writing and running Java programs.

Currently, the OpenJDK developed by Oracle and the Java community (@ https://openjdk.java.net/) provides a free and open-source JDK official reference implementation.

This article is based on the Oracle JDK (@ https://www.oracle.com/java/) (due to legacy), which is free for personal and development use but no longer free for commercial use.

JDK Versions

Reference: 'Java Version History' @ https://en.wikipedia.org/wiki/Java_version_history.

  1. JDK Alpha and Beta (1995): Sun Microsystem announced Java in September 23, 1995.
  2. JDK 1.0 (January 1996): Originally called Oak (named after the oak tree outside James Gosling's office). Renamed to Java 1 in JDK 1.0.2.
  3. JDK 1.1 (February 1997): Introduced AWT event model, inner class, JavaBean, JDBC, and RMI.
  4. J2SE 1.2 (JDK 1.2) (December 1998): Re-branded as 'Java 2' and renamed JDK to J2SE (Java 2 Standard Edition). Also released J2EE (Java 2 Enterprise Edition) and J2ME (Java 2 Micro Edition). Included JFC (Java Foundation Classes - Swing, Accessibility API, Java 2D, Pluggable Look & Feel, and Drag & Drop). Also introduced Collection Framework and JIT compiler.
  5. J2SE 1.3 (JDK 1.3) (May 2000): Introduced Hotspot JVM.
  6. J2SE 1.4 (JDK 1.4) (February 2002): Introduced assert statement, non-blocking IO (nio), logging API, image IO, Java webstart, regular expression (regex) support.
  7. J2SE 5.0 (JDK 5) (September 2004): Officially called 5.0 instead of 1.5 (by dropping the 1.). Introduced generics, autoboxing/unboxing, annotation, enum, varargs, for-each loop, static import. See 'JDK 5 New Features'.
  8. Java SE 6 (JDK 6) (December 2006): Renamed J2SE to Java SE (Java Platform Standard Edition). No new language features. See 'JDK 6 New Features'.
  9. Java SE 7 (JDK 7) (July 2011): First version after Oracle purchased Sun Microsystem - aslo called OracleJDK. Introduced Strings in switch statement, Binary integer literals, allowing underscores in numeric literals, improved type inference for generic instance creation (or diamond operator <>), Catching multiple exception types and rethrowing exceptions with improved type checking. See 'JDK 7 New Features'.
  10. Java SE 8 LTS (JDK 8) (March 2014): Included support for Lambda expressions, default and static methods in interfaces, improved collection, and JavaScript runtime. Also integrated JavaFX graphics subsystem. See 'JDK 8 New Features'.
  11. Java SE 9 (JDK 9) (September 21, 2017): Introduced modularization of the JDK (module) under project Jigsaw, the Java Shell (jshell), and more. See 'JDK 9 New Features'.
  12. Java SE 10 (18.3) (JDK 10) (March 2018): Introduced var for type inference local variable (similar to JavaScript). Introduced time-based release versioning with two releases each year, in March and September, denoted as YY.M. Removed native-header generation tool javah. See 'JDK 10 New Features'.
  13. Java SE 11 LTS (18.9) (JDK 11) (September 2018): Extended var to lambda expression. Standardize HTTP client in java.net.http. Support TLS 1.3. Clean up the JDK and the installation package (removed JavaFX, JavaEE, CORBA modules, deprecated Nashorn JavaScript engine). OracleJDK is no longer free for commercial use, but OpenJDK is still free. See 'JDK 11 New Features'.
  14. Java SE 12 (19.3) (JDK 12) (March 2019): Switch Expression (preview). See 'JDK 12 New Features'.
  15. Java SE 13 (19.9) (JDK 13) (September 2019): Switch Expression (preview), Multi-line Text Block (preview). See 'JDK 13 New Features'.
  16. Java SE 14 (20.3) (JDK 14) (March 2020): Records (preview)
  17. Java SE 15 LTS (20.9) (JDK 15) (September 2020):
'JDK' or 'JRE'?

JRE (Java Runtime), which include a Java Virtual Machine and core libraries, is needed for running Java programs. JDK (Java Development Kit), which includes JRE plus the development tools (such as compiler and debugger), is need for writing as well as running Java programs. In other words, JRE is a subset of JDK. Since you are supposed to write Java Programs instead of merely running Java programs, you should install JDK, which includes JRE.

How To Install JDK on Windows

Step 0: Un-Install Older Version(s) of JDK/JRE

I recommend that you install only the latest JDK. Although you can install multiple versions of JDK/JRE concurrently, it is messy.

If you have previously installed older version(s) of JDK/JRE, un-install ALL of them. Goto 'Control Panel' ⇒ (optional) 'Programs' ⇒ 'Programs and Features' ⇒ Un-install ALL programs begin with 'Java', such as 'Java SE Development Kit ...', 'Java SE Runtime ...', 'Java X Update ...', and etc.

Step 1: Download JDK
  1. Goto JDK (or Java SE) download site @ https://www.oracle.com/java/technologies/javase-downloads.html.
  2. Under 'Oracle JDK', click 'JDK Download'.
  3. Download the 'Windows x64 Installer' (e.g., 'jdk-15.0.{x}_windows-x64_bin.exe' - about 159MB), where {x} is a fast changing update number.
Step 2: Install JDK

Run the downloaded installer. Accept the defaults and follow the screen instructions to complete the installation. By default, JDK is installed in directory 'C:Program FilesJavajdk-15.0.{x}', where {x} denotes the update number.

Launch 'File Explorer'. Navigate to 'C:Program FilesJava' to inspect the directories. Take note of your JDK Installed Directoryjdk-15.0.{x}, in particular, the update number {x} which you will need in the next step.

I shall refer to the JDK Installed Directory as <JAVA_HOME>, hereafter, in this article (corresponding to environment variable %JAVA_HOME% in Windows or $JAVA_HOME in Unix/macOS).

Step 3: (SKIP for JDK 15) Include JDK's 'bin' Directory in the PATH

Windows' Command Prompt (CMD) searches the current directory and the directories listed in the PATHenvironment variable for executable programs.

JDK's programs (such as Java compiler 'javac.exe' and Java runtime 'java.exe') reside in the sub-directory 'bin' of the JDK installed directory. JDK's 'bin' needs to be added into the PATH.

Prior to JDK 15, you need to explicitly add JDK's 'bin' into the PATH. Starting from JDK 15, the installation process adds the directory 'C:Program FilesCommon FilesOracleJavajavapath' to the PATH. The 'javapath' directory is a link to 'javapath_target_xxxxxx', which contains a copy of the following JDK programs:

  • java.exe: Java Runtime
  • javac.exe: Java Compiler
  • javaw.exe: Java Runtime for Windows Console-less
  • jshell.exe: Java Command-line Shell (since JDK 10) - a Read-Evaluate-Print Loop (REPL) which evaluates declarations, statements, and expressions as they are entered and immediately shows the results.

Link is used so that you can keep multiple copies (versions) of JDK.

To edit the PATH environment variable in Windows 10:

  1. Launch 'Control Panel' ⇒ (Optional) 'System and Security' ⇒ 'System' ⇒ Click 'Advanced system settings' on the left pane.
  2. Switch to 'Advanced' tab ⇒ Click 'Environment Variables' button.
  3. Under 'System Variables' (the bottom pane), scroll down to select variable 'Path' ⇒ Click 'Edit...'.
  4. For Newer Windows 10:
    You shall see a TABLE listing all the existing PATH entries (if not, goto next step). Click 'New' ⇒ Click 'Browse' and navigate to your JDK's 'bin' directory, i.e., 'c:Program FilesJavajdk-15.0.{x}bin', where {x} is your installation update number ⇒ Select 'Move Up' to move this entry all the way to the TOP.
  5. For Older Windows 10 (Time to change your computer!):
    (CAUTION: Read this paragraph 3 times before doing this step! Don't push 'Apply' or 'OK' until you are 101% sure. There is no UNDO!!!)
    (To be SAFE, copy the content of the 'Variable value' to Notepad before changing it!!!)
    In 'Variable value' field, APPEND 'c:Program FilesJavajdk-15.0.{x}bin' (where {x} is your installation update number) IN FRONT of all the existing directories, followed by a semi-colon (;) to separate the JDK's bin directory from the rest of the existing directories. DO NOT DELETE any existing entries; otherwise, some existing applications may not run.

You need to re-started CMD for the new environment settings to take effect.

Step 4: Verify the JDK Installation

Launch a CMD via one of the following means:

  1. Click 'Search' button ⇒ Type 'cmd' ⇒ Choose 'Command Prompt', or
  2. Right-click 'Start' button ⇒ run... ⇒ enter 'cmd', or
  3. Click 'Start' button ⇒ Windows System ⇒ Command Prompt

Issue the following commands to verify your JDK installation:

  1. (Skip for JDK 15) Issue 'path' command to list the contents of the PATH environment variable. Check to make sure that your JDK's 'bin' is listed in the PATH.
  2. Issue the following commands to verify that JDK/JRE are properly installed and display their version:
Step 5: Write a Hello-World Java Program
  1. Create a directory to keep your works, e.g., 'd:myProject' or 'c:myProject'. Do NOT save your works in 'Desktop' or 'Documents' as they are hard to locate. The directory name shall not contain blank or special characters. Use meaningful but short name as it is easier to type.
  2. Launch a programming text editor (such as TextPad, NotePad++, Sublime Text, Atom). Begin with a new file and enter the following source code. Save the file as 'Hello.java', under your work directory (e.g., d:myProject).
Step 6: Compile and Run the Hello-World Java Program

To compile the source code 'Hello.java':

  1. Start a CMD Shell (Search ⇒ enter 'cmd' ⇒ select 'Command Prompt').
  2. Set the Current Drive to the drive where you saved your source file 'Hello.java'.
    If you use drive 'c', skip this step.
    Else if you use drive 'd', enter 'd:' as follow:
  3. Set the Current Working Directory to the directory that you saved your source file via the cd (Change Directory) command. For example, suppose that your source file is saved in directory 'myProject'.
  4. Issue a dir (List Directory) command to confirm that your source file is present in the current directory.
  5. Invoke the JDK compiler 'javac' to compile the source code 'Hello.java'. The compilation is successful if the command prompt returns. Otherwise, error messages would be shown. Correct the errors in your source file and re-compile. Check 'Common JDK Installation Errors', if you encounter problem compiling your program.
  6. The output of the compilation is a Java class called 'Hello.class'. Issue a dir (List Directory) command again to check for the output.

To run the program, invoke the Java Runtime 'java':


Everything that can possibly go wrong will go wrong: Read 'JDK Installation Common Errors'.

Step 7: (For Advanced Users Only) JDK's Source Code

Source code for JDK is provided and kept in '<JAVA_HOME>libsrc.zip' (or '<JAVA_HOME>src.zip' prior to JDK 9). I strongly recommend that you to go through some of the source files such as 'String.java', 'Math.java', and 'Integer.java', under 'javalang', to learn how experts program.

How to Install JDK on macOS

Step 1: Check if JDK has been Pre-Installed

To check if JDK has been installed, open a 'Terminal' (Search 'Terminal'; or Finder ⇒ Go ⇒ Utilities ⇒ Terminal) and issue this command:

  • If a JDK version number is returned (e.g., JDK x.x.x), then JDK has already been installed. If the JDK version is prior to 1.8, proceed to Step 2 to install the latest JDK; otherwise, proceed to 'Step 3: Write a Hello-world Java program'.
  • If message 'command not found' appears, JDK is NOT installed. Proceed to the 'Step 2: Install JDK'.
  • If message 'To open javac, you need a Java runtime' appears, select 'Install' and follow the instructions to install JDK. Then, proceed to 'Step 3: Write a Hello-world Java program'.
Step 2: Download JDK
  1. Goto JDK (or Java SE) download site @ https://www.oracle.com/java/technologies/javase-downloads.html.
  2. Under 'Oracle JDK', click 'JDK Download'.
  3. Download the 'macOS DMG installer' (e.g, jdk-15.0.{x}_osx-x64_bin.dmg - about 172MB, where {x} is a fast changing update number).
Step 3: Install JDK/JRE
  1. Double-click the downloaded Disk Image (DMG) file. Follow the screen instructions to install JDK/JRE.
  2. Eject the DMG file.
  3. To verify your installation, open a 'Terminal' and issue these commands.
Install pip dmg download
Step 3: Write a Hello-World Java Program
  1. Create a directory called 'myProject' under your 'home' directory (Launch 'Finder' ⇒ 'Go' ⇒ 'Home'; Select 'File' ⇒ 'New Folder' ⇒ 'myProject').
    In macOS/Unix, the 'home' directory of the current user can be referenced as '~'. Hence, this new directory can be referenced as '~/myProject'.
  2. Use a programming text editor (such as Sublime Text or Atom) to input the following source code and save as 'Hello.java' under the directory '~/myProject'.
    (If you use macOS's default text editor 'TextEdit' (NOT recommended), you need to open a new file ⇒ choose 'Format' ⇒ 'Make Plain Text' ⇒ Enter the source code ⇒ Save as 'Hello.java'.)
Step 4: Compile and Run the Hello-World Java Program
  1. To compile the source code 'Hello.java', open a new 'Terminal' ('Go' ⇒ 'Utilities' ⇒ 'Terminal') and issue these commands (as illustrated):
  2. To run the Hello-world, invoke the Java Runtime 'java' as follows:

How to Install JDK on Ubuntu

We shall try both the OpenJDK (free and open-source) and the Oracle JDK (free for personal and development, but not free for production).

Step 0: Check if JDK has already been Installed

Open a Terminal and issue this command:

If a JDK version number (e.g., 'javac x.x.x') appears, JDK has already been installed. You can skia the installation and goto Open2.

Step 1a: Install OpenJDK

[TODO]

To remove OpenJDK, issue command:

Step 1b: Install Oracle JDK
  1. Goto Oracle JDK (Java SE) download site @ https://www.oracle.com/java/technologies/javase-downloads.html ⇒ Under 'Oracle JDK', click 'JDK Download' ⇒ Select 'Linux x64 Compressed Archive' package (e.g., 'jdk-15.0.{x}-linux-x64_bin.tar.gz' - 179MB). The tarball will be downloaded in directory '~/Downloads', by default.
  2. We shall install JDK under '/usr/local/java' (or Ubuntu's default JDK directory /usr/lib/jvm; or /opt/java). First, create a directory 'java' under '/usr/local'. Open a Terminal and issue these commands: Extract the downloaded package (Check your downloaded filename!) JDK shall be extracted in a folder '/usr/local/java/jdk-15.0.{x}', where {x} is the update number.
  3. Inform the Ubuntu to use this JDK/JRE: The above steps set up symlinks java, javac, jshell at /usr/bin (which is in the PATH), that link to /etc/alternatives and then to JDK bin directory.
    The 'alternatives' system aims to resolve the situation where several programs fulfilling the same function (e.g., different version of JDKs). It sets up symlinks thru /etc/alternatives to refer to the actual programs to be used.
    Alternatively, you can include the JDK's bin into the PATH directly.
  4. To verify the JDK installation, issue these commands:
  5. (Don't Do this step - It is taken care by 'alternatives' in Step 3. Keep here to show you how to set PATH.)
    Add JDK's binary directory ('bin') to the 'PATH' by editing '/etc/profile': Add these lines at the end of the file '/etc/profile', replace '{x}' with the actual number: Rerun the configuration file by:
Step 2: Compile and Run a Hello-world Java Program
  1. File Explorer ⇒ Home ⇒ Create a new folder called 'myProject' to keep our works.
  2. Open 'Text Editor' (gedit). Enter the following source code and save as 'Hello.java' under the '~/myProject' directory created earlier.
  3. To compile the Hello-world Java program, launch a Terminal and issue these commands:
  4. Run the Hello-world Java program:

Install Pip Dmg Mac

Notes: Starting from JDK 11, you can compile and run the hello-world in one single step via:

Source-Code Editors & IDEs for Java Programming

Eclipse IDE

  1. You need to first install Eclipse. Read 'How to Install Eclipse'.
  2. javaan then proceed to write your first Java program. Read 'Writing your first Java Program with Eclipse'.
  3. Eclipse allow you to debug program graphically. Read 'Debugging program in Eclipse'.

NetBeans IDE

  1. You need to first install NetBeans. Read 'How to Install NetBeans'.
  2. You can then proceed to write your first Java program. Read 'Writing your first Java program with NetBeans'.
  3. NetBeans allow you to debug program graphically. Read 'Debugging program in NetBeans'.

Visual Studio (VS) Code IDE

Click HERE, look for 'VS Code for Java Programming'

Sublime Text (for Windows, macOS, Linux)

Click HERE, look for 'Sublime Text for Java Programming'

Atom (for Windows, macOS, Linux)

[TODO]

TextPad (for Windows only)

Click HERE, look for 'TextPad for Java Programming'.

NotePad++ (for Windows only)

Click HERE, look for 'NotePad++ for Java Programming'.

(JDK 11 New Feature) Launch Single-Source-File

From JDK 11, you can 'compile and run' a single-file program in one step, without explicit compilation.

  1. Write a 'Hello.java' (see previous section).
  2. Delete 'Hello.class', if it exists.
  3. You can compile/run 'Hello.java' in one command as follows:

Notes:

  • This is applicable to single source-file only.
  • No need to use javac to compile the program.
  • It compiles in memory (without producing a .class file), and run.
  • This feature is introduced for beginners to learn Java, and for professionals to test a Java feature.
  • The filename and classname need not be the same.

How To Set JAVA_HOME Environment Variable

Many Java applications (such as Tomcat) require the environment variable JAVA_HOME to be set to the JDK installed directory.

See 'How to set JAVA_HOME for Windows' or 'How to set JAVA_HOME for macOS/Linux'.

Common Errors in installing JDK


(Advanced) External JAR Files and Native Libraries

Notes: This section is applicable to JDK prior to JDK 9. JDK 9 introduces a new level called 'module' on top of package, and 'jmod' files for Java modules. Need to revise this section for JDK 9.

External Java API packages (such as Servlet API, MySQL Connector/J, JOGL, JUnit) are often distributed in JAR files (Java Archive - a single-file package of many Java classes similar to ZIP or TAR), with possibly Native Libraries ('.lib' and '.dll' in Windows, or '.a' and '.so' in Linux/macOS).

External JAR Files ('.jar')

If external JAR files are not properly included:

  • During the compilation, you will receive compilation error 'cannot find symbol' for classes belonging to the external packages.
  • During execution, you will get a runtime error 'Could not find or load main class xxx' or 'NoClassDefFoundError'.

To include external JAR files, you can either:

  1. (Prior to JDK 9) Copy all the JAR files of the external packages to the Java's Extension Directories (NOT applicable from JDK 9).
    • For Windows, the JDK extension directory is located at '<JAVA_HOME>jrelibext' (e.g., 'c:Program FilesJavajdk1.8.0_xxjrelibext').
    • For macOS, the JDK extension directories are '/Library/Java/Extensions' and '/System/Library/Java/Extensions'.
    • For Ubuntu, the JDK extension directories are '<JAVA_HOME>/jre/lib/ext' (e.g., '/usr/user/java/jdk1.8.0_xx/jre/lib/ext') and '/usr/java/packages/lib/ext'.
    The location of JDK's extension directories is kept in Java's System Property 'java.ext.dirs'. You can print its contents via System.out.println(System.getProperty('java.ext.dirs')).
  2. You can also include all the JAR files in the CLASSPATH environment variable. CLASSPATH may contain directories (of Java classes) or JAR files (single-file archive of Java classes). If you set the CLASSPATH, you must also include the current directory (denoted as '.').
    • For Windows, set the CLASSPATH in Control Panel ⇒ System ⇒ Advanced system settings ⇒ Advanced ⇒ Environment Variables ⇒ System Variables ⇒ New ⇒ In 'Variable name', enter 'CLASSPATH' ⇒ In 'Variable value', enter '.;path1xxx.jar;path2yyy.jar', where the entries are separated by a semi-colon (;).
    • For Linux and macOS: Edit ~/.profile or ~/.bash_profile (or /etc/profile for system-wide setting) to include the following line at the end of the file: The entries are separated by colon (:).
  3. You can also set the CLASSPATH in the javac/java command-line via the option -cp <paths> (or -classpath <paths>), for example,
External Native Libraries ('.lib', '.dll', '.a', '.so')

Some external package may provide static or shared native libraries in the form of '.lib' (Windows' static LIBrary), '.dll' (Windows' Dynamically Link Library), '.a' (Unix's static (Archive) library), or '.so' (Unix's Shared Object library).

Native Libraries are to be kept in a directory accessible via JRE's Property 'java.library.path', which normally but not necessarily includes all the directories in the PATH environment variable.

Native libraries are not involved in the compilation. But if they are not properly included during runtime time, you will get a runtime error 'java.lang.UnsatisfiedLinkError: no xxx in java.library.path'.

To include external native libraries:

  1. Copy the native libraries into a system library directory, e.g., c:windowssystem32 (Windows), /usr/lib or /usr/local/lib (macOS/Unix). You can verify that the directory is included in Java's System Property 'java.library.path', via System.out.println(System.getProperty('java.library.path')).
  2. You can also set the native library path via the java's command-line option -Djava.library.path=xxx, for example,
Eclipse/NetBeans

Using an IDE can greatly simplifies inclusion of external packages. Read 'Eclipse How-To' or 'NetBeans How-To'.

Link to References & Resources

This document will get you up and running with Django.

Install Python¶

Django is a Python Web framework. See What Python version can I use with Django? fordetails.

Get the latest version of Python at https://www.python.org/downloads/ or withyour operating system’s package manager.

Python on Windows

If you are just starting with Django and using Windows, you may findHow to install Django on Windows useful.

Install Apache and mod_wsgi

If you just want to experiment with Django, skip ahead to the nextsection; Django includes a lightweight web server you can use fortesting, so you won’t need to set up Apache until you’re ready todeploy Django in production.

If you want to use Django on a production site, use Apache withmod_wsgi. mod_wsgi operates in one of two modes: embeddedmode or daemon mode. In embedded mode, mod_wsgi is similar tomod_perl – it embeds Python within Apache and loads Python code intomemory when the server starts. Code stays in memory throughout thelife of an Apache process, which leads to significant performancegains over other server arrangements. In daemon mode, mod_wsgi spawnsan independent daemon process that handles requests. The daemonprocess can run as a different user than the Web server, possiblyleading to improved security. The daemon process can be restartedwithout restarting the entire Apache Web server, possibly makingrefreshing your codebase more seamless. Consult the mod_wsgidocumentation to determine which mode is right for your setup. Makesure you have Apache installed with the mod_wsgi module activated.Django will work with any version of Apache that supports mod_wsgi.

See How to use Django with mod_wsgifor information on how to configure mod_wsgi once you have itinstalled.

If you can’t use mod_wsgi for some reason, fear not: Django supports many otherdeployment options. One is uWSGI; it worksvery well with nginx. Additionally, Django follows the WSGI spec(PEP 3333), which allows it to run on a variety of server platforms.

Get your database running¶

If you plan to use Django’s database API functionality, you’ll need to makesure a database server is running. Django supports many different databaseservers and is officially supported with PostgreSQL, MariaDB, MySQL, Oracleand SQLite.

If you are developing a small project or something you don’t plan to deploy ina production environment, SQLite is generally the best option as it doesn’trequire running a separate server. However, SQLite has many differences fromother databases, so if you are working on something substantial, it’srecommended to develop with the same database that you plan on using inproduction.

In addition to the officially supported databases, there are backendsprovided by 3rd parties that allow you to use otherdatabases with Django.

Install Pip Dmg

In addition to a database backend, you’ll need to make sure your Pythondatabase bindings are installed.

  • If you’re using PostgreSQL, you’ll need the psycopg2 package. Refer to thePostgreSQL notes for further details.
  • If you’re using MySQL or MariaDB, you’ll need a DB API driver like mysqlclient. See notes for the MySQLbackend for details.
  • If you’re using SQLite you might want to read the SQLite backend notes.
  • If you’re using Oracle, you’ll need a copy of cx_Oracle, but pleaseread the notes for the Oracle backend for detailsregarding supported versions of both Oracle and cx_Oracle.
  • If you’re using an unofficial 3rd party backend, please consult thedocumentation provided for any additional requirements.

If you plan to use Django’s manage.pymigrate command to automaticallycreate database tables for your models (after first installing Django andcreating a project), you’ll need to ensure that Django has permission to createand alter tables in the database you’re using; if you plan to manually createthe tables, you can grant Django SELECT, INSERT, UPDATE andDELETE permissions. After creating a database user with these permissions,you’ll specify the details in your project’s settings file, seeDATABASES for details.

If you’re using Django’s testing framework to testdatabase queries, Django will need permission to create a test database.

Install the Django code¶

Installation instructions are slightly different depending on whether you’reinstalling a distribution-specific package, downloading the latest officialrelease, or fetching the latest development version.

Installing an official release with pip

Install Pip Mac

This is the recommended way to install Django.

  1. Install pip. The easiest is to use the standalone pip installer. If yourdistribution already has pip installed, you might need to update it ifit’s outdated. If it’s outdated, you’ll know because installation won’twork.

  2. Take a look at venv. This tool providesisolated Python environments, which are more practical than installingpackages systemwide. It also allows installing packages withoutadministrator privileges. The contributing tutorial walks through how to create a virtual environment.

  3. After you’ve created and activated a virtual environment, enter the command:

Installing a distribution-specific package¶

Check the distribution specific notes to see ifyour platform/distribution provides official Django packages/installers.Distribution-provided packages will typically allow for automatic installationof dependencies and supported upgrade paths; however, these packages will rarelycontain the latest release of Django.

Installing the development version¶

Install Pip Global

Tracking Django development

If you decide to use the latest development version of Django,you’ll want to pay close attention to the development timeline,and you’ll want to keep an eye on the release notes for theupcoming release. This will help you stayon top of any new features you might want to use, as well as any changesyou’ll need to make to your code when updating your copy of Django.(For stable releases, any necessary changes are documented in therelease notes.)

If you’d like to be able to update your Django code occasionally with thelatest bug fixes and improvements, follow these instructions:

Install Pip Dmg Windows 10

  1. Make sure that you have Git installed and that you can run its commandsfrom a shell. (Enter githelp at a shell prompt to test this.)

  2. Check out Django’s main development branch like so:

    This will create a directory django in your current directory.

  3. Make sure that the Python interpreter can load Django’s code. The mostconvenient way to do this is to use a virtual environment and pip. Thecontributing tutorial walks through how tocreate a virtual environment.

  4. After setting up and activating the virtual environment, run the followingcommand:

    This will make Django’s code importable, and will also make thedjango-admin utility command available. In other words, you’re allset!

Install Pip Git Bash

When you want to update your copy of the Django source code, run the commandgitpull from within the django directory. When you do this, Git willdownload any changes.