ModuleNotFoundError: No module named 'Sastrawi' - text

I've been looking for a solution to this problem, they said just install Sastrawi module with pip install Sastrawi , but after I installed the module, the error still doesn't go away.
what do i need to do?

I want to answer my own problem
So, for the problem I've had, I previously installed the literary library on the laptop's CMD.... I should have installed it in jupyter itself, not on the laptop's CMD.

Related

ModuleNotFoundError: No module named '<module.name>' - Installation error

I am building a desktop app using Python and PySimpleGUI. So far, everything works just fine. Whilst I was working at the project, I realized I need to find a way to get the duration of some mp3 files and to display it in a certain way. I discovered mutagen module that is supposed to help me in this sense, I installed, and here the problem arise:
It throws me ModuleNotFoundError: No module named 'mutagen'.
Seeing this, I started to look for the problem, but I couldn't not understand why my interpretor did not find the module even though I Installed it CORRECTLY. (as PyCharm told me)
I have tried the following:
I am using a local virtual environment that has installed the dependecies for the project(and some extra) and I uninstalled and installed the package 3-4 times
I deleted the local virtual environment and I created another one. I installed the packages again and same issue.
I installed a random module (scipy) and I tried to import it somewhere in the project and it thrown me same error, but this time for scipy module
My guess is that I did not configured properly my interpreter, but to be honest, I have no idea what I am doing wrong, because I followed the same steps I've been using for creating a venv with its according interpreter and for other projects, it worked just fine.
Further details:
Using python3.9 base .exe
I installed the packages in two ways: one using the pycharm IDE, and one by running pip3 install mutagen
You may be using a different pip that is not the one that affects the Python you are using. Instead of using
pip install mutagen
Consider using pip as a module of the Python you are using:
python -m pip install mutagen
This way you'll be sure you are working on the same Python.
If you want to continue using plain pip, try which python and which pip to make sure they are referencing the same environment.

Problem with "import rarfile" in python on Ubuntu

Today I turned on my Ubuntu virtual machine and tried to do a project in Python 3.9.4,
but this one used rarfile module. Which is throwing errors.
I know rarfile uses unrar, and I installed both rarfile and unrar.
Tried to type unrar seperately and it works.
I almost spent whole day trying to figure this out.
My question is why does importing rarfile module not work, and how can I fix it.
I also read online it could have something to do with PATH, but I am pretty new to linux and don't know terminology of it and therefore don't know how to try to fix it.
Some information regarding that would probably help if not now, for the future problems regardless if it is connected to this problem or not.
Sorry if I formatted this post poorly, it's my 2nd post on here.
I would do pip install rarfile to make sure it is install
also you may want to do a pip list to make sure its intalled.
Also if python 2 is install then most likly you need to do pip3 install rarfile.

ModuleNotFoundError: No module named 'astor'

I have been trying to run the Mask R-CNN demo from matter plot (https://github.com/matterport/Mask_RCNN). It works with tensorflow version 1.13.1 and keras 2.1.0 as suggested by someone here (https://github.com/matterport/Mask_RCNN/issues/1797). I get the error
ModuleNotFoundError: No module named 'astor'
The thing is astor 0.8.0 is installed in my virtual env but when trying to import it, it say it does not exist. I have made sure to install it normally as well as sudo. If you think it does exist on $PYTHONPATH, how can I do it. I am out of my depth here, so please be considerate.
EDIT: I am using virtualenv in pyCharm. If I look through my interpreter paths, I get
file:///home/$SUER/anaconda3/lib/python3.6
file:///home/$USER/anaconda3/lib/python3.6/lib-dynload
file:///home/$USER/project/Mask_RCNN/venv/lib/python3.6/site-packages
file:///home/$USER/anaconda3/lib/python3.6/site-packages
I have replace my actual user name with $USER in the above output.
Thanks to #bigbounty, but his questions made me understand a bit more about PYTHONPATH. Maybe something that I already should have known but you make mistakes and learn.
SOLUTION: in the venv interpreter paths I added
/home/$USER/anaconda3/pkgs/astor-0.8.0-py36_0/lib/python3.6/site-packages
and it worked. I do not know why the package was installed in this folder where apparently it was not included.
i solve copyng the astor folder from site-package (in env) to my project folder and set is as source( in pycharm)

ModuleNotFoundError when installing packages

I've been having a problem with installing packages in PyCharm. This started happening a few months ago, but before that it was fine. I can install it from the cmd using pip, but when I try to import it into the IDE it gives this error:
ModuleNotFoundError: No module named '_winreg'
and isn't available for use. The package I'm trying to install right now is pygame, but it has had trouble with other ones. I tried to make sure I have winreg installed by using 'pip3 install winreg' in the cmd, but it gives error text saying, "Could not find a version that satisfies the requirement winreg." What am I doing wrong?
Also, if it helps, I'm using Windows and the latest version of PyCharm, as well as python 3. Thanks for the help, I've been looking for a while now.
I think one of your problems possibly is that you didn't add pygame in your project interpreter. (To add it go to File -> Settings -> Project Interpreter then click the green plus sign and search for pygame.) I don't know if this will work for winreg, but tell me if it does.
I can't find _winreg anywhere, I've searched winreg's file, and modules , there don't seems like any of _winreg. I think you probably want to import winreg, not _winreg.
And also, if you are using PyCharm's venv, you need to use the project's prompt to import,or project interpreter.
Could not find a version that satisfies the requirement sometime means your python's version is too new for the module to use.

Install python3-tk on pythonanywere

I tried to run a script using turtle module on pythonanywere.com, however, got stuck at an error that cannot find the module named "tkinter" and I need to install python3-tk package. I followed this tutorial installing new modules on pythonanywhere in attempt to install the package in Bash console on pythonanywere.com by running pip3.5 install --user package3-tk.
However, I got the error that "could not find the version that satisfies the requirement package3-tk".
I also tried to replace the package name with tkinter with no luck either.
You can't use the tkinter module from a server such as pythonanywhere. It needs to have a connection to a display and not just a browser window.
https://www.pythonanywhere.com/forums/topic/360/
Just learnt the lesson of finding answer by asking question in different way. My purpose is to use turtle module on pythonanywere, which is not possible as explained in the answer above. However, I just found out that pythonanywhere has an affiliate website that is free and supports turtle (www.trinker.io)

Resources