"No module named boto3" - python

Running on a Raspberry Pi 3 Model B V1.2, trying to get a python script to run that will upload files to AWS S3 buckets so I can pull them down from elsewhere later after running it through rekognition.
However, when I try to run the python script outside of the development environment I get
Traceback (most recent call last):
File "/home/pi/file.py", line 2, in <module>
import boto3
ModuleNotFoundError: No module named "boto3"
I've spent about 2 hours finding a resolution, including using commands like pip install boto3 and python -m pip install --user boto3
I'm unsure of what fixes I can do at this point.
EDIT: It seems like its not installing boto3 to the device, any fixes for this?

Related

Adobe pdf services sdk

I am trying to run this project from github, https://github.com/adobe/pdfservices-extract-python-sdk-samples
i downloaded the project.
got the credentials
ran the pdfservices-extract-sdk==1.0.0b1 api and dependencies
now i am trying to call the program extract_txt_from_pdf.py to convert pdf to document, i got the following error
Traceback (most recent call last):
File "extract_txt_from_pdf.py", line 35, in
from adobe.pdfservices.operation.auth.credentials import Credentials
ModuleNotFoundError: No module named 'adobe'
Thanks in advance for your help.
As I found, you will need to pre-install the below module separately to properly install pdfservices-sdk module in your system.
FYI: Minimum requirement is python 3.6 as of today
pip3 install Sphinx
Cheers!
Per the instructions here, you need to:
Extract the downloaded samples .zip.
From the samples root directory, run pip install -r requirements.txt.
Test the sample code on the command line.

Google Colab, module not found when running python script

I have a Colab notebook open and have my files cloned from a github repo. I want to run a python script called models.py. In this file, I am using pandas. When I run this line in Colab:
!python3 models.py
I get the following error:
Traceback (most recent call last):
File "models.py", line 1, in <module>
import pandas as pd
ModuleNotFoundError: No module named 'pandas'
However, if I run in a cell on Google Colab:
!pip3 list
I find that pandas is indeed installed:
pandas 0.25.3
My assumption is that when I run the script, it is not able to see the libraries I have installed but I am unsure how to fix this issue.
If I run:
!which python3
I get:
/usr/local/bin/python3
The python file I am trying to run is under:
/content/my_project/models.py
Should I instead take a different approach to running this file?
Instead of
!python3 models.py
You can use
%run models.py
In a clean Colab runtime, the location of python 3 is different than what you show in your question:
!which python3
# /usr/bin/python3
It looks like you are installing another Python instance in your VM. To ensure you're using Colab's bundled Python 3 executable, try using
!/usr/bin/python3 models.py
If you actually want to use the new python instance you've installed, you'll have to also install whatever packages you need. For example
!/usr/local/bin/python3 -m pip install pandas

Windows can't find localstack

I have some trouble to start and run localstack. I can install localstack relatively easy with "pip install localstack". This worked for me without problems. After the installation I tried to start localstack with "localstack start" but then windows tells me it can't find localstack.
The command "localstack" is either misspelled or could not be found.
I searched a lot and found out there are some similar problems. In one issue I found something that could eventually work for me. In this question. Because I never worked with python this is a little bit confusing for me. I tried this answer. I switched into the python scripts folder and run the command "py localstack start". Here it is interesting, that I get an error again, but this time windows recognizes localstack.
This here is the error
Traceback (most recent call last):
File "localstack", line 31, in <module>
from localstack.utils import cli
File "c:\users\gion rubitschung\appdata\local\programs\python\python37\lib\site-packages\localstack\utils\cli.py", line 4, in <module>
from localstack.services import infra
File "c:\users\gion rubitschung\appdata\local\programs\python\python37\lib\site-packages\localstack\services\infra.py", line 20, in <module>
from localstack.utils import common, persistence
File "c:\users\gion rubitschung\appdata\local\programs\python\python37\lib\site-packages\localstack\utils\common.py", line 5, in <module>
import pty
File "c:\users\gion rubitschung\appdata\local\programs\python\python37\lib\pty.py", line 11, in <module>
import tty
File "c:\users\gion rubitschung\appdata\local\programs\python\python37\lib\tty.py", line 5, in <module>
from termios import *
ModuleNotFoundError: No module named 'termios'
How can I start localstack just by typing "localstack start"?
Install the 0.9.0 version with:
python -m pip install localstack==0.9.0
(First you have to uninstall the latest one.)
From localstack's issues.
You can install it directly from the Commandeer App. It uses docker under the hood.
Another way to install Localstack on Windows is by using Docker. Here are the steps:
Install Docker. Instructions given in the post below:
https://softwaredevelopercentral.blogspot.com/p/blog-page_1.html
Pull the latest LocalStack Docker Image using the command below:
$ docker pull localstack/localstack
Start LocalStack using the command below:
$ docker run --rm -p 4566:4566 -p 4571:4571 localstack/localstack
All these instructions are mentioned in the blog post below:
https://softwaredevelopercentral.blogspot.com/p/how-to-install-localstack-on-windows.html

"ModuleNotFoundError : No module named 'apiclient ' "

I recently tried to view Google Calendar using python . To do that I referred Python Quickstart. I did the steps that were mentioned in the website.
I completed the second step and downloaded the secretclient.json file.
In the terminal I typed in :
pip install --upgrade google-api-python-client
as I was instructed in the website.
I ran the python that was on the website and when I compiled I got the error:
Blockquote
Traceback (most recent call last):
File "quickstart.py", line 2, in
from apiclient import discovery
ModuleNotFoundError: No module named 'apiclient'
The Lines which correspond to the error are :
from apiclient import discovery
Why is the apiclient module unavailable ?
Could it be that you're using a different python version than what the pip installed? For example, if you use python3 to execute the problematic import line, but pip is for python2. Or if you use conda or another python distribution that uses a different path to import the packages from.
You can verify it if you just open from the command line:
python
then
from apiclient import discovery
and check if you still get the error.
you can resolve this by going to Script folder of your Python installation directory and running from there
e.g.
cd D:\Python27\Scripts\
python
from apiclient import discovery
Mainly this issue arises when u have more than one python installation , as noob have suggested

Python script can't find pymongo module - Mac

so I was trying to run a python code, but the shell kept telling me that no 'pymongo' module was found.
Now, I have python 3.5.1 installed.
when I run pip freeze | grep pymongo it returns pymongo == 3.2.2 so it's clearly installed. I tried to run pymongo from the shell rather than a script but I get the same error every time.
import pymongo
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named 'pymongo'
So, help? It worked fine a month ago or so..
It means PyMonogo module is not installed for your Python 3. In the shell you can check the installed modules for your python.
import pip
pip.get_installed_distributions()
Check if pymongo is listed there. You have to install pymongo for python 3.

Categories

Resources