Search code examples
pythonanacondaspyderpython-modulepygal

Installing modules like pygal so they work in Spyder


I'm a Python beginner working with Spyder, who must pip install modules for my class; pygal, for example. When I try to install, or reinstall as an administrator, this is what I get:

C:\WINDOWS\system32>pip install pygal Requirement already satisfied: pygal in c:\users\flora\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (2.4.0)

Yet when I try to import the module in a Spyder file, this is the message I get: Traceback (most recent call last):

File "C:\Users\flora\crash python\data mining\world_population2.py", line 2, in import pygal

ModuleNotFoundError: No module named 'pygal'

And there's no sign of it in the dependencies in Spyder. Same thing using IDLE 3.8. I had assumed that Spyder or Anaconda would automatically be able to use it. Does it have something to do with WHERE I have saved it? I have tried reinstalling Anaconda, restarting my computer, etc. No difference.

Thanks in advance for any ideas.


Solution

  • No idea if this will help but if you goal is to use pygal you can try using a different ide with python build in. It does not run the most current version of python by default but you can change it to the version of python you have installed. Try using Thonny I was able to import and run some code from pygal.