Install in virtual env?


#1

Hi, I am new to Pimoroni and somewhat new to Pi, but I have been developing in Python for a while. I just installed your pantilthat and the Python modules that support this Pi hat by following the instructions on your git page for the same.

The recommended install puts the Python modules in the global environment, and I would like to install them in a virtual environment (created with the virtualenviwrapper utilities).

I have tried different incantations and combinations, but I have not been able to complete the installation successfully. Is there a way to do a pure Python pip install with the required dependencies (notably the Python3-smbus)?

Thanks.


#2

Some dependencies, like smbus, are only available via apt, and not pip, which thwarts virtualenv.

The pervading technique to get around this just seems to be to manually copy the files from /usr/lib/python2.7/dist-packages into your virtualenv.