P
P
pixal2015-10-17 21:56:59
Python
pixal, 2015-10-17 21:56:59

I run a python script and it throws an error. Everything is fine on the computer, how to fix it?

[email protected]:/py# ./vk.py
./vk.py: line 1: import: command not found
./vk.py: line 2: $'\r': command not found
./vk.py: line 3: $'\r': command not found
./vk.py: line 4: from: command not found
./vk.py: line 5: $'\r': command not found
./vk.py: line 8: syntax error near unexpected token `('
./vk.py: line 8: `response = urllib.request.urlopen(' https://api.vk.com/method/video.get?owner_id=84627. .. '+access_token)
'
[email protected]:/py# 

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Valery Ryaboshapko, 2015-10-17
@valerium

Either run as
Or write sha-bang, i.e. in the very first line
If the script is written for the third version of python, in both cases replace python with python3.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question