I'm using pylance to check my Python code. It tells me
Import "astor" could not be resolved
When I switch to the terminal within VS Code:
I'm pretty certain that the issue is that it uses another environment. I'm using pyenv by default and I would like if vscode would use the same environment. But at the very least I need to be able to access the environment it is using to install packages.
Interestingly, the status bar seems to show something else, because in that environment I have astor installed:
/usr/local/Cellar/[email protected]/3.8.5/Frameworks/Python.framework/Versions/3.8/bin/python3.8 /Users/miguel-trejo/.vscode/extensions/ms-python.python-2020.9.111407/pythonFiles/pyvsc-run-isolated.py pip install -U astor --user
, I've saw thatpyvsc-run-isolated.py
uses runpy to execute the current python script and I think that theCellar
folder is specifying the interpreter that vscode is using. – Attenuation