Home > Software design >  Transitioning from CS50 IDE to VS Code (Import module does not work)
Transitioning from CS50 IDE to VS Code (Import module does not work)

Time:09-18

I recently finished with PSET9 and wanted to transition from CS50 IDE to VS Code for the Final Project. Problem is I don't know what exactly I need to set up to make it all work. I guessed that I just need to import the CS50 library, which I then did following me checking out their GitHub. I did as instructed pip3 install cs50. However, even though various files were installed, my application.py is still saying that it can't find any modules, see screenshot. Why is that? What do I need to do?

Also what might I still be missing after having resolved this? Do I still need to do something to fully have the CS50 IDE essentially running on the VS Code (server, databases, etc)?

VS Code screenshot

CodePudding user response:

I think you need to create virtual environment for that and then activate it.

Create virtual environment in command line Windows

  1. go to you root app folder.
  2. python3 -m venv env (type this command in terminal)
  3. for activate env type this in windows (env\scripts\activate)
  4. for apple and linux type this in terminal) source env/bin/activate

then use pip install

CodePudding user response:

First thing to do is just make sure you've got those items installed correctly by using these commands in your terminal:

pip show cs50
flask --version
werkzeug --version

If they're installed, but you haven't quit and restarted VS Code, try that.

If you're using a virtual environment, make sure you reactivate it before trying to run your application.

I hope one of these helps solve your problem!

  • Related