mca*_*ado 8 python visual-studio-code python-poetry
我正在将 Poetry 与 VSCode 一起使用,并且在运行此命令时遇到错误
\nimport apache_beam as beam\nfrom apache_beam.options.pipeline_options import PipelineOptions\n\nwith beam.Pipeline(options=PipelineOptions()) as p:\n pass # build your pipeline here\nRun Code Online (Sandbox Code Playgroud)\n错误是
\nTraceback (most recent call last):\n File "/path/to/pipeline.py", line 2, in <module>\n import apache_beam as beam\nImportError: No module named apache_beam\nRun Code Online (Sandbox Code Playgroud)\n我的pyproject.toml是
[tool.poetry.dependencies]\npython = "^3.7"\npytest = "^5.4.3"\napache-beam = "^2.23.0"\nRun Code Online (Sandbox Code Playgroud)\n当我跑步时poetry install,我只得到这个
\xe2\x9e\x9c poetry install\nInstalling dependencies from lock file\n\nNo dependencies to install or update\nRun Code Online (Sandbox Code Playgroud)\n这让我认为apache-beam安装正确。
我使用 VSCode 并使用这些文章(第一部分、第二部分)作为设置 Poetry 的指南。
\n为了启动 VSCode,我运行了 ,poetry shell然后code .按照文章中的建议运行 。
可能有帮助的附加信息:
\n\xe2\x9e\x9c python --version\nPython 3.7.3\n\n\xe2\x9e\x9c which python\n/Users/miguel/Library/Caches/pypoetry/virtualenvs/python--p5kjR4W-py3.7/bin/python\nRun Code Online (Sandbox Code Playgroud)\n我不知道为什么这不起作用,并且已经花了几个小时在这上面,所以任何建议将不胜感激
\n编辑:
\n我根据这篇文章安装了python,我认为这可能会干扰Poetry创建的virtualenv
\n| 归档时间: |
|
| 查看次数: |
5498 次 |
| 最近记录: |