![]() To start installing pyenv on Mac, let’s follow the recommended steps and begin by using Homebrew. ![]() Advertisements Enough Motivation - Let’s Begin the Installation But you want to do this in such a way that when you’re serving time in the prison yard with your colleagues on Python 2.1.3, you don’t shoot yourself in the foot by accidentally coding some Python 3 goodness in the wrong codebase. ![]() Meantime, you want to play around like the rest of us cool kids with new features like assignment expressions (which made Guido ride off in the sunset), or positional only function arguments. Let’s say you’re on a team is still chugging along on some early Python, let’s say 3.2.6, or even worse, 2.1.3 As much as you may feel that such a team should bite the bullet and upgrade, already, this may involve a serious regression testing effort that the team is not willing to take on. In this case, it can be used to document and enforce the Python version that the team uses in the git repository (more on this later in the article). Having pyenv becomes even more important if you’re working with a team. ![]() Since I wanted to start writing several posts here about various Python Tools, and since I had a bit of a mess to clean up, I though Pyenv would be a good place to start. # Python 3Īlias python=/Library/Frameworks/amework/Versions/3.10/bin/python3Īlias pip=/Library/Frameworks/amework/Versions/3.10/bin/pip3 I have some aliases that allow me to use “python” instead of “python3” as the default Terminal command, for example. Of course, that’s not the end of the world - I can hit enter here and all is well, but it did serve as a reminder that I have a bit of a mess going on. If I create a new notebook this way and try to run my first cell, I get prompted for a Python environment: Selecting a Python environment in VS Code Advertisements I do this using Cmd-Shift-P and searching for Jupyter: Creating a new notebook using VS Code’s Jupyter plugin. When I use this plugin, I’ve noticed that it always prompts me for a Python environment when I create a new notebook. How to manage Python projects using Virtualenvīecause I spend a lot of time in Visual Studio Code and often like to write drafts of Python articles in Jupyter notebook format, I naturally have Microsoft’s excellent Jupyter Notebook extension installed.
0 Comments
Leave a Reply. |