简体   繁体   English

在PyCharm上添加'import lettuce'时出错

[英]Error adding 'import lettuce' on PyCharm

I have a problem with Python and lettuce . 我有Python和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. 我已经在Python 2.7中安装了piplettuce ,我正在尝试为这些步骤创建.features文件和.py文件。 The problem is that when I put the line from lettuce import * I have an error that says: 问题是,当我from lettuce import *行中时from lettuce import *我有一个错误,上面写着:

"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? 有人可以帮我吗?

I just found the problem. 我刚发现了这个问题。 What I did, just in case anyone has the same problem is: 我做了什么,万一有人遇到同样的问题是:

In my PyCharm project: 在我的PyCharm项目中:

  • press Ctrl+Alt+s to open the settings 按Ctrl + Alt + s打开设置
  • on the left column, select Project Interpreter 在左侧列中,选择Project Interpreter
  • on the top right there is a list of python binaries found on your system, pick the right one 在右上角有一个系统中找到的python二进制文件列表,选择正确的
  • eventually click the + button to install additional python modules 最后单击+按钮安装其他python模块
  • validate 验证

在此输入图像描述

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! 希望这个有效!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM