<!-- Processed by make_markdown V0.0.4 -->
<p>This is a show describing how I solved a problem of using my new Blinkstick Nano in Python, the problem occurred because I inadvertently installed the blinkstick module to the wrong version of Python as I have multiple versions of python installed on my raspberry pi.</p>
<p>A blinkstick is a USB powered device with attached RGB led’s, it can be controlled using a wide range of languages, and supports the Raspberry Pi, Linux, Microsoft Windows &amp; Apple</p>
<p>As a side note I forgot to mention that the blinkstick hardware and software is Open Source</p>
<ul>
<li><p>Link to blinkstick website<br />
<a href="https://www.blinkstick.com/" class="uri">https://www.blinkstick.com/</a></p></li>
<li><p>This is the particular model I bought<br />
<a href="https://www.blinkstick.com/products/blinkstick-nano" class="uri">https://www.blinkstick.com/products/blinkstick-nano</a></p></li>
</ul>
<p>Initially I blindly followed the advice given at <a href="https://www.blinkstick.com/help/raspberry-pi-integration" class="uri">https://www.blinkstick.com/help/raspberry-pi-integration</a> which recommended the following commands</p>
<pre><code>sudo apt-get install -y python-pip python2.7-dev
sudo pip install blinkstick
sudo blinkstick --info
blnkstick --add-udev-rule</code></pre>
<p>I discovered that the blinkstick module was not being found when I ran my python script, this turned out to be because I was invoking a different version of python in my script from that which I installed the blinkstick module. I installed the blinkstick module to Python 2.7, my script was running python 3.2</p>
<p>I ran the following commands to rectify the problem</p>
<pre><code>sudo apt-get install -y python3-pip
sudo pip-3.2 install blinkstick
sudo blinkstick --info (Run in my script)
blinkstick --add-udev-rule (Not required 2nd time round)</code></pre>
<p>Here are some links I looked at to get some understanding of what was going on</p>
<ul>
<li><p>Installing Python Modules<br />
<a href="https://docs.python.org/3.6/installing/index.html" class="uri">https://docs.python.org/3.6/installing/index.html</a></p></li>
<li><p>Wikipedia entry for pip<br />
<a href="https://en.wikipedia.org/wiki/Pip_(package_manager)" class="uri">https://en.wikipedia.org/wiki/Pip_(package_manager)</a></p></li>
</ul>
<p>You can get a list of your installed python modules by first going to the python interpreter by typing <code>python</code> at the command prompt and issuing the following command</p>
<pre><code>&gt;&gt;&gt; help(&#39;modules&#39;)</code></pre>
<p>You can list your python search path by first going to the interpreter by typing <code>python</code> at the command prompt and issuing the following commands, the search path is the list of system directories that python will search to run things like commands and modules</p>
<pre><code>&gt;&gt;&gt; import sys
&gt;&gt;&gt; sys.path</code></pre>
<h3 id="links">Links</h3>
<ul>
<li><a href="https://www.blinkstick.com/" class="uri">https://www.blinkstick.com/</a></li>
<li><a href="https://www.blinkstick.com/products/blinkstick-nano" class="uri">https://www.blinkstick.com/products/blinkstick-nano</a></li>
<li><a href="https://www.blinkstick.com/help/raspberry-pi-integration" class="uri">https://www.blinkstick.com/help/raspberry-pi-integration</a></li>
<li><a href="https://docs.python.org/3.6/installing/index.html" class="uri">https://docs.python.org/3.6/installing/index.html</a></li>
<li><a href="https://en.wikipedia.org/wiki/Pip_(package_manager)" class="uri">https://en.wikipedia.org/wiki/Pip_(package_manager)</a></li>
</ul>
