Overview It all started when I tried to use BeautyfilSoupr for web scraping.
Install BeautifilSoup
using conda in Anaconda installation environment
conda install beautifilsoup4
After that, I entered import in VSCode as follows, but an error occurred.
ʻUnable to import. Is
conda install` not working?
Cause This article was very helpful. https://qiita.com/myasu398/items/5b0f321491a1bed77aa3
The mac default Python interpreter seems to be deprecated in VS Code, and it can be resolved by setting it.
Solution
Select Python: Select Interpreter
from command.
Then, the available Python execution environment is displayed as follows. In my case, the following display. There were two versions of Python in Anaconda or Not Anaconda. .. ..
Apparently, in my case, the execution environment was an environment other than Anaconda. By choosing Anaconda, the problem was solved.
When I selected the Anaconda environment, the import of another Python file I created earlier failed. .. .. Probably because the library imported in the previous environment is not in the Anaconda environment. It's ridiculous to spend time on these silly things, so it seems better to put them in either environment. When you have time, let's move to the Anaconda environment.
Recommended Posts