Installer Django avec pip

Exclusif Premium

Débloquez votre potentiel ! ✨

Cette session fait partie de notre programme Premium exclusif

+100h de formations exclusives
+180 exercices de code avancés
+100h de mentorats en réécriture
20 projets guidés pas à pas
Mentorats groupés hebdomadaires
Support individuel avec nos mentors

Prêt à passer au niveau supérieur ?

Découvrez tous les avantages Premium et transformez votre apprentissage dès aujourd'hui!

Inscris-toi

(c'est gratuit !)

Un compte est nécessaire pour participer aux discussions.

Créer un compte

Toutes les questions

Geoffroy Streit

7 juillet 2024

Résolue
4 réponses

error while using python -m django --version

Bonjour, je rencontre une erreur en executant la commande : python -m django --version -> ModuleNotFoundError: No module named 'distutils' Comme si l'installation du module django ne s'était automatiquement pas faite avec toutes les dépendances nécessaires. De même, quand je lance la commande Python pour un interpréteur python interactif, rien ne se passe. J'ai suivi le cours jusqu'alors, créé et activé mon environnement virtuel, je suis sous windows avec git bash. (WSL2 ne semble pas bien répondre, et dual boot linux temporairement défaillant) ``` (.env) Hylst@HYLST-LAPTOP MINGW64 /c/python/docstring/DocBlog $ pip install --upgrade pip Requirement already satisfied: pip in c:\python\docstring\docblog\.env\lib\site-packages (24.0) Collecting pip Downloading pip-24.1.1-py3-none-any.whl.metadata (3.6 kB) Downloading pip-24.1.1-py3-none-any.whl (1.8 MB) ---------------------------------------- 1.8/1.8 MB 5.1 MB/s eta 0:00:00 ERROR: To modify pip, please run the following command: C:\python\docstring\DocBlog\.env\Scripts\python.exe -m pip install --upgrade pip [notice] A new release of pip is available: 24.0 -> 24.1.1 [notice] To update, run: python.exe -m pip install --upgrade pip (.env) Hylst@HYLST-LAPTOP MINGW64 /c/python/docstring/DocBlog $ pip install django==3.1.6 Collecting django==3.1.6 Downloading Django-3.1.6-py3-none-any.whl.metadata (3.7 kB) Collecting asgiref<4,>=3.2.10 (from django==3.1.6) Downloading asgiref-3.8.1-py3-none-any.whl.metadata (9.3 kB) Collecting pytz (from django==3.1.6) Using cached pytz-2024.1-py2.py3-none-any.whl.metadata (22 kB) Collecting sqlparse>=0.2.2 (from django==3.1.6) Downloading sqlparse-0.5.0-py3-none-any.whl.metadata (3.9 kB) Downloading Django-3.1.6-py3-none-any.whl (7.8 MB) ---------------------------------------- 7.8/7.8 MB 6.9 MB/s eta 0:00:00 Downloading asgiref-3.8.1-py3-none-any.whl (23 kB) Downloading sqlparse-0.5.0-py3-none-any.whl (43 kB) ---------------------------------------- 44.0/44.0 kB 2.1 MB/s eta 0:00:00 Using cached pytz-2024.1-py2.py3-none-any.whl (505 kB) Installing collected packages: pytz, sqlparse, asgiref, django Successfully installed asgiref-3.8.1 django-3.1.6 pytz-2024.1 sqlparse-0.5.0 [notice] A new release of pip is available: 24.0 -> 24.1.1 [notice] To update, run: python.exe -m pip install --upgrade pip (.env) Hylst@HYLST-LAPTOP MINGW64 /c/python/docstring/DocBlog $ python -m django --version Traceback (most recent call last): File "", line 189, in _run_module_as_main File "", line 148, in _get_module_details File "", line 112, in _get_module_details File "C:\python\docstring\DocBlog\.env\Lib\site-packages\django\__init__.py", line 1, in from django.utils.version import get_version File "C:\python\docstring\DocBlog\.env\Lib\site-packages\django\utils\version.py", line 6, in from distutils.version import LooseVersion ModuleNotFoundError: No module named 'distutils' (.env) Hylst@HYLST-LAPTOP MINGW64 /c/python/docstring/DocBlog $ python ``` Merci par avance de votre aide !

Ce n'est pas fini...

Tu as complété % du parcours 🔥

Termine l'intégralité de la formation pour pouvoir débloquer ton attestation de réussite.

Rechercher sur le site

Inscris-toi à Docstring

Pour commencer ton apprentissage.

Tu as déjà un compte ? Connecte-toi.