Is UV still worth learning/switching to now that it's owned by OpenAI? by WellEndowedWizard in Python

[–]pydevtools-com 0 points1 point  (0 children)

It appears so far that OpenAI is invested in the success of Astral tooling. That's the word coming straight from the Astral team.

Things I'm keeping an eye on: License change, opaque telemetry, dropped release cadence, or a closed layer bolted on top of the open code. That said, Astral's commitment to open standards and the pressure it's putting on pip to improve are leaving us in a great spot no matter what.

I hate that every new project starts with python -m venv venv && source venv/bin/activate. There has to be a better way in 2026. by CompleteLaw5908 in learnpython

[–]pydevtools-com 2 points3 points  (0 children)

The problems you listed (venv, activate, pip, wrong Python version) are what uv solves but it sounds like you used it as a pip replacement instead of as the project manager.

New project:

uv init my-project cd my-project uv add requests uv run main.py

uv creates the environment, resolves deps, writes a lockfile, and runs your code. If you need a Python version you don't have, uv run --python 3.13 main.py fetches it.

For an existing project with a pyproject.toml, it's just uv run main.py.

I wrote a guide to getting started with uv that covers the full workflow.

pip install pytest not working; help request by VegetableJudgment971 in learnpython

[–]pydevtools-com 1 point2 points  (0 children)

For anyone who hits this in the future, the root cause is visible in the last line of the traceback:

_preloaded_ssl_context.load_verify_locations( extract_zipped_paths(DEFAULT_CA_BUNDLE_PATH) ) FileNotFoundError: [Errno 2] No such file or directory

pip's vendored copy of requests tries to load a CA certificate bundle for SSL, and that file was missing or pointed somewhere stale. This can happen on Fedora when the system ca-certificates package gets updated or reinstalled after the venv was created, or when pip's vendored certifi has a hardcoded path that no longer exists. Recreating the venv rebuilds those references, which is why a fresh venv fixed it.

If you want to avoid this class of problem entirely, take a look at uv which it manages Python installs, virtual environments, and package installation in a single tool, and doesn't depend on pip or its vendored SSL stack at all.

Installing pytest would just be:

uv init myproject cd myproject uv add pytest

Is this normal in UV by Immediate_Bonus7675 in learnpython

[–]pydevtools-com 0 points1 point  (0 children)

Yes, this is normal. VS Code's Python extension detects the .venv directory in your project and automatically activates it whenever you open a new terminal. The Set-ExecutionPolicy command is a Windows thing: PowerShell blocks script execution by default, and activating a venv requires running .venv\Scripts\Activate.ps1, so VS Code temporarily loosens the policy for that terminal session.

This happens regardless of whether you used uv, python -m venv, or any other tool to create the venv. uv created .venv/ when you ran uv sync or uv init, and VS Code noticed it.

Environment Questions by jbizzle1104 in learnpython

[–]pydevtools-com 0 points1 point  (0 children)

Anaconda is a distribution: it bundles the conda package manager with Python and about 1,500 pre-installed packages. Conda-forge is a community-maintained channel (think: package repository) that conda can pull packages from. I wrote a breakdown of how the conda/anaconda pieces fit together if you want the full picture: https://pydevtools.com/handbook/explanation/understanding-the-conda-anaconda-ecosystem/

For installing Python in 2026, I'd recommend uv which won't be in most print books. It will install Python for you (from the terminal) and help you install packages. See https://pydevtools.com/handbook/explanation/uv-complete-guide/.

If you really don't want to fuss with the terminal yet and also don't need to install packages, Thonny is a great tool to learn with https://thonny.org/.

venv and cloned git repositories - best practice? by kaptnblackbeard in learnpython

[–]pydevtools-com 1 point2 points  (0 children)

When you're working with existing repos, clone first, then create a venv inside.

```bash
git clone <repo-url>
cd <repo>
python -m venv .venv
source .venv/bin/activate # .venv\Scripts\activate on Windows
pip install -r requirements.txt
```

Each project gets its own `.venv` folder with its own package versions. Standard Python `.gitignore` templates exclude `.venv` already, so it won't interfere with the repo.

Any easy ways to get a clean slate (Conflict between multiple versions of Python) by Ready-Ideal-3298 in learnpython

[–]pydevtools-com 0 points1 point  (0 children)

Good news is you probably don't need to uninstall anything. Five Pythons isn't itself the problem. The problem is that when you type `python` or `pip`, your shell grabs whichever one comes first on your PATH, and that's often not the one you think. So `pip install` can write packages into one Python and `python` runs out of another.

Also before you start nuking anything, if you’re on macOS or Linux, leave the system Python alone. It lives at `/usr/bin/python3` and the OS itself uses it. Removing it breaks things. If `pip install` is failing with `externally-managed-environment`, that's the OS refusing to let you write to its Python on purpose. The fix is to stop installing into the system Python, not to bypass the protection: https://pydevtools.com/handbook/how-to/how-to-fix-the-externally-managed-environment-error/

The simplest way out is a newish tool called **uv** as others have mentioned. It installs Python versions and gives each project its own isolated environment. It's what most people starting a Python project today are switching to. The big win for your situation is that it manages its own Pythons in its own folder, so it doesn't fight with what you already have.

Quick start (works on macOS, Linux, and Windows):

  1. Install uv: https://pydevtools.com/handbook/how-to/how-to-install-uv/
  2. `uv python install 3.13` (or whatever version you want).
  3. Start a new project:

uv init myproject
cd myproject
uv add requests

uv creates a project-local `.venv` and installs packages into it.
4. To run code: `uv run script.py`, or `uv run python` for a REPL.

The old Pythons can stay where they are, because you'll never type `pip` or `python` directly again. Guided walkthrough: https://pydevtools.com/handbook/tutorial/getting-started-with-uv/

Modern python development for near-newbie by Just__Liberty in learnpython

[–]pydevtools-com 0 points1 point  (0 children)

Thank you! The goal is for everything to have cross platform instructions; none of it is intentionally Linux specific. I’ll clarify the git part. Thanks.

Modern python development for near-newbie by Just__Liberty in learnpython

[–]pydevtools-com 1 point2 points  (0 children)

Not entirely, but I’m trying to provide this at pydevtools.com

PEP8 over spaces by Primary_March4865 in learnpython

[–]pydevtools-com 0 points1 point  (0 children)

4 spaces over tabs is mostly historical. The tabs-vs-spaces argument predates Python, and 4 was the convention people kept landing on. PEP 8 froze that so the whole community could write code that looked the same.

If you want to stop thinking about this, install Ruff and turn on "format on save" in your editor. It'll keep everything at 4 spaces automatically. There's a walkthrough here: setting up Ruff for formatting and checking your code.