D盘装了3.8版本的python“D:\anaconda3”
E盘装了3.7版本的python"E:\python"
2个版本都装了相应版本的pygame,在anaconda3中运行带有pygame库的ipynb文件时正常,但是当同样的文件转成py文件时,就报错,提示:
Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
====================== RESTART: E:\mypython\pygame1.py ======================
Traceback (most recent call last):
File "E:\mypython\pygame1.py", line 1, in
import pygame
File "D:\anaconda3\Lib\site-packages\pygame_init_.py", line 81, in
from pygame.base import * # pylint: disable=wildcard-import; lgtm[py/polluting-import]
ModuleNotFoundError: No module named 'pygame.base'
明明是运行E盘的Python3.7的py文件,却提示在D盘的anaconda3的库中找不到模块,而不是在3.7的python找相应的库文件,一直报错,未使用pygame库的ipynb和py文件使用都正常,只有用了pygame库的py程序报错,ipynb程序一直是正常的,求解决