Home > OS >  I had already installed and activated my virtual environment but now its not working yet files are t
I had already installed and activated my virtual environment but now its not working yet files are t

Time:07-20

I had already installed and activated my virtual environment in visual studio. Everything was working fine but now, all the imported packages are saying they don't exist. This means my virtual is not activated. I try activating it but still it shows me the installed packages are not existing yet I can see them.

This is the error

Kweronda@DESKTOP-MT2OV1I MINGW64 ~/Desktop/tweetbot/src (master)
$ python tweek.py
Traceback (most recent call last):
  File "tweek.py", line 7, in <module>    
    import bs4
ModuleNotFoundError: No module named 'bs4'

Kweronda@DESKTOP-MT2OV1I MINGW64 ~/Desktop/tweetbot/src (master)
$

I have bs4 and other packages imported as well as you see here below

import random
import re
from turtle import delay
import dotenv
import requests
import bs4

#creating a quotes file
import json as _json

#creating tweet
import os
import time
import tweepy

Allow me attach the file structure of my project here file structure of my project. the imported packaes are there but running the project says they are not imported

CodePudding user response:

Does your sys.prefix == sys.base_prefix? If that's a True, then you aren't in a virtual env. I would check the shell script for the venv activate.

CodePudding user response:

I was supposed to activate the activate.bat file, but I was activating just the activate file. Thanks, everyone for your help.

  • Related