Articles tagged "python"

Page 8 of 13

1 min readIntermediate

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.

4 min readIntermediate

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.

1 min readIntermediate

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

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