Using slow pure python sequencematcher install python levenshtein to remove this warning

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fuzzy install via pip in Conda environment, python-Levenshtein warning #75

Fuzzy install via pip in Conda environment, python-Levenshtein warning #75

Comments

I’m new to Conda, and just re-installed fuzzywuzzy using conda version of pip.
python-Levenshtein is also install according to conda.

I’m not sure what to do about this.

Читайте также:  What is javascript in html pdf

The text was updated successfully, but these errors were encountered:

Hi Jose thanks for responding.

Conda list -n py33 python-levenshtein

I didn’t try any other test to see if the levenshtein package is working.

from fuzzywuzzy import fuzz

C:\Users\dcuneo\AppData\Local\Continuum\Anaconda\envs\py33\lib\site- packages\fuzzywuzzy\fuzz.py:33: UserWarning: Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning
warnings.warn(‘Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning’)

It doesn’t sound like python-Levenshtein is in the path. Can you print out a list of modules available to you from within your package? Or tell me how you would import python-levenshtein?

Yesterday was my first day using Anaconda / Conda, so I’m confused how the paths work.
I thought that my path included python-levenshtein but clearly it is not.

If you have any advice I’m all ears. otherwise I’ll be researching this.

Thanks. I’ve figured out that Conda has it’s own pip which will integrate the conda and pip packages. I knew this, but I guess I didn’t install pip in the «root» conda environment.

Plus i’m doing all this on Windoze for now. I think I’ll get it working. thanks for your input.

Let me know how it should work so we can update docs or update the package 🙂

?yes, sorry I didn’t get back to you.

It was a matter of learning the Anaconda/pip environment.

Anaconda has it’s own pip that needs to be installed in Anaconda.

Then, one just does pip install python-leventsheim.

Getting the path set in windoze is annoying, and needs to be set manually.

In *nix, one just sources an activation script and the path is modified.

Data Scientist
W2O Group
60 Francisco Street, San Francisco, CA 94133
cell 415.871.1909 | work 415.658.9738?

