Don't wanna be here? Send us removal request.
Text
Managing and Using Multiple Python Environments on Mac
It will get messy. And it will be fast.
Here are some tools and ideas to manage multiple Python environments on Mac while avoiding the above mess. Some of them might work on other operating systems as well, but it's likely some adjustments will be required.
The standard MacOS X build still ships with Python 2 which was deprecated at the end of 2019. So for starters, install a version of Python 3 and make this your default Python version.
If you use MacOS Catalina or later, you might find that the default login shell for you is zsh instead of bash. In that case, in the information below, wherever in the commands you encounter .bash_profile replace it with .zshrc... you get the gist.
Making Python 3 your default
Consider spending some time reading the below open source links for working with Python default version assuming best practices is using pyenv - in my opinion - instead of fiddling with paths and existing Mac or Homebrew versions of Python already installed in your system.
https://opensource.com/article/19/5/python-3-default-mac
https://opensource.com/article/19/6/python-virtual-environments-mac
https://dev.to/irfnhm/how-to-set-python3-as-a-default-python-version-on-mac-4jjf
There’s another great resource that talks through an opinioned foundational setup. It includes the following tools: pyenv, poetry, pytest, pytest-cov, pre-commit hooks, Flake8, Black, Mypy and iSort.
https://mitelman.engineering/blog/python-best-practice/automating-python-best-practices-for-a-new-project/
Generally, it is best to avoid using the system Python for Mac, this usually includes Brew’s Python as well because it takes precedence in PATH. You also should never be using sudo with pip.
Virtualenv is very popular and let’s you use the same Python interpreter with different projects but Pyenv sits an even lower level and lets you install multiple interpreters at the same time to your home directory. Any available Python version(s) can be installed on your system at the same time. It also installs the Python binaries to your home folder. Usually you set a global Python and then create venvs from the interpreter version you require.
https://github.com/pyenv/pyenv#homebrew-on-macos
A good starting point on setting up pyenv on Mac and get a lot of tricks for it is here:
https://opensource.com/article/19/5/python-3-default-mac
The Quintessence
1. Install pyenv
$ brew install pyenv
2. Install the Python version(s) you want, such as
$ pyenv install 3.8.4
Specify versions by version number if required. For cases where you simply want to install and use the latest version of Python, the xxenv plugin makes this easy (https://github.com/momo-lab/xxenv-latest):
$ pyenv latest install
At any time you can see what “latest” installed version currently means by using:
$ pyenv latest —print
3. Set what you want to use globally
$ pyenv global $(pyenv <VERSION> -print)
Where <VERSION> can be “latest” or ���3.8.4” or whichever version you installed in step 2.
At any time you can check the current (active) version with:
$ python -V
4. Set the environment to be initialized for all shells
Add the following command to your ~/*.zshrc* for zsh or ~/*.bash_profile for bash to make sure the environment gets set for any bash shell you start
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fi
5. Create & manage virtual environments across different versions of Python with pyenv
$ brew install pyenv-virtualenv
To enable auto-activation, add to your profile (.bash_profile or .zshrc)
if which pyenv-virtualenv-init > /dev/null; then
eval "$(pyenv virtualenv-init -)";
fi
Create a virtualenv for sampleproject and Python 3.8.10 or any version you like:
pyenv virtualenv 3.8.10 sampleproject
Activate your environment:
pyenv local sampleproject
Check the current Python version:
$ pyenv which python
0 notes
Text
Apache Pinot - Realtime distributed OLAP datastore, designed to answer OLAP queries with low latency
I had another life, when I was a Hyperion Essbase specialist. Once a colleague told me Essbase was nice but it wasn't the future. I was offended for 5 minutes, then changed my career.
Fast forward 10 years, I find Apache Pinot and it sounds pretty cool to have OLAP running on Kubernetes and AWS.
https://pinot.apache.org/
Running on AWS
https://docs.pinot.apache.org/basics/getting-started/public-cloud-examples/aws-quickstart
Running on Kubernetes
https://docs.pinot.apache.org/basics/getting-started/kubernetes-quickstart
4 notes
·
View notes