I have successfully installed pygal but I am not able to import it in Python. Can you please settle this issue? Has it anything to do with virtual environment? How do I install pygal in virtual environment.
Unable to import pygal in Python despite installing it
47 views Asked by Baziga At
1
Maybe there are multiple Python versions installed or multiple virtual environments on your system, and you have installed the package to the wrong one.
Use the same
pythoncommand to install and run (without the leading$):If you use IDLE, then start it like this:
(It's too late to change the Python version or the virtual environment after IDLE has been started. It's too late to select the Python version or the virtual environment after pip install has been started. You have to do it first, and then only run the
pythoncommand.)It's important that you start everything with the (same)
pythoncommand (rather thanpip,idleetc.), and from the same virtual environment (venv), if any. That's the way you can make sure that you will be using the same Python version and modules.