ModuleNotFoundError: No module named 'gpxpy' - python-3.x

I'm running a Jupyter notebook with the lines:
import gpxpy
import gpxpy.gpx
and I'm getting:
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
/var/folders/kc/5p61t70n0llbn05934gj4r_w0000gn/T/ipykernel_37440/3640958118.py in <module>
----> 1 import gpxpy
2 import gpxpy.gpx
ModuleNotFoundError: No module named 'gpxpy'
FWIW, doing the following on the terminal command line (macOS 16.6.4)
$ pip3 search gpxpy
ERROR: XMLRPC request failed [code: -32500]
RuntimeError: PyPI's XMLRPC API is currently disabled due to unmanageable load and will be deprecated in the near future. See https://status.python.org/ for more information.
$
Don't know whether it's a conda environment problem or a problem with the gpxpy package itself.

I logged into anaconda.org, searched for module gpxpy and then did one of the recommended installs:
conda install -c conda-forge gpxpy
At least I got around the module load error.

Related

Pyinput is showing warning in code but showing error while running the code

Traceback (most recent call last):
File "C:\Users\encur\Python\os.py", line 5, in
from pynput.keyboard import Key, Controller
ModuleNotFoundError: No module named 'pynput'
The error states that you do not have pynput package installed.
To install pyinput, use the following command on your terminal/shell:
pip install pynput
Or refer to the pypi package page: https://pypi.org/project/pynput/

Why NO ModuleNotFoundError with conda?

Normally when I've done pip uninstall <module> if I then try to import the module I get a ModuleNotFoundError, for example:
dino#DINO:~$ python -c 'import mplfinance as mpf;print(mpf.__file__)'
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'mplfinance'
However, after activating a conda environment, the import works fine even when the package is unstalled both with pip uninstall and with conda remove, either way, I get:
dino#DINO:~$ python -c 'import mplfinance as mpf;print(mpf.__file__)'
None
Can anyone tell me why the import is NOT raising an exception, even though there is no module there to import??
This behavior (lack of import exception) appears to be related somehow to having activated a conda environment.

64bit MacOs After succesfully installing Pygame: ModuleNotFoundError: No module named 'pygame'

Python noob here. I've been trying to install pygame and pandas for a few hours now. Even with Conda I did not succeed. I have Python 3.8.5 installed.
I eventually tried through the terminal with these commands:
python -m pip install pygame==2.0.0.dev6
and
python -m pip install pandas
(this was a total guess by the way, but apparently it did something)
Results were succesfull:
Requirement already satisfied: pygame==2.0.0.dev6 in /opt/miniconda3/lib/python3.8/site-packages (2.0.0.dev6)
and
Successfully installed numpy-1.19.2 pandas-1.1.2 python-dateutil-2.8.1 pytz-2020.1
But, when I try to import either modules, I still get errors. Any ideas?
import pygame
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
import pygame
ModuleNotFoundError: No module named 'pygame'
import pandas
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
import pandas
ModuleNotFoundError: No module named 'pandas'
Do I need to move the modules to the script folder or something? Or what do I even move? Thanks!
Ok.. Got it thanks to #matt.. after succesfully installing pygame, find the environment in which pygame is installed by entering 'which python'.
In my case it returned:
/opt/miniconda3/bin/python
Now I needed to make sure the VS console was pointing at the same environment, by checking which python interpreter it was using and selecting the correct one. More info:
how to check and change environment in VS Code

ModuleNotFoundError: No module named 'cassandra'

After installing cassandra driver by running the command:
sudo pip3 install cassandra-driver, I am getting the error ModuleNotFoundError: No module named 'cassandra' when I try to import the module by running the line cassandra.
I then tried to see what all modules are installed in pip3 by running the command pip3 freeze:
astroid==2.1.0
cassandra-driver==3.16.0
isort==4.3.4
lazy-object-proxy==1.3.1
mccabe==0.6.1
pylint==2.2.2
six==1.12.0
wrapt==1.10.11
Seeing no cassandra, I tried to import the visible module: cassandra-driver and then I ended up with the error:
File "<stdin>", line 1
import cassandra-driver
^
SyntaxError: invalid syntax
Also, when I do correct the hyphen issue with this:
__import__("cassandra-driver"), I get the error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'cassandra-driver'
My which python3 is: /usr/local/bin/python3 and my which pip3 is: /usr/local/bin/pip3
My OS is MacOS
How to install cassandra?
Note: I am following this documentation.
Did you try to run these demos (from those docs)?
"If successful, you should be able to build and install the extension (just using setup.py build or setup.py install) and then use the libev event loop by doing the following:"
>>> from cassandra.io.libevreactor import LibevConnection
>>> from cassandra.cluster import Cluster
>>> cluster = Cluster()
>>> cluster.connection_class = LibevConnection
>>> session = cluster.connect()
There is a probability that actual module is named differently, e.g. there is another external package called Pillow, but you import it with name "PIL".
In docs they are importing from cassandra.cluster
Docs I'm referring to
$ echo 'import cassandra.cluster' > cassandra.py && python3 cassandra.py
Traceback (most recent call last):
File "./cassandra.py", line 3, in <module>
import cassandra
File "/home/xxx/cassandra.py", line 4, in <module>
import cassandra.cluster
ModuleNotFoundError: No module named 'cassandra.cluster'; 'cassandra' is not a package
Using a different filename, the error disappears:
echo 'import cassandra.cluster' > tmp.py && python3 cassandra.py
So, for me, the error was that my own program overrode the package. O.o

ImportError: No module named 'mutiprocessing'

I am trying to import 'multiprocessing' and using python 3.5.3 but its gives error
Traceback (most recent call last):
File "ssser.py", line 7, in <module>
import mutiprocessing
ImportError: No module named 'mutiprocessing'
when i try to install multiprocessing module then i again error occure
i am using following command for installation
python3 -m pip install multiprocessing
and got error
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-26ilgzih/multiprocessing/setup.py", line 94
print 'Macros:'
^
SyntaxError: Missing parentheses in call to 'print'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-26ilgzih/multiprocessing/
however when i import "import multiprocessing" in terminal then no error occure but when i used in my file "ssscr.py" then it gives error
i am using geany,and python3 (IDEL) on raspberry pi3
Can any body help me how i can fix this error ?
For others who faces Similar error like
ModuleNotFoundError: No module named 'multiprocessing';
would also occur if you name your python file as multiprocessing.(as it makes ambiguity between your program name and actual module name)
Just rename your file and it will work (if you have dependency installed).
Seems like you are installing multiprocessing in the python 2 version. Could you use pip3 to install the package?
pip3 install multiprocessing
Also use the following command to check which pip you are using
$ ls -l `which pip`
$ ls -l `which pip3`
And to see if the package got correctly installed or not use
$ pip show pip
$ pip3 show pip
Update:
multiprocessing is built-in after python2.6
OP did a typo. It should be
import multiprocessing in place of import mutiprocessing

Resources