Python 3.5 is pre-installed in Raspbian Stretch, the recommended operating system that's been out for 18 months. I assume as you're talking about "upgrading" Python to 3.5 that you are on Raspbian Jessie, which comes with 3.4.
Rather than download and build Python yourself, you would be better off using a Python provided by and supported by the distribution (i.e. from apt).
You have two options:
- Download Raspbian Stretch and write it to an SD card (or re-write your current SD card)
- Upgrade your Raspbian Jessie system to Stretch by editing
/etc/apt/sources.list and replacing
stretch and running
apt update and
Either way, you'll end up with a working, supported, stable Python 3.5.
If you are using another operating system, you should say so in your question. If that's the case, either you have a reason to, or you don't. If you don't, I advise option 1.