error: anonymous function at /nix/store/iffdwx6q15hf9nvgq821mci3n50czfq6-nixpkgs/nixpkgs/pkgs/development/python-modules/apache-beam/default.nix:1:1 called with unexpected argument 'gcp'
What am I doing wrong, and how could I have better troubleshooted this issue?
Ah, I thought it was something that all Python packages would have, since it was in the packaging docs.
But now, looking at the commit history of nixpkgs, I can see numerous commits that add optional-dependencies to Python packages explicitly, for example:
However, looking at these examples, the packages that they’re passing through are other python3x Nix packages, which implies that the gcp package itself would need to exist, and I can’t see one called gcp in nixpkgs.
So, some progress on understanding, if not solution! Thanks.
Taking that gcp section of the map, and adding it directly in, I get a successful result!
{ pkgs ? import <nixpkgs> {} }:
let
python-with-packages = pkgs.python39.withPackages(ps: with ps; [
# [gcp] optionals.
cachetools
google-apitools
google-auth
google-auth-httplib2
google-cloud-datastore
google-cloud-pubsub
# google-cloud-pubsublite - Not found
google-cloud-bigquery
google-cloud-bigquery-storage
google-cloud-core
google-cloud-bigtable
google-cloud-spanner
google-cloud-dlp
google-cloud-language
google-cloud-videointelligence
google-cloud-vision
# google-cloud-recommendations-ai - Not found
# End of [gcp] section.
google-cloud-storage
apache-beam
grpcio
]);
in pkgs.mkShell {
nativeBuildInputs = [
pkgs.gcc-unwrapped.lib
pkgs.poetry
python-with-packages
];
}
Running nix-shell I was able to get into a shell that contained Python etc.
Running my Beam job with python3 ./wordcount.py resulted in success, once I’d adjusted the wordcount.py example to write to a directory on my computer that exists.