I am trying pip commands. I am installing OpenAI Gym. I wrote the following command in a notebook cell and run it: pip install gym
It worked and gave me a message of successful installation.
But when I tryed typing the same command in a .py
script file and run it, it gives me an error:
pip install gym
^
SyntaxError: invalid syntax
I know that I already have the gym package installed on my machine since the successful execution in notebook. However, I think it should give me different message that it is already installed or updated like when I rerun the command again in notebook cell:
Requirement already satisfied: gym in c:\users\osama\anaconda3\lib\site-packages (0.20.0)
Requirement already satisfied: numpy>=1.18.0 in c:\users\osama\anaconda3\lib\site-packages (from gym) (1.20.3)
Requirement already satisfied: cloudpickle>=1.2.0 in c:\users\osama\anaconda3\lib\site-packages (from gym) (1.6.0)
Note: you may need to restart the kernel to use updated packages.
I just need to understand !