I am trying to use the FlightRadar24 API as described in this link:
https://pypi.org/project/FlightRadarAPI/#description
I have followed the steps as outlined, however, when trying to run the following simple script, I get an error saying "No Module named 'FlightRadar24':
from FlightRadar.api import FlightRadar24API
fr_api = FlightRadar24API()
However, I re-checked whether the module has been installed, which is true. I installed the module using pip3.
Anyone know how to solve?
When I check if the module has been installed, I get the following:
Requirement already satisfied: flightradar24 in /usr/local/lib/python3.9/site-packages (0.3.1)
Does it have to do with the fact that it is installed in python3.9? How would I get it installed to python 3.7 specifically using pip?
Related
I am trying to use bcolors in my python code in Spyder/Anaconda but it keeps telling me
ModuleNotFoundError: No module named 'bcolors'.
So I installed it with pip install bcolorswhich gave me Requirement already satisfied: bcolors in e:\anaconda3\lib\site-packages (1.0.4), but it still doesn't work.
What am I doing wrong?
You had that error because you are in different interpreter trying to import the module. You should append the path of the module to your working directory.
import sys
sys.path.append("\anaconda3\lib\site-packages")
import bcolors
Try to install lower version of this module
pip install bcolors==1.0.2
Have you tried installing the pandas' library using pip install pandas
I was having trouble with the latest distribution as well. Installing 1.0.2 worked for me.
I successfully installed the module geocoder:
Requirement already satisfied: chardet<5,>=3.0.2 in
c:\users\myname\appdata\roaming\python\python39\site-packages (from
requests->geocoder) (4.0.0) Installing collected packages: ratelim,
geocoder Successfully installed geocoder-1.38.1 ratelim-0.1.6
When I try to create a Python file that includes import geocoder, I get the error Import "geocoder" could not be resolved.
The relevant path is included in sys.path:
C:\Users\myname\Downloads
C:\Users\myname\AppData\Local\Programs\Python\Python39\python39.zip
C:\Users\myname\AppData\Local\Programs\Python\Python39\DLLs
C:\Users\myname\AppData\Local\Programs\Python\Python39\lib
C:\Users\myname\AppData\Local\Programs\Python\Python39
C:\Users\myname\AppData\Roaming\Python\Python39\site-packages
C:\Users\myname\AppData\Roaming\Python\Python39\site-packages\win32
C:\Users\myname\AppData\Roaming\Python\Python39\site-packages\win32\lib
C:\Users\myname\AppData\Roaming\Python\Python39\site-packages\Pythonwin
C:\Users\myname\AppData\Local\Programs\Python\Python39\lib\site-packages
C:\Users\myname\AppData\Local\Programs\Python\Python39\lib\site-packages\win32
C:\Users\myname\AppData\Local\Programs\Python\Python39\lib\site-packages\win32\lib
C:\Users\myname\AppData\Local\Programs\Python\Python39\lib\site-packages\Pythonwin
Why isn't Python able to resolve this module?
Thanks
Either geocoder is installed to other than Python3.9 version installation (e.g. python 3.7) or geocoder is not in the path of your python module.
Try to install the library using specific Python pip package manager (e.g. pip3.9) and run the module you develop using specific Python version (e.g. Python3.9)
I'm getting this type of error when installing the library.
Not for all packages, but only for some. Is it because pip version? or Because of python interpreter?
Plz guide me what should I do.
You don't need to install this package because it's already in the standard library.
Just import time in any Python file.
I am trying to follow this tutorial: https://runawayhorse001.github.io/LearningApacheSpark/textmining.html
I have loaded my data into a PySpark DataFrame, however when I get to the preprocessing step, I receive the error, "ModuleNotFoundError: No module named 'preproc'" I can't find any information online about what to pip install in order to be able to use the preproc module.
!pip install preproc within a Jupyter notebook returns, "Defaulting to user installation because normal site-packages is not writeable
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
ERROR: Could not find a version that satisfies the requirement preproc (from versions: none)
ERROR: No matching distribution found for preproc"
python -m pip install preproc within cmd returns, "ERROR: Could not find a version that satisfies the requirement preproc (from versions: none)
ERROR: No matching distribution found for preproc"
How do I proceed finding the correct package to install?
Emailed the tutorial creator and will post his response for anyone who needs help in the future.
"The preproc module is designed for the preprocessing functions, such as check_blanns, check_lang, remove_features etc. If you include those functions explicitly, you do not need to import the preproc module."
The used functions are defined previously:
https://runawayhorse001.github.io/LearningApacheSpark/textmining.html#text-preprocessing
You can use them directly like check_lang_udf = udf(check_lang, StringType()).
Or alternatively, save these functions into a python file as preproc.py.
I am working on a raspberry pi python project and every time I import a package I get the same error ModuleNotFoundError: No module named ''. for example I am trying to add the ambient_api package
I followed the steps in their set up:
pip install ambient_api
Added the imports at the top of my file:
from ambient_api.ambientapi import AmbientAPI
api = AmbientAPI()
but I am getting the error:
ModuleNotFoundError: No module named 'ambient_api'
This is happening with all the imports I am trying to add and I cant figure out what I am missing.
when I was looking on google I came across __init__.py might be a solution but I am not sure how this works?
edit:
here is what was output when I installed:
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: ambient_api in /home/pi/.local/lib/python2.7/site-packages (1.5.2)
Requirement already satisfied: requests in /usr/lib/python2.7/dist-packages (from ambient_api) (2.21.0)
Requirement already satisfied: urllib3 in /usr/lib/python2.7/dist-packages (from ambient_api) (1.24.1)
version in my terminal:
pi#raspberrypi:~/Raspberry-Pi-Greenhouse $ python --version
Python 2.7.16
but it looks like the version in the shell in the ide when I run the program is saying:
Python 3.7.3 (/usr/bin/python3)
As explained by #JaFizz in Pytorch is installed but do not working ubuntu 18.04 it solved by giving an alias and installing correctly to desired python version (there were two pythons installed on the same machine)
First it was necessary to specify the location of the python, example:
alias python=/usr/local/bin/python3.6
Then install it:
python pip install <package name>