Configure the python environment in eclipse and run

First, configure the python environment

  • eclipse
  • python interpreter

1. Click [Preferences] in [Window] in the upper left corner of eclipse;

 

2. Click [PyDev] - [Interpreters] - [Python Interpreter] in turn. If there is a python interpreter locally, eclipse will automatically load it. If not, click [New with Pipenv] to manually import the python interpreter.

2. Create a python project and run it

1. Click [Other] in [File] in the upper left corner of eclipse;

2. Find [Pydev Project] and click [Next];

 3. Enter the project name, and select the interpreter, [Finish];

 4. Build a test py;

 

5. Run.

3. Possible problems

File "C:\eclipse abc\opencv\com\test.py", line 2
SyntaxError: Non-UTF-8 code starting with '\xc4' in file C:\eclipse abc\opencv\com\test.py on line 3, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

 Solution:

1. Select the project and open 【Properties】;

2. Modify the character encoding to [UTF-8];

3. The problem is solved and the operation is successful.

Guess you like

Origin blog.csdn.net/weixin_49851451/article/details/126485923