That's because sudo == root, you == pi.
You did --user on pip install so it installed on user pi not system or root.
If you want to keep the --user run sudo pip install or su pip and then do normal pip install, or just don't use --user and install it on system, system is always better.
It is far from clear what you have connected, what OS, what code you are actually using or how you installed modules.
No module named 'serial' means the code won't compile because you haven't installed it.
Normally you would install with sudo apt install python3-serial.
Even if you fix the code it won't work as /dev/ttyAMA0 is connected to Bluetooth on most ...
I see the partition is already resized, all you have to do is to run resize2fs /dev/mmcblk0p2 as root. This should be done on a mounted partition, unmounting / on a running system is a sure way to crash it.
If resize2fs fails to grow the partition even as root, it's typically because you have errors on it which need to be fixed with fsck. If this is the case,...
There are literally dozens of approaches; the most conventional is using dd although probably not for Windows.
SD Card Copier copies on the Pi itself and automatically adjusts size.
Various options are discussed.
The procedure I use (which is fast and efficient) Backup image of SD Card makes a small installable image, but takes more setup. (I use this to ...
You are using an old OS (soon to be obsolete) which appears to be installed over NOOBS. (Or wait a month for Bullseye to be released.)
You are probably also using an old SD Card.
Do a fresh install on a new SD Card.
It spent a lot of time looking at the image contents and all kinds of errors related to the header pins being shorted, modifying cmdline.txt and config.txt and more...
In the end the error turned out to be the way I was generating the image. Since my SD card is 32GB and I definitely don't want a 32GB image, I did some calculation to extract just about what ...