2

I was studying about Oriented Programming and just arrived in a topic of the course that uses the library 'prettytable' to show that is possible to make ASCII tables without so much effort. The problem is that I'm trying to import this library from my venv space and it's not working

# how to create a virtual envirionment:
#
# python -m venv C:\Users\apleu\Desktop\Python\Python\Day_16\venv
# Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process
# venv\scripts\activate
# pip install PrettyTable

import prettytable

I'm using python 3.11.4

Image of my code ambient

I watched some videos and searched some solutions but none of them worked.

Gino Mempin
  • 25,369
  • 29
  • 96
  • 135
Nystrom
  • 21
  • 1
  • 1
    You activated the virtual environment in the terminal. Nowhere else. Search the web for how to make your code editor venv-aware, because each editor is different (and some flat out have no way or idea how to deal with venvs) – Mike 'Pomax' Kamermans Aug 05 '23 at 02:53
  • Your screenshot looks like VS Code. If you are using VS Code, please see the docs on [Using Python Environments in VS Code](https://code.visualstudio.com/docs/python/environments). As the previous comment mentions, you have an env with prettytable installed, but it's not the same env that your VS Code is using. You have to tell VS Code which env to use. – Gino Mempin Aug 05 '23 at 03:17

0 Answers0