我已經在我的虛擬環境中安裝了 django 也激活了虛擬環境但它仍然顯示這些錯誤 python
from django.urls import path
輸出
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows
PS E:\django\project\telusko> & C:/Users/hp/AppData/Local/Programs/Python/Python39/python.exe e:/django/project/telusko/calc/urls.py
Traceback (most recent call last):
File "e:\django\project\telusko\calc\urls.py", line 1, in <module>
from django.urls import path
ModuleNotFoundError: No module named 'django'
PS E:\django\project\telusko>
uj5u.com熱心網友回復:
在激活的環境中嘗試pip freeze命令。結果中不存在 django 使用以下命令
python -m pip install Django
uj5u.com熱心網友回復:
您已經django在虛擬環境中安裝了,但是您正在使用全域python環境:
C:/Users/hp/AppData/Local/Programs/Python/Python39/python.exe
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/365417.html
