-2

How would I install python3.9 in a custom or user-defined location?

Ideally if I say brew install [email protected], python gets installed in /usr/local/bin/ but I need to have this installed in a different location. How would I do that?

I am able to change the path or choose the path while installing on Windows and not on Mac. Could someone please help me on this?

2
  • This is possible if you downloaded the Python installer from python.org/downloads and specified the location you want it to be installed in the "Customize" screen you get from clicking on the "customize" button on the "Installation Type" screen when you install using the downloaded installer. Commented Jan 5, 2023 at 11:44
  • pyenv lets you install a number of Python versions in parallel and easily switch between them. Commented Jan 5, 2023 at 12:07

2 Answers 2

0

One of the solutions you can choose, is to install Anaconda. Anaconda should give you the step Destination Select, where you can select where to install the base enviroment, as can also be seen here. base will be where a Python version of your choice will be installed. You can later on add more versions in other environments as outlined in the comment of triplee

Sign up to request clarification or add additional context in comments.

Comments

0

The best* way to install Python in a custom location on your Mac is through a custom installation from the Official Python Site. Once you open up the package there is a step along the way that let's you choose where to install it (Destination Select).

From there, you can use virtualenv to control which version of Python you use.

*best as in most lightweight (don't need Anaconda), safest (from official site), and probably the easiest (GUI installer)

Install Python on a Mac Installer Screen

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.