From: Jose Diaz-Gonzalez notifications@github.com
Sent: Thursday, February 19, 2015 12:45 PM
To: seatgeek/fuzzywuzzy
Cc: Daniel Cuneo
Subject: Re: [fuzzywuzzy] Fuzzy install via pip in Conda environment, python-Levenshtein warning (#75)

Источник

How to fix getting error while using fuzzywuzzy: userwarning: using slow pure-python sequencematcher. install python-levenshtein to remove this warning?

The error «Getting error while using fuzzywuzzy: UserWarning: Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning?» occurs when you are using the fuzzywuzzy library in Python and the module is using the slow pure-Python SequenceMatcher instead of the faster C implementation provided by the python-Levenshtein library. To resolve this warning and improve performance, you need to install the python-Levenshtein library. Here are some methods to solve the issue:

Method 1: Installing python-Levenshtein library using pip

To install python-Levenshtein library using pip, follow these steps:

pip install python-Levenshtein
  1. Wait for the installation to complete.
  2. Once the installation is complete, you can now use the library without any warnings.

Here’s an example code using fuzzywuzzy and python-Levenshtein libraries:

from fuzzywuzzy import fuzz from Levenshtein import distance string1 = "apple" string2 = "appel" print(fuzz.ratio(string1, string2)) # Output: 80 print(distance(string1, string2)) # Output: 1

In the code above, we first imported the fuzz function from the fuzzywuzzy library and the distance function from the Levenshtein library. We then defined two strings, string1 and string2 , and used the fuzz.ratio() function to calculate the similarity ratio between the two strings. We also used the distance() function to calculate the Levenshtein distance between the two strings.

By installing the python-Levenshtein library using pip, we were able to use the optimized version of the distance() function and remove the warning message.

Method 2: Installing python-Levenshtein library using conda

To fix the «UserWarning: Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning?» error while using fuzzywuzzy in Python, you can install the python-Levenshtein library using conda. Follow these steps:

conda create --name myenv python=3.8
conda install -c conda-forge python-levenshtein
python -c "import Levenshtein"

Here is an example code using fuzzywuzzy and python-Levenshtein libraries:

from fuzzywuzzy import fuzz from Levenshtein import distance s1 = "apple" s2 = "appel" ratio = fuzz.ratio(s1, s2) print(ratio) # output: 91 lev_distance = distance(s1, s2) print(lev_distance) # output: 1

In this code, we compare two strings «apple» and «appel» using fuzzywuzzy and python-Levenshtein libraries. The output of fuzzywuzzy is the similarity ratio between two strings, which is 91. The output of python-Levenshtein is the Levenshtein distance between two strings, which is 1.

That’s it! Now you can use fuzzywuzzy without the warning message.

Method 3: Installing python-Levenshtein library using apt-get

To install the python-Levenshtein library using apt-get, follow these steps:

sudo apt-get install python-levenshtein
python -c "import Levenshtein"

If the library is installed correctly, you should see no error message.

from fuzzywuzzy import fuzz string1 = "apple" string2 = "appel" ratio = fuzz.ratio(string1, string2) print(ratio)

This code will print the similarity ratio between the two strings using the fuzzywuzzy library.

That’s it! You have successfully installed the python-Levenshtein library using apt-get and fixed the warning message while using fuzzywuzzy.

Источник

Делаю голосового помощника на Python, но возникает ошибка.

Текст ошибки:
Warning (from warnings module):
File «C:\Users\acer\AppData\Local\Programs\Python\Python39\lib\site-packages\fuzzywuzzy\fuzz.py», line 11
warnings.warn(‘Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning’)
UserWarning: Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning
Traceback (most recent call last):
File «C:\Users\acer\Desktop\Мария — голосовой ассистент\голосовой помощник Мария. py», line 85, in
speak_engine.setProperty(‘voice’, voices[4].id)
IndexError: list index out of range
Говорит, что надо скачать python-Levenshteun, но в Интернете непонятно, мол, устарело. Также ошибка с индексом — тоже смотрел и тоже непонятно. Как всё исправить?
Вот ссылка на облако — https://cloud.mail.ru/public/XKa9/HKz4ndfP3

Я поздравляю с просмотром кода от HowdyHo (или другого сайта где этот код скопировали). В видео объяснялось, что voices[4], это индекс голоса, который он качал через RHVoice. Если вам лень, то поставьте voices[0].

Насчёт python-Levensteun, можно просто забить, но я его скачал через pip, так что помочь не могу. Если ты без него никак, ищи неофициальные модули и качай оттуда.

Да. Откуда копировал . Видимо послушал случайно.. Спасибо большое! Я тоже пытался скачать через pip, но не получилось. Через неофициальные сайты тоже пытался – не получилось..

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UserWarning: Using slow pure-python SequenceMatcher #67

UserWarning: Using slow pure-python SequenceMatcher #67

Comments

C:\Python27\lib\site-packages\fuzzywuzzy\fuzz.py:33: UserWarning: Using slow pure-python SequenceMatcher warnings.warn('Using slow pure-python SequenceMatcher') 

The line of code I have for importing is from fuzzywuzzy import fuzz .

I’m running Python 2.7.8 on Windows 8, pip 1.5.6, and fuzzywuzzy 0.4.0.

The text was updated successfully, but these errors were encountered:

Ohh. Could we get a better warning?

pref warnings should be left to the docs and never passed during runtime.

What I consider to be a good example of this is BeautifulSoup. It supports lxml but won’t raise a warning if I choose a slower parser.

While I didn’t implement the warning, I am in favor of keeping it (or at least a better version).

At the very least it could say something like

Using slow pure-python SequenceMatcher. Try installing the «SequenceMatcher» package.»

EDIT: What’s the actual package name? And is there a way to disable this notification, besides manually building the library?

Was thrown off also by this warning. Installed python-Levenshtein and was able to import StringMatcher as SequenceMatcher per line 31 of fuzz.py.

@josegonzalez — Do you know where we can find the optional SequenceMatcher library for installation?

@josegonzalez — Thanks! That is exactly what I was looking for!

I´ve got the same problem and I wasn’t able to fix it, but finally I find a quick solution. It does’t fix that warning but at least is possible to execute and try it. So here is the solution that works for me:

As I have that warning in the prompt I went to the trace where I have the feature folder and I wrote: lettuce nameOfTheFeature.feature and that’s all. I still have that warning but at least I could try my tests.

Источник

Оцените статью