How to Fix a Python Workflow Error related to Pip Install and Directory Permissions?

This topic was automatically generated from Slack. You can find the original thread here.

Hello folks,
I have a Python workflow that is suddenly buggy. Anyone encountered this error and would have a solution ?
Command failed: python3 -m pip install --target=/tmp/__pdg__/dist/python -r requirements.txt --upgrade
WARNING: The directory '/home/sbx_user1051/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
error: subprocess-exited-with-error
Many thanks

Hey , was there a recent change in the Python packages used in the workflow?

The only ones I suspect to be buggy are:
from google.ads.googleads.client import GoogleAdsClient
from google.ads.googleads.errors import GoogleAdsException

Here’s the full list just in case:
# pipedream add-package google-ads
import os
import requests
import json
import hashlib
from datetime import datetime, timedelta
from collections import defaultdict
from fuzzywuzzy import fuzz
from google.ads.googleads.client import GoogleAdsClient
from google.ads.googleads.errors import GoogleAdsException

Thanks, since you’ve updated the workflow, the Python version changed in our environment to 3.12

I think this is what caused the googleads package to fail importing

I’ll try to add the package directly to our environment and get back to you

Ah yes, it must be that, thanks!

Let me know when it’s fixed!

For sure, in the meantime could you do me a favor and create a new issue here: Sign in to GitHub · GitHub

Done

Hey ,
Any update ?

Kind up

Thanks for bumping this, had some issues getting this package in the environment and hope to get this sorted out in the next few days!

Hey , so I figured out that the error was related to some dependency versions conflicts. I was able to load the Google Ads packages by using these import statements:

# pipedream add-package protobuf==4.25.3
# pipedream add-package pyyaml==6.0.1
# pipedream add-package google-ads==24.1.0
import os
import requests
import json
import hashlib
from datetime import datetime, timedelta
from collections import defaultdict
from fuzzywuzzy import fuzz
from google.ads.googleads.client import GoogleAdsClient
from google.ads.googleads.errors import GoogleAdsException

Hey ,
Thanks a lot, it works for me now !
Would be nice for Pipedream to raise a precise error message indicating where is the problem when failing to install the packages.

Agreed, had to dig in to find that out. I know there are some limitations on what pip throws as errors though