Jinja2 incompatible - google-cloud-platform

I'm trying to install dbt into GCP cloud shell, but always receive this message error:
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
flask 2.1.1 requires Jinja2>=3.0, but you have jinja2 2.11.3 which is incompatible.
I resetting cloud shell and remove Jinja using sudo pip3 uninstall Jinja2, after install dbt pip3 install dbt-bigquery. But it shows the same message.

Related

AWS Boto3 Compatibility Issue, How can I install an older version of Boto3?

I'm trying to deploy my Django project to AWS Elastic Beanstalk.
The tutorial I am following is suggesting I use Boto3 to link up my S3 Database.
The problem is when I am installing Boto3 i am getting this message in red.
awsebcli 3.20.3 requires botocore<1.24.0,>1.23.41, but you have botocore 1.27.7 which is incompatible.
So I'm trying to install the older version of Botocore, 1.24.0 or 1.23.41, but after looking at PyPi I can't seem to find it since it just says use pip3 install boto3.
Any suggestions?
Try the following:
pip install boto3==1.21.21
pip install botocore==1.24.21
I had the same problem:
If you already installed boto3 then do these:
pip uninstall boto3
pip uninstall botocore
pip uninstall s3transfer
then do these:
pip install botocore==1.23.54
pip install boto3==1.20.54
Hope this helps!
The best way to fix this is to use python virtual environments.
The AWS EB CLI is pegged to a very specific version of botocore and they don't update it very often. As a result, you don't want it to be in the mix for your project dependencies because it will make it hard for you to install other libraries (like modern versions of boto3).
A general setup that you can use is the following:
Install awsebcli globally (you only need it for its scripts)
Make a virtual environment for your project
Install all of your project dependencies in the virtual env; do not install awsebcli in the virtual env
If this doesn't work (such as you have other things you need to install globally with conflicting subdependenceis), you should install awsebcli in its own virtual env and have aliases to activate it, but that gets really messy.

ModuleNotFoundError: No module named 'awscli' after Mac os update

awscli does not work after Mac os update.
while running a bash script got following error:
File "/usr/local/bin/aws", line 19, in <module>
import awscli.clidriver
ModuleNotFoundError: No module named 'awscli'
Tried:
pip3 install awscli --upgrade --user
While installing awscli got following warning and error:
WARNING: Ignoring invalid distribution -oto3 (/Users/myaccount/.pyenv/versions/3.6.9/lib/python3.6/site-packages)
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
boto3 1.10.16 requires botocore<1.14.0,>=1.13.16, but you have botocore 1.24.15 which is incompatible.
boto3 1.10.16 requires s3transfer<0.3.0,>=0.2.0, but you have s3transfer 0.5.2 which is incompatible.
aiobotocore 1.3.3 requires botocore<1.20.107,>=1.20.106, but you have botocore 1.24.15 which is incompatible.
uninstall botocore and reinstall it, still get above warning and error.
Take a look of pip3
which pip3
/Users/myaccount/.pyenv/shims/pip3
What might cause this problem?
Personally, I'd consider using brew to install the awscli, not pip. You (probably) only want one awscli installed, but you potentially have multiple installations of Python, including the stock Mac OS-provided Python.
The awscli now comes with its own binaries so doesn't need an external Python installation anyway.
If you need boto3 or, less frequently, botocore then install those using your pip of choice.

Is there any other option to connect to snowflake

0 I'm a newbie to snowflake and trying to connect to the db using python but when executing the code i get this error "snowflake.connector.errors.ProgrammingError: 251005: Password is empty"
Pre steps: Install Snowflake Python connector using pip command or conda installer
are easiest as the package is installed along with dependent packages.
pip command: pip install snowflake-connector-python
conda installer command: conda install -c conda-forge snowflake-connector-python
Refer Snowflake official documentation for more details
https://docs.snowflake.com/en/user-guide/python-connector-install.html
Setting Snowflake Session Parameters -
https://docs.snowflake.com/en/user-guide/python-connector-example.html
Above link can be referred for supplying Passwords to the Python program using different ways.

How important is PyYAML when deploying in google app engine with Django?

Recently I tried to deploy my django app in google app engine (standard environment - Python version 3.7 - Django version 2.0.3) but I found a problem.
As a previous step to do the deploy I run:
pip freeze > requirements.txt
But at the time of deploy this error was generated:
Error message: `pip_download_wheels` had stderr output:
Failed building wheel for PyYAML
ERROR: Failed to build one or more wheels
error: `pip_download_wheels` returned code: 1.
When I realized that the error was due to PyYAML I tried to modify the version in the requirements.txt file, but it didn't work.
As last step I opted to remove PyYAML from my requirements.txt file and in this case it worked. The application is deployed and working.
However my question is: Is there a problem with having deployed without including PyYAML in the requirements.txt?
For those who might be interested, the answer is this:
Google app Engine (standard environment) does not allow to install PyYaml since by default it has it installed:
https://cloud.google.com/appengine/docs/standard/python/refdocs/
Therefore there is no problem with not add PyYaml in the requirements.txt
PD: it seems that the library PyYaml is added to requirements.txt file due to the fact that pip is recognizing the yaml file in the folders and determines that it is necessary for the application to work correctly.

Downloading and importing Google Cloud Python

I'm on their github page: https://github.com/GoogleCloudPlatform/google-cloud-python
Their first command is pip install --upgrade google-cloud
this gives me:
Collecting google-cloud
Could not find a version that satisfies the requirement google-cloud (from versions: )
No matching distribution found for google-cloud
I downloaded their SDK and which installed their google cloud SDK and I did gcloud init, but I can't seem to have their python library imported into mine. Starting python and typing:
from google.cloud import datastore
gives me an error that it doesn't exist as a module... This is all from their github so I'm not sure what I'm doing wrong
The issue is that the team is trying to transition from gcloud to google-cloud which is still somewhere incomplete.
All you need to do is install gcloud using pip and you should be fine.
Pro Tip: python -m pip install --upgrade gcloud using this command will install it for your python version.
First, make sure you have installed gcloud on your system then run the commands like this:
First: gcloud components update in your terminal.
then: pip install google-cloud
And for the import error:
I had a similar problem. Adding "--ignore-installed" to my pip command made it work for me.
This might be a bug in pip - see this page for more details: https://github.com/pypa/pip/issues/2751