“invalid active developer path” when attempting to use pip3 after upgrading to macOS Catalina I am trying to run pip3 from Terminal and the following error shows up:

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun.

I have just upgraded my os to Catalina and have already tried:

xcode-select --install


which shows me:

Can't download the software because of a network problem


And:

sudo xcode-select --reset


which outputs nothing and when I run pip3 again, I get the same error. Is there anything else that could be done? Am I missing something here?
You are perfect in your thinking. The true error is your machine needs a valid, secured web connection back to Apple’s content delivery network and servers. See if you can download any app from the Mac App Store and then when that’s working, retry the install.

xcode-select --install


Apple generally requires you to allow outbound traffic to the 17.0.0.0 network range, so if you’re on a filtered network, consider using a VPN to get outside the restrictions or have networking open outbound ports for your device to rule that out as an error.

Once you’ve gotten a good install, the select command above will report that the developer tools are installed and to use Software Update to update them. Since you tagged your question Xcode you could install that as well and then run it - it will install the tools as well (including the xcrun tool which is the first item needed by pip3)