Search code examples
aerospikepython-3.6

newbie installing aerospike client to both my python versions


I just followed the instructions on the site and installed aerospike (on linux mint). I'm able to import the aerospike python client module from python 2.7 but not from 3.6 (newly installed). I'm thinking that I need to add the directory to my "python path" perhaps??, but having difficulty understanding how this works. I want to be able to run aerospike and matplotlib in 3.6.


Solution

  • You should use pyenv to allow yourself to have multiple versions of Python locally, each with their own pip repo. This allows you to switch easily between versions (similar to RVM for Ruby, NVM for Node.js).

    For example:

    pyenv install -l
    
    pyenv shell 2.7.10 && pyenv local 2.7.10 && pyenv global 2.7.10 && pyenv rehash
    pip install aerospike
    
    pyenv shell 3.4.3 && pyenv local 3.4.3 && pyenv global 3.4.3 && pyenv rehash
    pip install aerospike