#๐Ÿ”’ help with creating and changing a venv.

16 messages ยท Page 1 of 1 (latest)

silent wagon
#

Is it possible to create a venv in a code, then change the current location to it? If so, how can I do that?

finite mountainBOT
#

@silent wagon

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.

mighty idol
#

but why tho?

silent wagon
#

I am creating an IDE

#

And for new projects I wanted them to be on their own venv

mighty idol
#

how are you making your IDE? in Python?

silent wagon
#

Yes

mighty idol
#

tricky

silent wagon
#

Like a google colab

mighty idol
#

!d subprocess might work

finite mountainBOT
#

Source code: Lib/subprocess.py

The subprocess module allows you to spawn new processes, connect to their input/output/error pipes, and obtain their return codes. This module intends to replace several older modules and functions:

os.system
os.spawn*
```  Information about how the [`subprocess`](https://docs.python.org/3/library/subprocess.html#module-subprocess) module can be used to replace these modules and functions can be found in the following sections.
silent wagon
#

And is it possible to change the current folder (bc imports)

mighty idol
#

yes

finite mountainBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, 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.