I'm using Poetry with VSCode and I'm running into an error when running this
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
The error is
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
My pyproject.toml is
[tool.poetry.dependencies]
python = "^3.7"
pytest = "^5.4.3"
apache-beam = "^2.23.0"
When I run poetry install, I only get this
➜ poetry install
Installing dependencies from lock file
No dependencies to install or update
which makes me think apache-beam was correctly installed.
I'm on VSCode and used these articles (part I, part II) as guide to set-up Poetry.
To start VSCode, I ran poetry shell and then code ., as suggested in the article.
Additional info which may help:
➜ python --version
Python 3.7.3
➜ which python
/Users/miguel/Library/Caches/pypoetry/virtualenvs/python--p5kjR4W-py3.7/bin/python
I have no idea why this is not working and have spent a couple hours on this so any suggestions would be greatly appreciated
EDIT:
I installed python according to this article, which I think might interfere with the virtualenv created by Poetry