简体   繁体   中英

I can't import openpyxl in visual studio code

I used the command pip3 install openpyxl , but I'm still getting the error, unresolved import 'openpyxl' .

How I can import the library or fix this error?

  1. Enter the currently selected environment in the terminal: ( shortcut keys: Ctrl+Shift+` )I use a virtual environment.

    在此处输入图片说明

  2. Install the module " openpyxl " in your currently selected VScode environment:

    在此处输入图片说明

  3. Reopen this file or reload VSCode after installation:

    在此处输入图片说明

Check the installation:

We can see the installation package of the module " openpyxl " under " .venv " of the virtual environment used.

在此处输入图片说明

只需打开终端(如 vscode)并输入pip install openpyxl

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