When I'm trying to import rasterio in AWS Lambda I receive the following error:
Unable to import module 'lambda_function': No module named 'rasterio._base'
At first, I received the following error:
Unable to import module 'lambda_function': No module named 'rasterio'
So I tried to pip install the module, compressed it into a zip, and upload it as a layer(I did the same for the requests module and it worked just fine),
but now I'm getting:
Unable to import module 'lambda_function': No module named 'rasterio._base'
I've also tried:
Creating an empty virtual environment -> pip installing rasterio ->
compressing the module.
Installing different versions of rasterio
When I try to import rasterio._base through the CLI it works, but for some reason it fails to compile in the lambda.
Any suggestions?
use rasterio-lambda-layer - see https://github.com/addresscloud/rasterio-lambda-layer
Related
For my lambda function I need this library: https://github.com/explosion/tokenizations (Listed under pytokenizations on PyPi)
I've installed it with pip install --target ./package , zipped it and brought it to lambda, but when I run my function (the exact same code works fine on my machine) I get the following error: "Unable to import module 'main': No module named 'tokenizations'"
EDIT: The actual error is "Unable to import module 'main': No module named 'tokenizations.tokenizations'" Wouldn't the normal output be just one time tokenizations?
The other module I'm using through the /package folder is working just fine.
What could be possible causes for this?
I try to use JIRA library for Python in aws lambda. I create layer in lambda put in it the zip file that the contain the output of this command :
pip3 install -t /home/reham/projectes/jira/python jira
when I run code in lambda i get this error :
{
"errorMessage": "Unable to import module 'lambda_function'"
}
Function Logs
START RequestId: e348111f-e225-4af6-8fc6-8be9cd793464 Version: $LATEST
Unable to import module 'lambda_function': No module named 'jira'
try to use runtimes python3.6 and python3.7 but not work.
could please anyone help me?
After installing azure servicebus from pypl( azure-servicebus 7.3.4 ) using pip, i am trying those provided sample code from https://pypi.org/project/azure-servicebus/.
It gives error:
from azure.servicebus import ServiceBusClient
ImportError: cannot import name 'ServiceBusClient' from partially initialized module 'azure.servicebus' (most likely due to a circular import) (C:\python\lib\site-packages\azure\servicebus_init_.py)
I am using windows10.
other azure services like FaceAPI and CustomVision libraries are working fine.
Just this ServiceBus is throwing error.
I am new to azure in python. Any kind help of help is highly appreciable.
Make sure you don’t have any of your working .py file named like ServiceBusClient.py or ServiceBusMessage.py or azure_servicebus.py which can conflict with Python/ServiceBus package installed files.
If you are using Python 3.8.9, you can try installing the lower version of azure-servicbus as answered by Frank Gong
pip install azure-servicebus==7.0.0
You can refer to ImportError: cannot import name '...' from partially initialized module '...' (most likely due to a circular import), Circular Import Error while importing create_engine in Sqlalchemy, and ImportError: cannot import name 'ServiceBusClient' from 'azure.servicebus'
You can refer to the available Azure Service Bus libraries for Python
I was going through an Reinforcement Learning Course and wanted to try running the code locally. I installed RLGlue with pip install rlglue from here
But then when trying to run the code:
from rlglue.rl_glue import RLGlue
import main_agent
import ten_arm_env
import test_env
Received this error message:
ModuleNotFoundError: No module named 'rlglue.rl_glue'
Any idea on how to fix that to import the module?
I use this as work-around, add this file to your project.
https://gist.github.com/niektuytel/eab1117070454042b11e5e5c026dd3fb
I am trying import 'simplejson'module into in my pycharm project. It is throwing an error saying that import simplejson as json
ModuleNotFoundError: No module named 'simplejson'
I installed simple json in the terminal using pip3 install simplejson.
I have tried not renaming it as json but that didn't work.