Python Forum
How do I get pygame module to work in Spyder? (Mac)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do I get pygame module to work in Spyder? (Mac)
#14
(Dec-17-2022, 03:46 AM)FirstBornAlbratross Wrote: OK so after using "which python" and "python -c "import sys; print(sys.executable)"" the path is shown as:

/opt/miniconda3/bin/python
Now is path set to Miniconda which is fine,but you most know how to use it.
Most activate a environment eg conda activate base if you not have make one.
Most have (base) environment activated,then it will use pip or conda that belong to Miniconda.
Or make new environment as you see in link under
How to Manage Conda Environments on an Apple Silicon M1 Mac

Example is i use (base) environment.
# See that now do pip point to miniconda3
(base) G:\div_code
λ pip -V
pip 21.3.1 from G:\miniconda3\lib\site-packages\pip (python 3.9)

(base) G:\div_code
λ conda -V
conda 4.11.0

# Python point to miniconda3
(base) G:\div_code
λ python -c "import sys; print(sys.executable)"
G:\miniconda3\python.exe

# Will install to this environment
(base) G:\div_code
λ pip install pygame
Collecting pygame
  Downloading pygame-2.1.2-cp39-cp39-win_amd64.whl (8.4 MB)
     |████████████████████████████████| 8.4 MB 3.3 MB/s
Installing collected packages: pygame
Successfully installed pygame-2.1.2

# Start Spyder when enviroment is active
(base) G:\div_code
λ spyder
If you activate the conda environments then usually all will work,but if not activated it will use pip that now is set to a OS python version.
You have installed Python and miniconda versions,but not all get mess together if not activate environment.
Reply


Messages In This Thread
RE: How do I get pygame module to work in Spyder? (Mac) - by snippsat - Dec-17-2022, 11:30 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  keyboard module doesn't work in the microsoft version terminal of python. username 1 2,910 Feb-25-2021, 05:19 PM
Last Post: Larz60+
  pygame music doesn't work CompleteNewb 1 4,786 Jan-30-2021, 09:25 AM
Last Post: Tyrel
  Cannot make 'pandas' module to work... ellie145 2 4,272 Jan-05-2021, 09:38 PM
Last Post: ellie145
  My Python Console doesn´t work ModuleNotFoundError: No module named 'tokenize' RuanKishibe 1 3,213 Aug-06-2020, 10:07 PM
Last Post: deanhystad
  ModuleNotFoundError: No module named 'pygame' Cath 3 14,392 Oct-18-2019, 05:59 PM
Last Post: metulburr
  Pycharm Cannot Find Pygame Module Myang123 2 6,071 Aug-07-2019, 01:26 AM
Last Post: Myang123
  Spyder: Module Not Found jmair 2 20,330 Sep-25-2018, 05:14 PM
Last Post: jmair
  Attribute of module shelve doesn't work Ponomarenko Pavlo 1 5,134 Jul-12-2017, 06:08 PM
Last Post: buran
  Pygame*import pygame ImportError: No module named pygame CASPERHANISCH 1 9,808 Jun-05-2017, 09:50 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020