Python Index Page 3
Python function to generate secure random password
In this short tutorial, we will explain how to write a function to generate a secure random password generator. the function will accept size and chars as parameters. We use SystemRandom since it's more secure and provides more entropy.
Python Index Page 3
Pip: No Matching Distribution for Twisted/Pillow
When you try to install Twisted you could get the error: "No matching distribution found for Twisted". One couse could be that you python is missing some extension, like bz2. You will need to change your pytohn interpreter or recompile it.
Python Index Page 3
Python Cryptography: No module setuptools_ext
When you install cryptography with the command `pip install cryptography --upgrade`, the following error is raised: ImportError: No module named setuptools_ext. Try to upgrade cffi with: pip install -U cffi. Check here for all steps to solve this issue.
Python Index Page 3
Scrapy: libxml/xmlversion.h Not Found
If you have the error Python cryptography: error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 while installing python cryptography, try the following SOLUTION: sudo apt-get install python3 python-dev python3-dev build-essential libssl-dev libffi-dev libxml2-dev libxslt1-dev zlib1g-dev python-pip. Check here for full details
Python Index Page 3
pip install error: locale.Error: unsupported locale setting
When you install a apackage with pip and you get the error: locale.Error: unsupported locale setting, try to set the locale like this: export LC_ALL=C. Check out full solution here!
Python Index Page 3
Flask: How to Test file upload
Example on how to test file upload using flask client. Check here how to do a request using the FlaskClient to simulare a file upload. You need to put a tuple in the request payload with the data types: (
Python Index Page 3
pymssql: sqlfront.h Not Found Error
When you install pymssql and you get the error: src/_mssql.c:568:22: fatal error: sqlfront.h: No such file or directory. try to install freetds-dev with apt (sudo apt install freetds-dev)
Python Index Page 3
Mongoengine: FileField for Images and Files
Check here an example on how to use mongoengine filefield. Mongoengine FieldField uses GridFS to store the files, check here how to use it in your project.
Python Index Page 3
Linux: Check Internet Speed from Terminal
We explain how to use speedtest python project to check internet speed via the terminal. We will also explain how to save historical network speed on your linux server with a very cron line. Finally we explain how to plot the generated csv data.
Python Index Page 3
Python: pip is broken. _internal module cannot be imported
The error is common after you execute "pip install pip -U" and you will see the error "ImportError: No module named _internal" everytime you execute "pip". One solution is to change the import on the pip file: **from pip import main**, change that line with **from pip._internal import main**. Check here for alternative solutions to this error.