I was originally encoded in the python IDE on windows. Now that I have pasted my code into a file on a Linux server. Now when I run the script, it gives me this error:
bad interpreter: no such file or directory
Tell us how to solve this error.
Perhaps you have \r\n line endings, where \r is the carriage return and \n is the newline character
\r\n
\r
\n
This means that the first line could be like this:
#!/usr/bin/env python\r\n
or
#!/usr/bin/python\r\n
so the shell is trying to run the python\r command
python\r
You are probably using the hashbang #!python convention, which is inexplicably popular among Windows users. Linux expects the full path. Use #!/usr/bin/python instead or (preferably) #!/usr/bin/env python .
#!python
#!/usr/bin/python
#!/usr/bin/env python