Answer the question
In order to leave comments, you need to log in
Python file won't open, how to fix?
Hello.
I need to run the Start.py file, but a bunch of errors creep out when I run it:
[email protected]:/var/www# sh Start.py
Start.py: 2: Start.py: import: not found
Start.py: 8: Start.py: if sys.platform.startswith('win'):
from twisted.internet import selectreactor
selectreactor.install()
else:
from twisted.internet import epollreactor
epollreactor.install(): not found
Start.py: 11: Start.py: Syntax error: "(" unexpected
Answer the question
In order to leave comments, you need to log in
The mystery, most likely, lies here:
Clearly a syntax error.
And if you have Win, it can also be covered here:
from: can't read /var/mail/twisted.internet
from: can't read /var/mail/datetime
I may be wrong, but:
If you look at the errors ...
Then the import may indeed fail due to the lack of a shibang, as Pavel wrote. If python 3 , then in theory the shibang will be #!/usr/bin/env python3. But judging by the print statement without brackets, this is the 2nd.
For Windows, you need to change the environment variables.
A few lines in triple quotes, in theory, do not carry a semantic load ...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question