如何解决诗上的ImportError但已安装模块
我正在将诗歌与VSCode一起使用,并且在运行此代码时遇到了错误
no debugging symbols
错误是
import apache_beam as beam
from apache_beam.options.pipeline_options import PipelineOptions
with beam.Pipeline(options=PipelineOptions()) as p:
pass # build your pipeline here
我的Traceback (most recent call last):
File "/path/to/pipeline.py",line 2,in <module>
import apache_beam as beam
ImportError: No module named apache_beam
是
pyproject.toml
当我运行[tool.poetry.dependencies]
python = "^3.7"
pytest = "^5.4.3"
apache-beam = "^2.23.0"
时,我只会得到这个
poetry install
这使我认为➜ poetry install
Installing dependencies from lock file
No dependencies to install or update
已正确安装。
我正在使用VSCode,并使用这些文章(part I,part II)作为设置诗歌的指南。
要启动VSCode,我先运行了apache-beam
,然后运行了poetry shell
,如本文所建议。
可能有帮助的其他信息:
code .
我不知道为什么这不起作用,并且花了几个小时来解决,所以任何建议都将不胜感激?
编辑:
我根据this文章安装了python,我认为这可能会干扰Poetry创建的virtualenv
解决方法
除了VSCode之外,我不知道要使用哪个Python环境,我将手动检查是否已通过pip安装了Beam或查看venv本身中的软件包。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。