System information: Sublime Text 3.1.1 and Mac 10.14 Mojave
I am very new to programming and am just following a book to learn Python. I just updated from python 2.7 to python 3. Now, Sublime will not recognize modules I previously imported and worked with, namely pygame and pygal. When I try to import them, I get the following error:
import pygame
Traceback (most recent call last):
File "/Users/MyNameHere/Desktop/python_work/data_visualization/python_repos.py", line 1, in <module>
import pygame
ModuleNotFoundError: No module named 'pygame'
(where python_repos.py is the current program I am working in).
I know I have already installed these modules, because when I try to install pygame, for example, with pip install pygame
in terminal, I get:
`Requirement already satisfied: pygame in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (1.9.4)`
Same goes with the other modules in question. I have tried doing many things to find a solution. One possible thing that comes up a lot is the suggestion to make sure sublime is using the updated version of pygame/pygal/etc. but I do not know how to do this.
Additionally, I am thinking maybe pygame/pygal/etc. are downloaded in some folder containing all my python 2.7 programs and are not with my Python 3 stuff. If this is correct, how would I go about adding the already downloaded programs to my Python 3 directory or whatever?