I need to write pure python code in redash how to install its modules
thanks
I have same issue, did you solve it?
no , still not solved
You install modules to Redash’s Python from the command line in Docker. Just SSH into your container and either run pip
or git clone
the code and run python setup.py install
as necessary.
What do you mean by writing “pure python code in redash”? Are you using the Python data source? Or do you have something else in mind?
Hello Team,
I’ve enabled python as a datasource in redash
I’m willing to import boto3 and query cloudwatch dashboards
hoping the results can be made compatible
Error running query: <type 'exceptions.Exception'> 'boto3' is not configured as a supported import module
I get above error even after mentioning boto3 as one of the Modules to import prior to running the script
How can I make boto3 work in the python Data Source
can AdditionalModulesPaths help me in this matter?
If so, any particular directory where I should install boto3 on the instance
Lot of questions I guess
Thank you
I’m researching this right now. To start with: here’s the code that runs the Python query runner. I’m inspecting it for clues. Going to see if I can reproduce your error.
Okay. So I have this up and working.
No errors. What issues specifically are you having? What code can I use to reproduce your issue?
You know that Redash already has a cloudwatch query runner, right? Docs are here.
boto3
is already installed if you pip install requirements_all_ds.txt
as seen here. So while you could install it separately, there’s no need to.
Hey @k4s1m ,
It worked now. I was trying to import both datetime and boto3.
Looks like multiple Modules cannot be imported
I also added cloudwatch data source as you suggested and tried running the query
Getting an error Error running query: 'datetime.datetime' object has no attribute 'timestamp'
I’m guessing this is the Python version error
v8.0 is using Py2.7 & v9 needs Py3 (timestamp support)
Could not find python in requirements.txt
How do I solve this issue
Thank you
Not true!
and
What do you mean you “tried running the query”. What query? Are you sure you used the correct data source? You haven’t given enough information to help debug.
How did you install Redash? If you use Docker this is not a concern.
Correct. requirements.txt
manages Python requirements. The version of Python itself will never appear there.