Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
116 views
in Technique[技术] by (71.8m points)

python - I have a problem with ModuleNotFoundError

I'm using Visual Studio Code to build a discord bot. Before I did everything on repl.it. Since then I can keep the bot up even if the computer shutdowns but I went into quite a few problems and decided to switch over from using the cloud. As I was done setting up a basic frame for the bot I ran into a problem from the very first line of code.

from apscheduler.schedulers.asyncio import AsyncIOScheduler

For some reason it says the module apscheduler doesn't exist.

Microsoft Windows [Version 10.0.18363.1316]

(c) 2019 Microsoft Corporation. All rights reserved.

C:Windowssystem32>pip install apscheduler

Requirement already satisfied: apscheduler in c:usersalan kimappdatalocalpackagespythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0localcachelocal-packagespython39site-packages (3.7.0)

Requirement already satisfied: setuptools>=0.7 in c:program fileswindowsappspythonsoftwarefoundation.python.3.9_3.9.496.0_x64__qbz5n2kfra8p0libsite-packages (from apscheduler) (49.2.1)

I'm sure apscheduler is already installed and I have no idea why visual studio says it doesn't exist. Can someone please help me?

question from:https://stackoverflow.com/questions/65873307/i-have-a-problem-with-modulenotfounderror

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Pressing Ctrl+Shift+` to open a new integrated Terminal in VS Code. If you didn't change the default setting

"python.terminal.activateEnvironment": true,

the selected interpreter should already be activated in Terminal. Then use pip show apscheduler to check if the module exists in current environment. If not, please reinstall again.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...