简体   繁体   中英

Problems Installing 3rd party python modules in VSC

I am having trouble installing/utilizing 3rd party python modules such as pdfplumber or PyPDF2 onto VSCode.

When importing the library the output says: Import error: No module named pdfplumber

My initial steps into the file are as follows:

-created file

-initialized + activated venv through VSCode terminal

-pip install pdfplumber

-import pdfplumber through file

Additional info: Built in libraries such as sys, requests provide a small description when you hover your mouse over the script within your code. Yet with 3rd party modules like pdfplumber shows => 'pdfplumber: pdfplumber'

More additional info => edit:

I want to run python 3. VSCode selected interpreter says I am running python 3. My pyvengv.cfg says I am running 3.9.

Yet when running => print(sys.version) and print(sys.path) => say that I am running paths in python2 and running python version 2.7.

After activating the virtual environment, I use pip install pdfplumber to install the module.

Run pip show pdfplumber in integrated Terminal to check if it's installed in current selected interpreter.

Import it without errors:

在此处输入图像描述

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