Currently I am working on stack overflow tag predictor where I am using fasttext.
I install fasttext when I am running the line :
import fastText as fasttext
from fastText import train_supervised
I get the error
ImportError Traceback (most recent call last)
<ipython-input-176-72aec327c85a> in <module>
----> 1 from fastText import train_supervised
ImportError: cannot import name 'train_supervised' from 'fastText' (unknown location)
Can someone help me please.
I think fastText should be spelled as from fasttext import train_supervised.
This might help -https://github.com/facebookresearch/fastText/blob/master/python/doc/examples/train_supervised.py
Related
pip install happiestfuntokenizing
After installing the above we get an error on this import function
from happyfuntokenizing import Tokenizer as potts
ModuleNotFoundError
Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_7944/3774479977.py in <module>
----> 1 from happyfuntokenizing import Tokenizer as potts
ModuleNotFoundError: No module named 'happyfuntokenizing'
I tried looking for the solution but could not find one here....
However try using this and it will work
from happiestfuntokenizing.happiestfuntokenizing import Tokenizer as potts
-Cheers
from happiestfuntokenizing.happiestfuntokenizing import Tokenizer as potts
I have created a python package called psmpy and I am struggling to import it back into my python library to check it's usage.
When I run, from psmpy import PsmPy I am getting the error:
ModuleNotFoundError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_12528/438942766.py in <module>
----> 1 from psmpy import PsmPy
ModuleNotFoundError: No module named 'psmpy'
But the module is up on pypi.org and I can see it installed when I run pip list in the list of current packages installed. Your help is greatly appreciated.
I am currently starting Deep Learning with Keras. After I create a new Python file on Jupyter Notebook, I import Keras, only to find an error to appear. The error only occurs while importing Keras (As far as I know) and there is no error when I am importing other libraries such as numpy and pandas. Please help me fix this issue.
I have tried updating tensorflow, updating keras, using some code from other answers on Stack Overflow, but all was unsuccessful. I am currently trying "conda install -c conda-forge tensorflow=1.12.0", but it is taking quite some time to run.
from keras.models import Sequential
from keras.layers import Dense
import numpy
Using TensorFlow backend.
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
RuntimeError: module compiled against API version 0xc but this version of numpy is 0xb
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
ImportError: numpy.core.multiarray failed to import
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
ImportError: numpy.core.umath failed to import
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
ImportError: numpy.core.umath failed to import
I was trying to use PunktWordTokenizer and it was occurred an error as below.
from nltk.tokenize.punkt import PunktWordTokenizer
And this gave the following error message.
Traceback (most recent call last): File "file", line 5, in <module>
from nltk.tokenize.punkt import PunktWordTokenizer ImportError: cannot import name PunktWordTokenizer
I've checked that nltk is installed and that PunkWordTokenzer is also installed using nltk.download(). Need some help for this.
PunktWordTokenizer was previously exposed to user but not any more. You can rather use WordPunctTokenizer.
from nltk.tokenize import WordPunctTokenizer
WordPunctTokenizer().tokenize(“text to tokenize”)
The difference is :
PunktWordTokenizer splits on punctuation, but keeps it with the word. Where as WordPunctTokenizer splits all punctuations into separate tokens.
For example, given Input: This’s a test
PunktWordTokenizer: [‘This’, “‘s”, ‘a’, ‘test’]
WordPunctTokenizer: [‘This’, “‘”, ‘s’, ‘a’, ‘test’]
There appears to be a regression related to PunktWordTokenizer in 3.0.2. The issue was not present in 3.0.1, rolling back to that version or earlier fixes the issue.
>>> import nltk
>>> nltk.__version__
'3.0.2'
>>> from nltk.tokenize import PunktWordTokenizer
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name PunktWordTokenizer
For solving this Try pip install -U nltk to upgrade your NLTK version.
Using windows 10
I've install textblob using "py -m pip install textblob".
I can import textblob, or from textblob import blob,word
But i cant: from textblobl import Textblob.
The error i get is:
Traceback (most recent call last):
File "", line 1, in
from textblob import Textblob
ImportError: cannot import name 'Textblob'
Thanks.
You can try whit this:
from textblob import TextBlob
you can try change your file name TextBlob.py