}

Articles tagged "python"

Page 8 of 13

1 min readBeginner

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!

2 min readIntermediate

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: (, ) ex. file': (StringIO('my file contents'), 'test_file.txt'). Check here for a full example

1 min readBeginner

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)

2 min readIntermediate

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.

3 min readBeginner

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.

1 min readIntermediate

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.

1 min readBeginner

pip: module has no attribute main Error

If you are using pip and get the following import error: AttributeError: 'module' object has no attribute 'main' you can import main from pip._internal. Check here for the complete solution

1 min read

New tutorials version!

We just release a new version of tutorials.technology using python pelican.

1 min readBeginner

Solved! Fiona 1.7.1 missing GeoPackage & FileGDB

If you are missing GeoPackages or ESRI FileGDB as suuported drivers, execute: pip install -I fiona --no-binary fiona. This will compile the source of Fiona and link to your installed libraries. Check here for full description of the problem.

2 min read

Two Algorithms for Software Engineering Interviews

If you are pareparing for a software interview there are two graph algorithms you must know: BFS and DFS. We will use python code for examples.