File “D:\Python310\lib\site.py“, line 93 print(message, file=sys.stderr) SyntaxError: invalid syntax

tags: python  Development language  

python3 png_wh_1.py 02-pNG picture height .png .PNG

File "D:\Python310\lib\site.py", line 93 print(message, file=sys.stderr) SyntaxError: invalid syntax

This error appears in the error caused by the site.py of Python3 calling python3. At present, there are still a lot of agricultural installations in the early Python2 installation package.

At the same time, Python2 and Python3 are installed, and

Python2 can copy a piece of python.exe and pythonw.exe in the folder, and then rename it python2.exe and pythonw2.exe.

Python3 can copy a portion of python.exe and pythonw.exe in the folder, and then rename it Python3.exe and Pythonw3.exe.

Check the related versions of python through python -v, python2 -v, python3 -v, you can see the default python2.7

C: \ Users \ KAI \ Desktop \ MISC Example \ MISC Example \ 01- Pictures Hidden> Python -V
Python 2.7.14

 C: \ Users \ KAI \ Desktop \ MISC Example \ MISC Example Questions \ 01- Pictures Hidden> Python2 -V
Python 2.7.14

 C: \ Users \ KAI \ Desktop \ MISC Example \ MISC Example \ 01- Pictures Hidden> Python3 -V
Python 3.10.4
C: \ Users \ KAI \ Desktop \ MISC Example \ MISC Example \ 01- Image Writing> Python PNG_WH.PY C: \ Users \ Kai \ Desktop \ MISC Example \ Misc Example \ 02-PNG Picture Width height .png
  File "D:\Python310\lib\site.py", line 93
    print(message, file=sys.stderr)
                       ^
 Syntaxerror: Invalid Syntac: \ Users \ Kai \ Desktop \ MISC Example \ MISC Example \ 01- Image Writing> Python2 PNG_WH_1.py 02-PNG Picture High .png.
  File "D:\Python310\lib\site.py", line 93
    print(message, file=sys.stderr)

 C: \ Users \ KAI \ Desktop \ MISC Example \ MISC Example \ 01- Pictures Hidden> Python3 PNG_WH_1.py 02-PNG Picture High .png
[*] width  = 0x2cc
[*] height = 0x2d6

python3 png_wh_1.py 02-pNG picture height .png executes normal

python2 png_wh_1.py 02-pNG picture height .png execution failed

Intelligent Recommendation

[Django] error: file "manage.py", line 17) from eXC ^ SyntaxError: Invalid Syntax

Problem Description Django 3.1.4 When using the MySQL database, when data migration, error: Solution will python Change topython3 Python3 Management.py Makemigrations APP Name Results of the:...

Mac prompts File "manage.py", line 14) from eXC ^ SyntaxError: Invalid Syntax error reasons and solutions

Problem Install Django on the Mac and upload the project, when performing Python Management.py RunServer, an error is wrong, an error is as follows: The reason is because I use PIP3 installed Django (...

Django error File "manage) from eXC ^ SyntaxError: Invalid SYNTAX

Django error: This problem occurs because there is no use of the virtual environment to run this project. the solution: Run this project after entering the virtual environment.s...

Solution: File "C:\Python351\lib\site.py", line 419, in register_readline

Enter the corresponding history.py file, such as E:\Anaconda\Lib\site-packages\pyreadline\lineeditor, and modify line 82 as follows.  ...

Use python pip to install the tool package: requests File "<stdin>", line 1 pip install xxx ^ SyntaxError: invalid syntax appears

The homework assigned by the teacher needs to be done with python. I finally completed the installation of python. There were still problems when importing the required requests package. I found a lot...

More Recommendation

Abnormal 04: Run the Django project time report error: file "manage.py", line 16) from exc ^ syntaxerror: invalid syntax

When running the Django project, the following error appears: wrong reason: The error caused by the Python version cannot be executed with the Python2.x command. Python3 must be used to execute the ab...

SyntaxError: Non-ASCII character ‘\xe6‘ in file compile_pyc.py on line 93, but no encoding declared

Problem description When running the Python script, report the error message below Cause analysis: If you want to write Chinese in Python2's PY file, you must add a row of notes to the file encoding, ...

Solve SyntaxError: invalid syntax

This error is due to the fact that print in python3 becomes a method that requires parentheses as arguments to pass in values. Today's study of tensorflow has been experiencing this error. What is fru...

Python----SyntaxError: invalid syntax

There was such an error when I was running a ready-made program on github today.SyntaxError: invalid syntax. Remind that there are illegal statements, oh! According to the error prompt, I found that I...

Python-SyntaxError: invalid syntax

Error:  SyntaxError: invalid syntax Where? Python code to run when an error   Way? Python def class if elif for while other statements without adding at the end: the key symbol   W...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top