python - I'm trying to import the following but the error log keeps saying (report Missing Imports) - (look at pic) - St

img_1 Img_2I'm trying to build an application that will summarize moderately long texts in 60 wor

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745308662a4621867.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信