How to install dependencies on different python environment using pyenv
<p>I installed cmus in OSX and I run it with an awesome utility called cmus-osx.py which uses <code>pyobjc</code> and <code>tinytag</code>. It ran perfectly with Python 2.7.11.</p>

<p>But I wanted to also run <code>mpsyt</code>, which only works with Python 3, so I installed <code>pyenv</code> in order to be able to run both utilities without messing with my environment. It worked, but it caused me some problems with cmus-osx.py, so I created an issue at the GitHub repo: <a href="https://github.com/azadkuh/cmus-osx/issues/5" rel="nofollow">https://github.com/azadkuh/cmus-osx/issues/5</a>.</p>

<p>After some back and forward with the author, I realized that <code>pyobjc</code> became unavailable in any of the pyenv <code>python</code> environments after I installed <code>pyenv</code>. Now the notifications feature, which requires pyobjc, only works correctly when I run cmus-osx.py from <em>system</em> python environment. The utility's author recommended me to </p>

<blockquote>
  <p>reinstall (share) dependencies (pyobjc and tinytag) on every
  environment who launches the cmus-osx utlity</p>
</blockquote>

<p>The thing is that I've no idea how to do this. I use OSX and I run cmus-osx.py from a zsh shell. </p>

<p>I know I should be able to figure it out by reading pyenv documentation, but I'm still learning to code and to manage a *nix based system and I want to understand what's really going on.</p>

<p>I would suggest doing some reading on the Python Virtual Environments tool, <a href="https://pypi.python.org/pypi/virtualenv" rel="nofollow">virtualenv</a>, such as the excellent guide <a href="http://docs.python-guide.org/en/latest/dev/virtualenvs/" rel="nofollow">here</a>.</p>

<p>Basically the steps are:</p>

<pre><code>pip install virtualenv
virtualenv some_dir_name
</code></pre>

<p>You can specify which exact python to install to your virtual environment with the <code>-p</code> flag.</p>

<pre><code>some_dir_name/bin/acivate
</code></pre>

<p><em>Windows users will need to use <code>activate.bat</code></em></p>

<p>You are then in your specified python environment with no packages other than the standard library and pip installed and can install anything that you like with pip without any risk that it will impact any of your other installations.</p>

<p>When you are finished exit the terminal session.  If you wish to go back to that environment, <em>with all of the libraries that you installed to it</em>, you can just activate it again.</p>

python osx pyobjc pyenv