在PyCharm上添加'import lettuce'时出错(Error adding 'import lettuce' on PyCharm)

我有Python和lettuce的问题。

我已经在Python 2.7中安装了pip和lettuce ,我正在尝试为这些步骤创建.features文件和.py文件。 问题是当我from lettuce import *行中时from lettuce import *我有一个错误说:

“未解决的参考莴苣...”然后: “此检查检测到应该解决的名称但不会。由于动态调度和鸭子打字,这在有限但有用的情况下是可能的。顶层和类 -比实例项更好地支持级别项“

我真的不知道如何解决这个问题。 有人可以帮我吗?

I have a problem with Python and lettuce.

I already install the pip and lettuce in Python 2.7, and I'm trying to create a .features file and a .py file for the steps. The problem is that when I put the line from lettuce import * I have an error that says:

"Unresolved reference lettuce..." and then: "this inspection detects names that should resolved but don't. Due to dynamic dispatch and duck typing, this is possible in a limited but useful number of cases. Top-level and class-level items are supported better than instance items".

I really don´t know how to fix this problem. Can anyone can help me please?

最满意答案

我刚发现了这个问题。 我做了什么,万一有人遇到同样的问题是:

在我的PyCharm项目中:

按Ctrl + Alt + s打开设置 在左侧列中,选择Project Interpreter 在右上角有一个在你的系统上找到的python二进制文件列表,选择正确的 最后单击+按钮安装其他python模块 验证

在此处输入图像描述

万一你无法添加其他模块(也发生在我身上),你可以更改项目解释器。

希望这个有效!

I just found the problem. What I did, just in case anyone has the same problem is:

In my PyCharm project:

press Ctrl+Alt+s to open the settings on the left column, select Project Interpreter on the top right there is a list of python binaries found on your system, pick the right one eventually click the + button to install additional python modules validate

enter image description here

Just in case you are not able to add an other module (that happened to me as well) you can change the project interpreter.

Hope this works!

更多推荐