Thank you for the replies.
I managed to uninstall Python 3.10 from the Mac and although pip doesn't work pip3 does. It kind of did before I uninstalled 3.10 but "pip3 list" was empty. Now it's full. I think that thing is going to be on eBay soon! No more coding on the Macbook.
Back to Linux though... I don't seem to have Python2 installed and in VSCode I only have the option for 3.6.15. Both "pip -V" and "pip3 -V" return "pip 20.0.2 from /usr/lib/python3.6/site-packages/pip (python 3.6)". Does this mean it doesn't matter which one I use or is there a difference?
I still don't understand virtual environments though. I'm going through all these motions now because I've recently reinstalled my OS so I'm using a clean slate and I hate blasting lots of install code into the terminal until something works. I like to keep my OS as lean as possible.
An example of why I'm confused... I wrote some code that uses tkcalendar. It wouldn't run because I don't have the module installed. "pip install tkcalendar" and then it worked. I then uninstalled tkcalendar and it didn't work, obviously. I then setup a virtual environment in the directory my .py file is in, activated the environment and installed tkcalendar again. ...fired up VSCode, ran the code and "ModuleNotFoundError: No module named 'ttkthemes'". So I still don't understand how they work.
How do you make use of the environment?
Also, if I get my head around how to use modules installed in an environment I guess installing different versions of Python will work the same?
Sorry for the elementary questions! I just glazed over this stuff when it popped up in a book I was reading but I'm beginning to realise it's important!
EDIT: Got it! The virtual environment is selectible in VSCode. Sorry!
I managed to uninstall Python 3.10 from the Mac and although pip doesn't work pip3 does. It kind of did before I uninstalled 3.10 but "pip3 list" was empty. Now it's full. I think that thing is going to be on eBay soon! No more coding on the Macbook.
Back to Linux though... I don't seem to have Python2 installed and in VSCode I only have the option for 3.6.15. Both "pip -V" and "pip3 -V" return "pip 20.0.2 from /usr/lib/python3.6/site-packages/pip (python 3.6)". Does this mean it doesn't matter which one I use or is there a difference?
I still don't understand virtual environments though. I'm going through all these motions now because I've recently reinstalled my OS so I'm using a clean slate and I hate blasting lots of install code into the terminal until something works. I like to keep my OS as lean as possible.
An example of why I'm confused... I wrote some code that uses tkcalendar. It wouldn't run because I don't have the module installed. "pip install tkcalendar" and then it worked. I then uninstalled tkcalendar and it didn't work, obviously. I then setup a virtual environment in the directory my .py file is in, activated the environment and installed tkcalendar again. ...fired up VSCode, ran the code and "ModuleNotFoundError: No module named 'ttkthemes'". So I still don't understand how they work.
How do you make use of the environment?
Also, if I get my head around how to use modules installed in an environment I guess installing different versions of Python will work the same?
Sorry for the elementary questions! I just glazed over this stuff when it popped up in a book I was reading but I'm beginning to realise it's important!
EDIT: Got it! The virtual environment is selectible in VSCode. Sorry!