ModuleNotFoundError for 'modin' even though it is installed by poetry - python-poetry

On import modin.pandas as modin_pd line I get ModuleNotFoundError: No module named 'modin'. I am using poetry & JupyterLab. If in the cell I type !poetry add modin, I get ValueError saying Package modin is already present.
So it cannot install modin because it is already installed but it cannot import it either. Any obvious solution that I am missing?
pip freeze command also shows modin to be installed. I also tried to install it via pip install but absolutely nothing let me to import this module in the end.

The problem may be this one KeyError: CPU
It can be solved by using pip install psutil

Related

Can't get imports that are seen in "pip list"to be recognized in pycharm

I'm trying to get pyttsx3 to work in pycharm. I did a "pip3 install pyttsx3". "pip3 list" shows it to be available. I get the following when I try to run the module in pycharm:
from pywiktionary import WiktionaryParserFactory
ModuleNotFoundError: No module named 'pywiktionary'
It does the same thing for pyttsx3. Installs under pip, but get the same "ModuleNotFoundError: No module named 'pyttsx3'.
It's like they exist at one place for pip and another place for pycharm. I even uninstalled/installed pycharm. What defines where the python modules are put in the system?

MoviePy Not Properly Installed (Linux Mint 20)

I have run pip3 install moviepy simply to get the software installed. However I am unable to use it.
On a second run of pip I get:
Requirement already satisfied: moviepy in /usr/local/lib/python3.8/dist-packages (1.0.3)
but I have no access to the attributes of moviepy. When I run dir(moviepy) I only get:
['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '__version__', 'version']
Have I done something wrong here, or is this to do with anything else I may have installed?
According to the docs you need to import the package like this:
from moviepy.editor import *
pip install moviepy installs the latest stable version from PyPI, currently it's 1.0.3. __init__.py for the version is mostly empty, it doesn't import anything interesting. That what you see.
You need to import a subpackage and run dir() on it:
import moviepy.video
print(dir(moviepy.video))

Python3.7: No module named

I've been trying to install matplotlib and textblob on my system using
pip3 install matplotlib
or
pip3 install textblob
It says it's installed successfully. However, when I try to import in in Sublime Text it says
ModuleNotFoundError: No module named 'matplotlib'
or
ModuleNotFoundError: No module named 'textblob'
I've set up the build system in sublime text for python 3. A lot of modules that I've installed and are using the same way works fine (BeautifulSoup, requests and tweepy for example). I do not understand why some modules work and others do not. I've been trying to find the solution to this problem but after hours of research without results, I see this question as my last resort. Very thankful for all help.
shell_cmd: /usr/bin/env python3

ImportError: No module named googlemaps

I've installed this package via pip27 on macports. My OS is OSX El Capitan 10.11.6. My python install is 2.7.10.
I'm trying to run an example script that imports googlemaps module, but I keep getting that ImportError. I have a feeling that it's how pip installed it and the reason why python can't find it, but I'm relatively new to pip so I don't know where to start investigating.
I also tried googling for a fix but no dice. Any idea what's happening here?
Here's my code:
import googlemaps # can't import
import argparse
from datetime import datetime
# collect args for lat, long, # of addresses, radius of search
parser = argparse.ArgumentParser(description='Randomize addresses on Google Maps')
parser.add_argument('-lt', '--latitude')
parser.add_argument('-lng', '--longitude')
parser.add_argument('-n', '--count')
parser.add_argument('-r', '--radius')
args = parser.parse_args()
print('Results: ', vars(args))
Error message:
Traceback (most recent call last):
File "randomize_addresses.py", line 1, in <module>
import googlemaps
ImportError: No module named googlemaps
Found a fix. I uninstalled googlemaps via pip and then reinstalled using easy_install. Apparently OSX doesn't like pip.
Looks like you used pre-installed python since you mentioned version 2.7.10 (default version shipped with macOS) which is located at /usr/bin/.
MacPorts installs binaries and libraries under /opt/local. Try to install python via MacPorts and run the program again. Python and pip should both be linked so that packages installed via pip is available to python.
In this case packages installed using pip27 would be available to python27 installed via MacPorts and not /usr/bin/python.
Another way would be to download get-pip.py and install it against /usr/bin/python (pip installation guide).
Note: Make sure you are using python installed via MacPorts. To check this run which python, it should show something like /opt/local/bin/python2.7

IPython.parallel.Client() not working

There is no problem when I import IPython.parallel -->import IPython.parallel
However, when I try this:
rc=IPython.parallel.Client()
I get the following error:
/home/mycomputer/local/lib/python2.7/site-packages/IPython/utils/shimmodule.pyc in __getattr__(self, key)
90 return import_item(name)
91 except ImportError:
---> 92 raise AttributeError(key)
AttributeError: Client
Does anyone know the solution to this?
[I am using Ubuntu 14.04]
It might be a problem with IPython 4.0's shim. IPython.parallel has moved to a new package, ipyparallel, so if you are using 4.0:
import ipyparallel
rc = ipyparallel.Client()
It's possible that the failure is that you don't have ipyparallel, and you are getting an unfortunately uninformative failure instead of a nice, useful error message. In that case:
pip install --upgrade ipyparallel
(or conda install, depending on your Python packaging of choice).

Resources