I have Python 2.7 installed on my machine. I use it in Visual Studio Code (VSC) (MacOS distribution) without issue, but I'm having difficulty getting Visual Studio Code to "see" wget
.
In my VSC, I added the following import statement to myProject.py
:
import wget
The linter says this:
E0401:Unable to import 'wget'
I verified I have wget
installed via the following command:
which wget
...which returns...
/usr/local/bin/wget
I attempted to reinstall it with brew install wget
, but it says it's installed already. So I tried sudo -H pip install wget
, which I think installed successfully.
Collecting wget Downloading wget-3.2.zip Building wheels for collected packages: wget Running setup.py bdist_wheel for wget ... done Stored in directory: /var/root/Library/Caches/pip/wheels/6d/98/29/61ccc41148f871009126c2e844e26f73eeb25e12cca92228a5 Successfully built wget Installing collected packages: wget Successfully installed wget-3.2
I closed VSC and reopened it. I continue to get this error in the linter:
E0401:Unable to import 'wget'
I recently installed and uninstalled anaconda
, which I'm pretty sure is the source of my misery. I don't regularly work with Python, but I find myself working on a project where it's pretty handy. I'm out of ideas re: how to resolve this issue. I welcome your suggestions and I thank you for reading.
Update:
This question describes the issue I've encountered. I've tried the solutions suggested and none of them seem to rid me of the linter error.
Updating my .bash_profile
does not to appear to have any effect, either:
export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.7/site-packages