Блог пользователя shejibri

Автор shejibri, 5 лет назад, По-английски

How can I use Visualizer on my PC? When I just ran given python code(vis.py in line.zip), I had syntax error. There is a link: https://oj.uz/problem/view/IOI19_line

  • Проголосовать: нравится
  • +3
  • Проголосовать: не нравится

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

You have to run it in Python 3:

pip3 install matplotlib

python3 vis.py [ARGS]

  • »
    »
    5 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    I ran it in Python 3.9.1(64bit). Should this work?

    I had a syntax error because of "pip3 install matplotlib".

    • »
      »
      »
      5 лет назад, скрыть # ^ |
       
      Проголосовать: нравится 0 Проголосовать: не нравится

      I think you misunderstood something. pip is Python's package installer, so you should be able to use it in the terminal (cmd in windows) if it's installed correctly. Type pip3 install matplotlib in your terminal, not in your code file. If that says something like pip3 not found, try just pip install matplotlib. Since you are getting syntax error, python3 command probably works. So after installing the matplotlib package, just run the code with python3 vis.py [args] (note that this command should be run in the same directory as vis.py).