Error installing Pygame / Python 3.4.1 - python-3.x

I'm trying to install Pygame and it returns me the following error "Python version 3.4 required which was not found in the registry". However I already have the Python 3.4.1 installed on my system. Does anyone know how to solve that problem?
I've been using Windows 8.1
Thanks in advance.

Are you using a 64-bit operating system? Try using the 32-bit installer.

Tips I can provide:
Add Python to your Path file in the Advanced settings of your Environmental Variables (just search for it in the control panel)
Something may have gone wrong with the download of Python, so re-install it. Also don't download the 64-bit version, just download the 32-bit version from the main pygame website
Once that's sorted out, transfer the entire Pygame file to the site packages in the Python directory and open up the pygame file and go to this directory in command prompt. Finally, run the Pygame setup from the command prompt which should be something like:
python setup.py
But this will only work if the pygame setup file is called setup.py (it's been a while since I downloaded it), you added Python to the Path file and you're currently in the correct directory in command prompt.
To test if it worked try importing pygame and see if you got an error or not.

Related

PyCharm cannot find gdal libraries when using os system in WSL Ubuntu

The problem is that within the PyCharm editor, the gdal applications (e.g. gdalwarp or gdal_grid https://gdal.org/) cannot be found when using os.system. For example the code:
os.system(f"gdalwarp -t_srs EPSG:27700 {fnc} {tname}")
returns this error message 'sh: 1: gdalwarp: not found'.
I am using PyCharm interpreter with the following settings:
Ubuntu WSL platform
conda environment with gdal libaries installed.
When I run the code from the ubuntu terminal, it does find the gdal libraries. So I don't think the problem is within the conda environment, but there is a problem with PyCharm settings to find the gdal application using os system.
I do not want to change the code, but I would rather figure out the correct PyCharm settings. Any help would be greatly appreciated.

"Failed to execute script pyi_rth_qt4plugins" error while running exe

I have made my application using PyQt4 and it's executable using pyinstaller. The executable runs fine on my system. My system also has PyQt5 installed.
The problem is that when I try to run the same executable on the target system(client's system), it gives me an error Failed to execute script pyi_rth_qt4plugins. The client system doesn't have Python or any version of PyQt.
I wanna know why is this happening. I'm not even able to locate where is the pyi_rth_qt4plugins located in the executable. Do I need to install Python and PyQt in my client's system as well?
As per the answer from the long thread here https://github.com/pyinstaller/pyinstaller/issues/2461
In site-packages (where PyInstaller is located) edit the following file:
PyInstaller/loader/rthooks.dat
Remove this line:
'PyQt4': ['pyi_rth_qt4plugins.py'],
This error also occurs in Python3.5 if you are using 3.5 you can downgrade to 3.4 to avoid the error
check here https://github.com/pyinstaller/pyinstaller/issues/2207
or if you don't want to downgrade python you can upgrade to PyQt5

Why does pyinstaller executable change the format and resolution?

I've been surfing through the internet and have failed to find the answers I'm looking for. I am new to python and asking questions here, but anyways, I am running windows 10, and my script uses tkinter as the GUI module. Whenever I run the script through the command prompt (or IDE) I get this: Image via IDE
Whenever I run pyinstaller executable, I get this: pyinstaller executable
As you can see, the executable changes some of the geometry of the widgets and makes the image blurry. How do I fix this on my computer, and how do I account for this across various windows supported hardware?
It turns out that the issue is with windows and can be corrected by right clicking on the executable in the file window and following these steps: https://www.ghacks.net/2020/09/14/how-to-fix-blurry-text-in-programs-on-windows-10/

"No module named wordcloud" after successful installation

After searching everywhere on here I found some solutions to my problem. At first, the error was that I needed Visual C++ 14.0 and that I could get it from a link that didn't work. So, I downloaded Visual C++ Build Tools and got Visual C++ 14.0.23026. That did not solve the problem.
I did some more searching and found that I could install it using wheel. So, I got wheel and got the .whl file from here as shown in the comments of this
post, making sure to get the correct version for my python version (3.6). Running python -m pip install wordcloud-1.5.0-cp36-cp36m-win32.whl worked, it seemed.
However, after restarting Pycharm, the IDE I use to run python files, it still didn't import it correctly. ModuleNotFoundError: No module named 'wordcloud'.
What am I missing here? Thanks!
EDIT: It works outside of Pycharm (just double clicking my python file), but I'd still like it to work in Pycharm.
I have the same problem and I've solved it.
When you create a project, you should choose 'inherit global site-packages
Or
You can use the terminal in the Pycharm to install the wordcloud.
You can also install wordcloud by File->Settings->Project:your project name->Project interpreter.

PySide2 application failed to start

I just tried to test the newly released version of PySide2 (5.11) on Windows 10, 64 bit version. But the "Hello World" example does not work. I am using Python 3.6 with PyCharm. The interpreter I use is from Anaconda. So I pip installed the PySide2 version and also tried to install via "conda install ..." the older version of PySide2. Both installations worked, but I get the same error message for both libraries.
The error message is popping up in a separate screen saying: "This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. Available platform plugins are: minimal, offscreen, windows."
So I definitely can see the plugin files in the correct folder. I tried reinstalling. Deleted everything and tried other IDEs. But nothing solved the problem.
Any help is appreciated.
Try This :
import sys,os
import PySide2
dirname = os.path.dirname(PySide2.__file__)
plugin_path = os.path.join(dirname, 'plugins', 'platforms')
os.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] = plugin_path
# code .......
# .......
If you run the app after having set QT_DEBUG_PLUGINS=1, you should get more info on what is the issue. In my case, I was getting:
QFactoryLoader::QFactoryLoader() checking directory path "C:/Users/xxxxx/AppData/Local/py3/platforms" ...
qt.qpa.plugin: Could not find the Qt platform plugin "windows" in ""
Such a folder does not exist on my machine.
There are a few tickets somehow related to a similar issue (not sure it is the same problem):
https://bugreports.qt.io/browse/PYSIDE-559
https://github.com/pyside/pyside2-setup/issues/57
https://github.com/conda-forge/matplotlib-feedstock/issues/2
https://github.com/conda-forge/qt-feedstock/issues/71
My current working solution is to remove PyQt, qt and sip anaconda packages, then to manually delete a relic qt.conf in the root folder of the environment. After that, the official PyPi PySide2 wheel works fine.
check whether you have this directory or not: C:\Users\your_user_name\anaconda3\envs\your_virtual_env_name\Library\plugins.
If you don't have it, copy the whole "plugin" folder from your PySide2 site-package.
Mine is in here: C:\Users\your_user_name\anaconda3\envs\your_virtual_env_name\Lib\site-packages\PySide2\plugins
and paste the whole folder to C:\Users\your_user_name\anaconda3\envs\your_virtual_env_name\Library

Resources