Trying to grow up my productivity and organization on my computer I decided to follow the steps guided by Henrique Bastos (HB) in his article “The definitive guide to organizing my Python environment” (a free translation from the Portuguese, the article is in Portuguese!).
However, the guide of HB is for MacOS. That is no problem if you consider the distinctions of each Operational System. Well, I use the Linux Mint 18.2 Sonya with ZSH as an alternative of GNU BASH for personal reasons. I had problems when I installed the
pyenv-virtualenvwrapper. This article is about how I fixed this problem.
First, it is impossible to install
pyenv-virtualenvwrapper with the command line
sudo apt install pyenv, for example. To install these apps we need to do via Git, using:
curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash
This command line installs
pyenv-virtualenv. To install
pyenv-virtualenvwrapper we need to do:
git clone https://github.com/yyuu/pyenv-virtualenvwrapper.git ~/.pyenv/plugins/pyenv-virtualenvwrapper
After this change in the modus operandi in the guide of HB, I coming back to follow it. But, I had problems yet. Because I put the following code in the .zshrc (remember I use ZSH and not the BASCH, if I use BASH the file was .bashrc):
export WORKON_HOME=~/.ve export PROJECT_HOME=~/workspace eval "$(pyenv init -)" #pyenv virtualenvwrapper_lazy
However, merely don’t work! Well after a lot of research on the web I found the solution in the Github of pyenv itself. That we need to do is to put the code above (including the change we need to do in the last line, i. e., to remove the #) in the file called
.zshenv and not in the
After that, we need to install the dependencies (for Ubuntu and Linux Mint) if they are not installed. We do it as below as:
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev
Well, that’s now all works perfectly on my computer like the guide of HB tells us. Now it’s just to follow the others steps in the HB’s guide to finish the set up.