Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

venv broken links #2

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions docs/src/_concepts/python_virtual_environments.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ weight: 12

Python Virtual Environments, also known as a venv, are a way to allow a
Python application access to specific versions of the libraries it needs to run properly. In the Singer ecosystem
you may need to install multiple Taps and Targets, which all have different dependencies.
If any of those dependecies wer in conflict with each other you would have a difficult development experience without Virtual Envrionments.
you may need to install multiple Taps and Targets, which all have different dependencies.

If any of those dependecies are were in conflict with each other you would have a difficult development experience without Virtual Envrionments.

Python has a great technical write up at [Virtual Environments and Packages](https://docs.python.org/3/tutorial/venv.html).

Expand All @@ -21,27 +22,27 @@ We're going to focus on the Meltano use case for Virtual Environments which is u

Ideally, you don't have to to worry about Virtual Environments while using Meltano,
we recommend using pipx to install Meltano which manages the creation of venvs for you.
See our [Installation Guide](../_guide/installation.md) for more details.
See our [Installation Guide](/guide/installation) for more details.

However, if you ever need to customize or build your own production pipeline (or do anything else) you may need to understand
how to install Meltano in an isolated way so that you don't have a conflict with dependecies within your own Operating System
or other Python applications running on the same machine.

# How do I use Virtual Environments?

We strongly suggest you create a directory where you want your virtual environments to be saved (e.g. `.venv/`).
We strongly suggest you create a directory where you want your virtual environments to be saved (e.g. `.venv/meltano/`).
This can be any directory in your environment, but we recommend saving it in your Meltano project to make it easier to keep
track of.

Then create a new virtual environment inside that directory:

```bash
python -m venv .venv/meltano
python -m venv .venv/meltano/
```

This `python` command is calling the `venv` package and it is creating a virtual environment in `.venv/meltano/`.

And that's it! You've created a virtual environment.
And that's it! You've created a virtual environment.
Feel free to explore the directory and compare it to your global python directory!
You can navigate to the directory by running `cd .venv/meltano/`.

Expand Down Expand Up @@ -78,16 +79,16 @@ pip install meltano

<div class="notification is-info">
<p>As a reminder, we do generally recommend using `pipx` for installing python packages.
Ensure you have `pipx` installed by reviewing the [Install pipx](/guide/installation#install-pipx) instructions.</p>
Ensure you have `pipx` installed by reviewing the <a href="/guide/installation#install-pipx">Install pipx</a> instructions.</p>
</div>

# How does meltano use Virtual Environments internally?

Whenever you run `meltano install`, Meltano creates a `.meltano/` directory in your project.
This directory has a number of sub-directories (subject to change at any point, as this is an
internal directory).
internal directory).
In `.meltano/` you may see an `extractors/` directory that was created (if you
have an extractor).
have an extractor).
In that directory you'll see the name of a your tap and inside of that
directory is a virtual environment!

Expand Down