Skip to content →

Tips to use pipenv in Raspberry Pi

pipenv logo is licensed under MIT license by Kenneth Reitz

Do you know pipenv, python programmer? You’d know that. pipenv is the best tool for python development.

Pipenv is a tool that aims to bring the best of all packaging worlds (bundler, composer, npm, cargo, yarn, etc.) to the Python world.

http://pipenv.readthedocs.io/

OK, let’s use pipenv to develop an application which works on Raspberry Pi. Before that, let me give you some tips to prevent you from long-time waiting…!


Locking is too slow

There’s nothing you can do

At least, you should include Pipfile in your git repository and save your time as much as possible.

pipenv install Timeouts

https://github.com/pypa/pipenv/issues/401

Solution:

I can’t figure out what is going on in this such a long time installation!

Use -v. It’s a ‘verbose’ flag. Use pipenv install -v

Use piwheels

Because of the section in the head of Pipfile, pipenv uses pypi to fetch packages.

But you know, there is piwheels.

Let’s use that.

The order of [[source]] is important… To order like this, pipenv tries piwheels first, then use pypi if piwheels fails.

pipenv starts over parallel installation

pipenv install launches 15 pips in my RPi Zero(!) What is this doing on a 1GHz machine…

Use --sequential. (pipenv install --sequential)

Well, which is better to parallelize or not, depends on the use-case, I think.


That’s all. Let’s use lockfile even in embedded development!

Enjoy!

Published in Python RaspberryPi Software