Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

322
Visualizações
Why can't I import requests in VS Code?

I want to use request module, but whenever I tried to import requests I got this message:

import "requests" could not be resolved from source Pylance

I already used pip to install the requests module, but I still receive this error message.

over 4 years ago · Santiago Trujillo
5 Respostas
Responde à pergunta

0

Have you made sure that you have installed the module by running

pip install requests

or

pip3 install requests

Additionally, you can tell VS Code to use different Python-interpreter in your system. I e.g. had the same problem, that VS Code code check gave me the warning, that I don't have the module requests installed, but when I run the python script it worked anyhow. That's why I believe that the python code check in VS Code can use different Python versions and related python packages than your system use when you run the code.

What helped me in order to get rid of the VS Code error message, choosing a different Python from here:

Screenshot of VS Code IDE. Change Python version for code check

over 4 years ago · Santiago Trujillo Relatório

0

I got the same error and solved it with this:

import pip._vendor.requests 
over 4 years ago · Santiago Trujillo Relatório

0

The solution is to change the interpreter. I solved this conflict by going to 3.8.8 (conda) from 3.9.9 (windows).

over 4 years ago · Santiago Trujillo Relatório

0

From VS code terminal set venv - C:\Python310\python.exe -m venv 'PATH_TO_VENV\.venv\'

After this verify packages are available

pip list

if required:

pip install requests

This solved my problem

over 4 years ago · Santiago Trujillo Relatório

0

  1. Open interpreters
  2. Try all of them one by one

The problem is you might have installed the module in one env and not in the other one, so either install in each or try each of them!

Click on bottom-left

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda