简体   繁体   中英

How can I use virtual environment in Visual Studio?

I activate the virtual environment in VSCode terminal:

在此处输入图像描述

and I check the pip list:

在此处输入图像描述

I can see the sklearn pip. So I enter

import sklearn

in script but script can't find sklearn.

what is the problem? Isn't the virtual environment activated just by typing in the terminal?

It's fine. Try to run this code and you won't get exceptions. To avoid this underscore pip install autopep8 might help

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM