#đź”’ What's the point to create a separate Python environment per requirements?

21 messages · Page 1 of 1 (latest)

fleet mist
#

Hi all!

I'm confusing with one formulation while following instruction's installation steps.

I'm following working instructions and there's the statement literally as:
"The [Project name] CLI can be installed via pip. We recommend you install [Project] in a separate Python environment."

I'm not sure if I understand correctly this specific formulation.

If I've already installed Python in a standard way using sudo commands, should I also install another a separate environment?

Is there any existing examples, how to create multiple Python environments?

It looks like I'm missing something in basic fundamental understanding.

How to structure a multiple environment properly?

Thank you for attention.

sly latchBOT
#

@fleet mist

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.

fleet mist
eager spindle
#

Wait a sec

eager spindle
#

?*

fleet mist
eager spindle
#
  • Create the environment (do this once, inside your project folder)
    python -m venv venv

  • Activate it (do this every time you work on the project)
    source venv/bin/activate

  • Now install the tool, it goes into the venv, not your system
    pip install [project-name]

  • When you're done working, deactivate
    deactivate

#
├── venv/         <- the virt environment lives here
├── main.py
└── your files...```
thorny prairie
#

the point is:
if project1 uses libraryX version 1,
but project2 uses libraryX version 2,
you cant install them in the same environment,
since you can only have a single version of something installed in a single python environment

eager spindle
#

You can make a venv for each.

python -m venv venv-projectB
python -m venv testing-env```
#

@fleet mist got it?

fleet mist
#

Yes, I'm handling it now in the head, wait

#

thank you for visual examples🤝

sly latchBOT
#
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.