1

I am working on this project and I am using VS-code editor. I already installed Django-embed-video using pip install and I have installed the embed_video in settings under INSTALLED_APPS. This is the directory where the embed_video is installed on my pc:

C:\Users\DEL.L\AppData\Local\Programs\Python\Python39\Lib\site-packages.

but when I try to Import "embed_video.fields I get error message that says "could not be resolved Pylance report Missing Imports".

from django.db import models
from embed_video.fields import EmbedVideoField
# Create your models here.

class video(models.Model):
    title = models.CharField(max_length=100)
    added = models.DateTimeField(auto_now_add=True)
    url = EmbedVideoField()

    def __str__(self):
        return str(self.title)
    
    class Meta:
        ordering = ['-added']

a121
  • 798
  • 4
  • 9
  • 20
promise
  • 11
  • 1

2 Answers2

2

Please use the command "pip --version" in the VS Code terminal to check the source of the module installation tool "pip", the module is installed here:

enter image description here

Then use "pip show django-embed-video" to view that the module has been installed successfully:

enter image description here

Also, please try to reload VS Code after the module installation is complete.

enter image description here

Reference: Python environment in VSCode.

Jill Cheng
  • 9,179
  • 1
  • 20
  • 25
0

First of all, check if your Django virtual environment is activated. If it's not, run & C:/Users/yourname/.virtualenvs/djangodev/Scripts/Activate.ps1 in your terminal.

If you've just installed Django-embed-video by using pip install django django-embed-video and have not closed VSCode yet, try to close and re-open it (maybe the installation had not been applied into Visual Studio).