Python Index Page 1

Pygame blank screen with python3 and osx

Here is the solution when using pygame with OSX and you get a blank screen or not loading. You will need to uninstall and then install pygame from source code. In this article, we explain step by step how to fix pygame not loading in mac.

Python Index Page 1

OSX Solution: No package 'gobject-introspection-1.0' found

The error: PKG_CONFIG_PATH environment variable No package 'glib-2.0' found, could be easy solved when using brew by settings the PKG_CONFIG_PATH to the following value: export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/Cellar/gobject-introspection/VERSION/lib/pkgconfig

Python Index Page 1

python3 http server command line

In this short tutorial we explain how to start a simple http server from the command line, very useful to share files across the network. Just execute python -m http.server 8000

Python Index Page 1

OSX Solution: PKG_CONFIG_PATH environment variable No package 'glib-2.0' found

The error: PKG_CONFIG_PATH environment variable No package 'glib-2.0' found, could be easy solved when using brew by settings the PKG_CONFIG_PATH to the following value: export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/Cellar/glib/VERSION/lib/pkgconfig. Check this solution for more information

Python Index Page 1

Youtube api: download all videos from channel

In this tutorial, we are going to explain how to use YouTube API to fetch all videos on a channel.

Python Index Page 1

Raspberry pi and Python 3.7 : zipimport.ZipImportError: can't decompress data; zlib not available

Install the package zlib1g-dev using the command: sudo apt-get install zlib1g-dev to fix the error zipimport.ZipImportError: while installing python 3.7 from sources

Python Index Page 1

SOLUTION: ValueError: bad marshal data (unknown type code)

If while doing a python setup.py install you got the error "ValueError: bad marshal data (unknown type code)", delete all the pycs files. Check our solution to bad marshal data here.

Python Index Page 1

How to find the mime type of a file in Python?

Here are some example on how to guess the mime type of a file using python. The first example uses the filename only and the second example opens the file to guess the mime type.

Python Index Page 1

pip: six issue when installing package

If you are using macOS and you get a permission denied while installing with pip install six, then you could try to execute: pip install --ignore-installed six. check our solution for more details.

Python Index Page 1

macOS Mojave pyenv: Install failed, "zlib not available"

If you are having the error "zlib not available", try to use CFLAGS="-I$(xcrun --show-sdk-path)/usr/include" environment variable before compilation. Check here for more details.