Nigeria No1. Music site And Complete Entertainment portal for Music Promotion WhatsApp:- +2349077287056
Monday, 13 May 2024
Show HN: How to Install Python on a Mac https://bit.ly/44FawCK
Show HN: How to Install Python on a Mac I recently began using Python for AI projects and found Rye, which is an all-in-one tool that replaces Pyenv, Pip, and Venv, for a more project-centered approach to Python development (like Ruby or JavaScript or Rust). As someone who habitually writes tutorials for beginners, I wrote a series of articles for my mac.install.guide site advocating setting up Python projects using Rye. Am I leading beginners down the wrong path by suggesting Rye for Python tooling? Beginners often encounter READMEs and tutorials that show `pip install something` as a first step. That led me to the error "Command not found: pip" [0] (so I wrote about that). Solving that led to the error "Command not found: python" [1] and I first tried the system Python installed with XCode Command Line Tools and then "brew install python" [2]. That led me to "Error: externally-managed-environment" [3] which is a recent safeguard to encourage Python users to use environment managers to avoid dependency conflicts from globally-installed packages. At that point, I realized that there are two different use cases for using Python, either standalone tools and applications, where it's best to "install Pipx" [4], or programming with Python, including installing Python packages, where there's need for a version manager, a package manager, and an environment manager. There's no built-in version manager (for that, you will "install pyenv" [5]) but Pip and Venv are a built-in package manager and environment manager, once you have Python installed. As a guide, I wrote about "Mac Python" [6] and how to "Update Python" [7]. This diagram [8] helped me understand which Python tools are used for version management, package management, and environment management. That's where I found Rye, an all-in-one tool that eliminates the need for Pyenv, Pip, Venv, and other tools. So I wrote about how to "install Python with Rye" [9] and how to "Use Rye" [10]. These are the articles that were most helpful in showing how to set up a Python development environment: - https://bit.ly/44Fax9M... - https://bit.ly/44FaxGO... - https://bit.ly/44CHh3D... For beginners, I feel Rye is a better choice (as a single tool) than a grab bag of multiple tools, but I heard there is some resistance to Rye in the Python community, as it's written in Rust and other people have already tried to improve the Python developer experience without achieving success. Others have suggested asdf or mise (good choices for managing multiple languages), Docker (appropriate for collaboration on a complex project but overkill for simple, one-developer projects), and Nix (a lot to learn). To wrap it all up, I wrote a freeCodeCamp article, "How to Install Python on a Mac" [11]. I'm sharing the links here for comments and feedback from those more experienced than I. [0] "Command not found: pip" ( https://bit.ly/3UDHMFP ) [1] "Command not found: python" ( https://bit.ly/44CHjbL ) [2] "brew install python" ( https://bit.ly/3UEQNi6 ) [3] "Error: externally-managed-environment" ( https://bit.ly/44Faz1o... ) [4] "install Pipx" ( https://bit.ly/44FazhU ) [5] "install pyenv" ( https://bit.ly/44FaAlY ) [6] "Mac Python" ( https://bit.ly/44IjVt7 ) [7] "Update Python" ( https://bit.ly/44JpkAw ) [8] diagram https://bit.ly/3wxD3h2 [9] "install Python with Rye" ( https://bit.ly/44JpI1W ) [10] "Use Rye" ( https://bit.ly/3UDWCMM ) [11] "How to Install Python on a Mac" ( https://bit.ly/3UWP7Sq... ) May 13, 2024 at 11:54PM
Labels:
Hacker News
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment