Exception while importing pymorphy2

I've installed pymorphy2 using pip: Requirement already satisfied (use --upgrade to upgrade): pymorphy2 in /usr/local/lib/python2.7/site-packages Requirement already satisfied (use --upgrade to...

How to install Python 2.7 on Ubuntu 9.10

Now we're developing our software on the customer side, and there is: [email protected]:~$ cat /etc/lsb-release...

How to make Python Interactive Shell print cyrillic symbols?

I'm using Pymorphy2 in my project as a cyrillic morphological analyzer. But when I try to print out the list of words, I get this: >>> for t in terms: ... p = morph.parse(t) ... if 'VERB'...

Encoding php and python?

I wrote code that sends a query from php to a python script(some variable) and the python script does some things and returns some str. But this string is not valid! It has many question marks. I...

Can't install setuptools for pypy

There no file by path to custom distribute pip setup: http://python-distribute.org/distribute_setup.py That recommeded for installation. Setuptools prints the next error on linux debian: $ pypy...

PHP passthru: unable to get full response from python script

I'm trying to get data from Python script: import pymorphy2 import json import sys morph = pymorphy2.MorphAnalyzer() butyavka = morph.parse(sys.argv[1])[0] for item in...

Funnction saves the result from previus calls and uses it instead of an argument

You dont have to understand the whole code - the problem is in one line. Sorry for non-english words This is thе whole code: imports, arguments, function, function call, which works OK: import...

Divide sentences by their type(Interrogative/Affirmative)

I have a program that divides the text into sentences, then sentences to words, then сount number of parts of speech and write data to the csv file. The question is this: I need to divide...

Working with unicode in cython

I have a script, written in cython, which gets an array of C++ strings as input, feeds them to pymorphy2 analyzer and then processes the result. During build this script is being translated to C++...

Why SendNativeMessage says I try to send a 2 G byte message?

I try to send a message to a python3 program under Linux-Debian-Stretch-64 bits with Firefox56 Add-ons. With port.postMessage() function it works but I need to have asynchronous program so I use...

LSH and Sentence Similarity

Is it possible to use LSH Spark implementation Algorithm for finding Sentence Similarity? I have approximately 16k rows in my dataset, and this is approximately 16k16k=256000* number of different...

spacy - How to make POS tagger work for russian language?

In russian language the class variable tag_map is properly set, pymorphy2 provide detailed grammatical tags, but the following example doesn't work: import spacy nlp = spacy.load('ru') doc =...

Import error: No module named 'scipy._lib'

I'm using pythonanywere.com to deploy my Django application. So I've installed a few machine learning libraries to that virtual environment. (venv) 19:16 ~ $ pip3 list Package Version ...

How to apply class method correctly?

I describe a class that loads data from server into a dataframe and then processes it. Here is my code (not including importing libraries): class Save(Data): def __init__(self, server,...

KeyError: '[1 2] not in index' in Pandas

I'm trying to tokenize reviews (good and bad), but Pandas crashes with KeyError error: "[1 2] not in index". Here is my code: from nltk.tokenize import RegexpTokenizer from nltk.corpus import...

How to put all words from DataFrame in Normal form

I need to put all words from one column of DataFrame in normal form (by pymorphy2) ? For example i have : First Sec My Я вчера видел цветы красных цветов after it i...

Can not load language model in spacy

I have installed the russian language model but I can not load it. Installation: (tf2) C:\Windows\System32\spacy-ru>pip install git+https://github.com/buriy/spacy-ru Collecting...

cannot run pyinstaller executable of a flask server. ValueError: Can't find a dictionary for language 'ru'

I'm trying to put a simple flask server into executable by using pyinstaller -F server.py command When running the exe file, I obtain the following error: Traceback (most recent call last): File...

How to correctly install PyICU on Heroku?

I am trying to deploy my Python app on Heroku, but have been unsuccessful. It seems that a problem is occurring with the PyICU package, which I'm unsure how to correct. I've confirmed that this is...