LoginSignup
1
4

More than 1 year has passed since last update.

Import "requests" could not be resolved from sourcePylancereportMissingModuleSource

Last updated at Posted at 2021-06-04

現象

importの失敗

Import "requests" could not be resolved from sourcePylancereportMissingModuleSource

pipしても、既にあると表示

pip install requests
Requirement already satisfied: requests in  ***************

pathの確認↓

import sys
import pprint
for place in sys.path:
    print(place)

原因

Python2系と3系が混在していて、VSコード内部でターミナルを起動したため、Python2系を参照していた
(ターミナル単体で起動すると、Python3系を呼ぶのでややこしい...)

解決方法

VSコードのSettingpython.pythonpathと検索
pythonpython3に変更する

1
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
4