I downloaded Visual Studio Code and installed Python following the instructions at https://code.visualstudio.com/docs/python/python-tutorial.
As I chose the Python extension in Visual Studio Code, an installation started, but it told me afterwards that the system install is not supported. Therefore I installed it with Homebrew.
First of all, I seem do not have the green 'run'-button displayed in the installation tutorial above. There I only can run code with right click and 'Run Selection/Line in Python Terminal'.
A simple print('Hello, World!') seems to run properly, but when I try to run a program with more than one line (i.e., more than one instruction) I get multiple error messages that I did not get while using Anaconda before.
For context: I am currently learning to program using Python and follow the book 'Automate the boring stuff with Python'.
The code I try to run is:
#! python3
# mclip.py - A multi-clipboard program.
TEXT = {'agree': """Yes, I agree. That sounds fine to me.""",
'busy': """Sorry, can we do this later this week or next week?""", 'upsell': """Would you consider making this a monthly donation?"""}
import sys, pyperclip
if len(sys.argv) < 2:
print('Usage: py mclip.py [keyphrase] - copy phrase text')
sys.exit()
keyphrase = sys.argv[1] # first command line arg is the keyphrase
if keyphrase in TEXT:
pyperclip.copy(TEXT[keyphrase])
print('Text for ' + keyphrase + ' copied to clipboard.')
else:
print('There is no text for ' + keyphrase)
For clarification:
Traceback (most recent call last): File "/Users/XXX/Desktop/Python Projects/Ex.py", line 7, in <module> import sys, pyperclip ModuleNotFoundError: No module named 'pyperclip'
is the error I get.
I just want to use Visual Studio Code properly and I am really not sure why it isn't working or what I did wrong while installing it. (For example, why am I missing the green 'run'-button?!)
I get multiple error messages—Such as...?