Following this official TF Guide: https://www.tensorflow.org/lite/guide/python
Tried this method as well: https://github.com/tensorflow/examples/tree/master/lite/examples/image_classification/raspberry_pi
However, I am stuck with the error ImportError: No module named tflite_runtime.interpreter.
In my py file I have
import tflite_runtime.interpreter as tflite.
Hardware: Raspberry Pi Zero 2 W
https://pypi.org/project/tflite-runtime was updated recently.
I think the following just work.
$ pip3 install tflite-runtime
Solution
pip3 install tflite-runtime
followed by
sudo apt-get install libatlas-base-dev
To avoid error: Traceback (most recent call last): File "/home/pi/.local/lib/python3.7/site-packages/numpy/core/__init__.py", line 22, in <module> from . import multiarray
Related
So, this was my first time making a python package. I tried and tested and got it to work. This meaning that pip install . didn't complain and that
$sudo python3
>>>from LEDController import prettyLight
>>>prettyLight().light('whatsapp',100)
provided expected output and actions in my LED matrix.
Also pip list includes LEDControllerm but as soon as I start python3 anywhere but in the LEDController package directory, the module is not being found.
Running pip install /path/to/LEDController/ is still successfull, as is pip3 install /path/to/LEDController/.
Yet I get
$sudo python3
>>> import LEDController
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'LEDController'
>>> from LEDController import prettyLight
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'LEDController'
What am I missing?
As #sinoroc said, installing only using pip is not the safest option. Instead using python3 -m pip install /path/to/module fixed the issue perfectly.
I'll put his link here so future viewers can read up on why this is.
I installed python3 in my macOS through brew, I installed opencv and numpy, when I import cv2 and numpy I have this error
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
Traceback (most recent call last):
File "001.py", line 2, in <module>
import cv2
File "/usr/local/lib/python3.7/site-packages/cv2/__init__.py", line 89, in <module>
bootstrap()
File "/usr/local/lib/python3.7/site-packages/cv2/__init__.py", line 79, in bootstrap
import cv2
ImportError: numpy.core.multiarray failed to import
I fix the problem in this way:
I installed opencv using brew
brew install opencv
I installed opencv for python
pip install opencv-python
I removed (bad) numpy library
sudo rm -rf /usr/local/lib/python3.7/site-packages/numpy
I linked numpy library with working library
sudo ln -s /usr/local/Cellar/numpy/1.17.1/lib/python3.7/site-packages/numpy /usr/local/lib/python3.7/site-packages/numpy
I have installed numpy on ubuntu. it works fine on terminal but when i want to import it to my working directory its shows me this error
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'numpy'
Try this:
sudo pip install numpy
Also this
sudo pip install spyder (numpy is included)
or
sudo easy_install numpy
I am unable to execute following
from PIL import Image
it returns me following:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "...\Anaconda3\lib\site-packages\PIL\Image.py", line 56, in <
module>
from . import _imaging as core
ImportError: DLL load failed: The specified module could not be found.
Currnetly using PIL version installed on anaconda 4.2.1. How to resolve this issue?
First, you can try:
conda update --all
If it doesn't help, this solution works for many people:
conda uninstall pillow
pip install pillow
Source: https://github.com/python-pillow/Pillow/issues/2945
I used 'sudo apt-get install rake'.
>>> import rake
but Fails with error
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named rake
Why this happened?I'm missing something.
Ok, I got answer.
$ git clone https://github.com/zelandiya/RAKE-tutorial
$ cd RAKE-tutorial/
:~/RAKE-tutorial$ python
>>> import rake
I guess you want to use this https://github.com/aneesha/RAKE .
Install using
pip install python-rake
In code
import RAKE