admin管理员组

文章数量:1420145

img_1 Img_2 I'm trying to build an application that will summarize moderately long texts in 60 words or less. But 'flask', 'requests', and 'transformers' are underlined with a wave line. I've tried import the packages but an error keeps popping up.

from flask import Flask, jsonify, request 
import requests
from transformers import pipeline 
  • the error that keeps popping up.
A Import "flask" could not be resolved Pylance (reportMissing|mports) [Ln 1, Col 6]
A Import "requests" could not be resolved from source Pylance (reportMissingModuleSource) [Ln 2, Col 8]
A Import "transformers" could not be resolved Pylance (reportMissinglmports) [Ln 3, Col 6]

img_1 Img_2 I'm trying to build an application that will summarize moderately long texts in 60 words or less. But 'flask', 'requests', and 'transformers' are underlined with a wave line. I've tried import the packages but an error keeps popping up.

from flask import Flask, jsonify, request 
import requests
from transformers import pipeline 
  • the error that keeps popping up.
A Import "flask" could not be resolved Pylance (reportMissing|mports) [Ln 1, Col 6]
A Import "requests" could not be resolved from source Pylance (reportMissingModuleSource) [Ln 2, Col 8]
A Import "transformers" could not be resolved Pylance (reportMissinglmports) [Ln 3, Col 6]
Share Improve this question edited Jan 29 at 6:49 Chip Chop asked Jan 29 at 6:45 Chip ChopChip Chop 11 bronze badge 4
  • Did you install the packages? You tagged pip, but have you used it? – Tim Roberts Commented Jan 29 at 6:52
  • 1 meta.stackoverflow/a/285557/5586359 Please, show us text, not screenshots of text! idownvotedbecau.se/imageofcode. Edit your question, copy/paste from the terminal and format as code block. Images are not helpful, they're hard to read and hard to search. Badly formatted code is hard to read. Images are only good to show something non-textual (like colors, fonts, shapes, sizes, positions, etc). – phd Commented Jan 29 at 7:18
  • 1 "bash: python: command not found". You dont have python installed or correctly set up. – rasjani Commented Jan 29 at 8:48
  • 1 The error in the question is different than in the images. In the images the error is telling you that the command python is not found, so the system doesn;t recognize what python is. – Cincinnatus Commented Jan 29 at 9:07
Add a comment  | 

1 Answer 1

Reset to default 0

To use the packages you would need to install them. Depending on your setup this can vary. Based on your tags, I am assuming you're pip-installing packages. You need to run the following commands to install the packages:

  1. pip install Flask (https://pypi./project/Flask/)
  2. pip install requests (https://pypi./project/requests/)
  3. pip install transformers (https://pypi./project/transformers/)

Once you install these packages, ideally your errors should be resolved.

本文标签: