python-discord / meta

Issue tracker for suggestions and other questions relating to our community
https://pythondiscord.com
31 stars 5 forks source link

Tag suggestion: Use the correct python to install packages #165

Open greyblue9 opened 2 years ago

greyblue9 commented 2 years ago

Tag Name

which-python

What kind of content should the tag include?

This is just a thought I have had a few times that could help our users and staff, I don't have any formal md content in mind yet, but if there is interest, I am happy to take a stab at it.

Motivation

A common problem is that users will install some package using pip install, but then they can't import it from their IDE because either a different python version is being used, or else a venv is in use in the IDE (which is the default for PyCharm)

What The Tag Should Do

Explain that pip is tied to a particular python, and it may not be the same one the IDE is using. Both IDE and command line must agree on where packages are installed. There can be different python versions in use, and/or there can be a venv in use in the IDE, which seems to be the more common issue.

Instructions

If the IDE indicates it's using a venv (as vscode does in the lower-left corner), and the user has installed a package with pip install, they should either

Final Thought

While it's not necessarily easy to explain, it would save a lot of back-and-forth (and people opening help channels and/or complaining they can't post screenshots) if we can distill it down to an easily digestible tag.

Bonus: Use python3.x -m pip or py -3.x -m pip when installing packages instead of pip to make sure they get installed for the correct python version