Install a Python module from conda forge files


Levenshtein Module installation from CONDA FORGE files


 Since Python is getting popular from Datascientists,  one might have to deal with setting up non standarad python modules in a server with multiple python version,  


Background: 

 Default Python Version :2.6.6
 Conda Python version : 2.7
 Conda Virtual environment created with : 3.5

 now i need to setup Levenshtein package inside one of my virtual environments running in Pythonh 3.5




Step 1: Downloaded the source files of Levenshtein package for Python3.5(which is the default py version inside my Conda virtual env –test_venv)

Step 2:  Extracted the zip file inside the virtual environment, it extracted the required lib/ and site-packages files into the local lib folder
(test_venv) [user@host] ~/anaconda/envs/test_env]$ tar -xvjf python-levenshtein-0.12.0-py35_0.tar.bz2

Step 3: Ensure the package is listed as installed.

 (test_venv) [user@host: ~/anaconda/envs/test_venv]$ pip list installed







Also, here is a sample code I tried.

(test_venv) [user@host: ~/anaconda/envs/test_venv]$ python
Python 3.5.4 |Continuum Analytics, Inc.| (default, Aug 14 2017, 13:26:58)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import Levenshtein
>>> Levenshtein.ratio('hello world', 'hi world')
0.7368421052631579
>>> Levenshtein.ratio('hi', 'hey')
0.4
>>> 


Comments

  1. Thank you so much for this nice information. Hope so many people will get aware of this and useful as well. And please keep update like this.

    Big Data Services

    Data Lake Services

    Full Stack Development Services

    ReplyDelete

Post a Comment

Popular Posts