I was finally able to get python 3.9.0 installed(was using 3.4.2) on my raspberry pi, however I cannot use pygame now stating "ModuleNotFoundError: no module named 'pygame'. I know where pygame is located, but I have no idea how to get python 3.9.0 to see where it is to read it.
You have to re-install all of your packages when you upgrade to a new major version of Python. You'll need to pip3 install xxxx again.
Related
Probably stupidly I tried to install the latest version of Python, in this case using the download from python site, but after doing that I was then getting python still running on the previous version python-3.6. I'm on OSX and was using sublime.
So I have been trying to work out how to update it to use the newest version. I've followed; https://opensource.com/article/19/5/python-3-default-mac.
All of the responses to queries now point to the python-3.9.5 version. So that's great and my runtime is using that. However after installing the requests using pip install I get the following error when running.
import requests
ModuleNotFoundError: No module named 'requests'''
[path: /Library/Frameworks/Python.framework/Versions/3.9/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin]
I stumbled upon Modules are installed using pip on OSX but not found when importing which I have been trying to work through.
I have been able to run the import command successfully in terminal, however it's intermittent as I've tried again and it's broken, so I'm lost. I'm running it something trying to run the python3.6 version, which after updating I followed these instructions to remove when I have uninstalled that from my mac https://www.macupdate.com/app/mac/5880/python/uninstall.
If there is any ideas, would love some help, mainly to try and tell me what that error message is telling me.
In particular, what does this mean?
[path: /Library/Frameworks/Python.framework/Versions/3.9/bin:/Library/Frameworks/Python.framework/Versions/3.6/
I should clarify too; when I run 'pip list'
I see
requests 2.25.1
Assuming that you are not installing requests package properly, and assuming your python executable is named python:
python -m pip install requests
If however, your python executable is named something else instead, e.g. python3, replace python with that name:
python3 -m pip install requests
On my raspberry pi 3, I am trying to run this code, but I get this error:
No module named google.auth.transport.grpc
I have installed all packages listed in the requirements.txt (on the same github page above), and installed grpcio. I have installed google-auth. I have installed google-assistant-sdk. I have no clue why this module is not working correctly. If I open up python and try: import google.auth it gives the same error of "No module named google.auth"
Any ideas as to how I can fix this?
Try to verify the version of Python that you are using to run this code. If you installed the module in Python 2.x and try to run it with Python 3.x it will not work, because modules installed on Python 2 are not usable in Python 3 and vise versa.
I was trying to run the program with python -m textinput.py, which used python 2.x
Using python3 -m textinput.py fixed my issue by using python 3.x
So pygame is definitely on my computer, and I can call it through the Python terminal that was installed when I downloaded Python 3.8. However, I can't get Spyder to import the pygame module. When I do, it gives me this error message:
ModuleNotFoundError: No module named 'pygame'
Could someone please walk me through how I set up pygame so that Spyder can recognize the pygame module? Thanks!
You've only installed pygame into a different python editor. If you want it to work on spyder, you should install it via the pip that belongs to spyder.
I'm using Python 3.5, and the version of pygame designed for it. I have now installed pygame, by converting to zip and moving the files like in this video here. However when I run the command import pygame, the error ImportError: No module named 'pygame.base' appears.
Using this method of installation has worked fine in the past, but ever since getting a new PC, isn't working. What is wrong, and how do I fix the problem?
Edit:
I tried using the answer found on Game Dev SE, however this gave me the error: not a supported wheel on this platform
The version of pygame I'm trying to install is: pygame-1.9.2a0-cp35-none-win_amd64.whl. Which can be found here.
This is for windows 10 64 bit. Run the 64 bit python as administrator it should import pygame without problem. It worked for me
Make sure pygame folder is copied under C:\Program Files\Python35\Lib\site-packages\ before you start python
try usin pip3 install pygames to install pygames
pip3 install pygame
I am trying to create a graph on Python (version 3 and above) using matplotlib, however I keep getting the error saying
ImportError: No module named 'six'
Does anyone know how to fix this? I have already tried downloading the module. And I still get this error.
Are you sure you've installed six?
If you have both python 2.x and 3.x installed, it may be that when running easy_install or pip, you're installing six for 2.x rather than 3.x. If you have pip, try running pip3 install six in a shell, or for easy_install, run easy_install-3.4 six (replace 3.4 with your 3.x python version).