Dos下用pip命令明明安装pygame模块却导入不到

Dos下用pip命令明明安装pygame模块,路径在Anaconda3\lib\site-packages文件下。在vscode编辑器导入不到

import pygame
ModuleNotFoundError: No module named 'pygame'

img

没在vscode python环境路径下,无法正确导入。就比如说,假如用pycharm,放到了pycharm相关路径下,之后用vscode,自然要放到vscode相关路径下,不然直接导入,它可能查找不到。
以上仅供参考,希望对题主有所帮助!

img


Warning:
This Python interpreter is in a conda environment, but the environment has
not been activated. Libraries may fail to load. To activate this environment
please see https://conda.io/activation

Type "help", "copyright", "credits" or "license" for more information.

import pygame
pygame 2.1.2 (SDL 2.0.18, Python 3.9.7)
Hello from the pygame community. https://www.pygame.org/contribute.html