astroplot
astroplot

Reputation: 29

Python installation directory

On command $which python3$ , the location says /opt/homebrew/bin/python3 on my Mac. Is this okay for python to be in other directory than /usr/local/ ?

Upvotes: 0

Views: 198

Answers (2)

Dipto Mondal
Dipto Mondal

Reputation: 764

Yeah it's absolutely ok. But it's better to create a project wise virtual env so that you don't messed up installing so many third party libraries globally in your system which could break system tools and other projects. Installing vitualenv:

python3 -m pip install --user virtualenv

Creating a virtual environment.

cd {{your project directory}}
python3 -m venv env

Activate the virtualenv:

source env/bin/activate

Now if you run which python you will see the python is from your newly created virtual env.

Upvotes: 1

lionking-123
lionking-123

Reputation: 311

Yes. It will work. I mean if you change the location of installation directory, mac os will recognize it and python3 instruction will work.

Upvotes: 1

Related Questions