#๐Ÿ”’ Installing packages in a new venv using Python 3.12

6 messages ยท Page 1 of 1 (latest)

merry trout
#

Every time I create a new project (and a new venv), I have to follow the steps in the top answer of this post https://stackoverflow.com/questions/77364550/attributeerror-module-pkgutil-has-no-attribute-impimporter-did-you-mean to install packages with pip3.

After I follow the steps, I can pip3 install module. I was wondering if this is the correct procedure or if I am just hacking a fix by doing this?

lilac sentinelBOT
#

@merry trout

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

merry trout
delicate lily
#

If you don't already have one, you can create a requirements.txt file and write what you need to install.
Say you need requests, you'd just write

requests

In the file

The venv will automatically install and upgrade pip when you create it. As long as you have python 3.12 installed, you can select that as your interpreter and the venv will use it

Hopefully that answers your question

lilac sentinelBOT
#
Python help channel closed for inactivity

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.