The solution of unresolved reference in pychar

Just installed pychar, try to feel very good, I think this can calm down to experiment flash project. As a result, I typed the code according to the tutorial. Pychar always prompted me with “unresolved reference” in red. I was very depressed. It was clear that the code could run correctly. How could this kind of error occur

Red error prompt looked really upset, so I went to Baidu online for a circle, but I didn’t find a solution. Later, I saw someone encounter the same problem on stackoverflow, and successfully solved the problem according to the given method

In fact, it’s very simple. Right click on the directory, select mark directory as sources root, and add your project directory to sources root

Then, in the settings, check add source roots to pythonpath to add sources root to pythonpath

After the change of apply, there is no error prompt. Look

PS: when you use a template, you will also be prompted that you can’t find the template file. In fact, the code can run correctly. That’s why you set it in pychar. Here, you can also find the option of adding directory as template in the settings, and you can also set it to jinja2

Reference: unresolved reference issue in pycharm

Similar Posts: