microsoft / vscode-pylint

Linting support for python using the pylint library.
https://marketplace.visualstudio.com/items?itemName=ms-python.pylint
MIT License
70 stars 34 forks source link

pylint reports E0401:import error for the mido library #556

Closed ReddyKilowatt closed 3 months ago

ReddyKilowatt commented 3 months ago

pylint_bug.txt

ReddyKilowatt commented 3 months ago

Why does this website ask for trace files that are too long to paste into bug reports???????????????????????????

ReddyKilowatt commented 3 months ago

It looks like my venv was the problem. Somehow, the packages I installed into the venv (yes, it was activated) were installed in the global python env.

karthiknadig commented 3 months ago

Somehow, the packages I installed into the venv (yes, it was activated) were installed in the global python env.

This can happen if you run pip install vs python -m pip install. See here for more details: https://snarky.ca/why-you-should-use-python-m-pip/

ReddyKilowatt commented 3 months ago

@karthiknadig I know about python -m pip install xxx After I discovered the problem, I had tried adding more packages to the venv, but they still went to the global python. (the venv was activated, and I was using python -m pip install xxx).

I have never had this problem with Python on Windows until now. I ended up deleting the venv, and Python, and reinstalling Python for all users, so that it doesn't get installed in my user directory (Appdata ....) Now, the venv seems to work much better, and vscode is able to resolve most python symbols/objects now.