OpenVino on MacOS using Anaconda - macos

How do you go about installing OpenVino using Anaconda. Will this be possible with prerequisites like OpenCV and CMake that are required for installation.
(IntelEnv) ChrNinja#ChrNinja demo % ./demo_squeezenet_download_convert_run.sh
target_precision = FP16
[setupvars.sh] OpenVINO environment initialized
###################################################
Downloading the Caffe model and the prototxt
Installing dependencies
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Processing /Users/christianh/Library/Caches/pip/wheels/a7/c1/ea/cf5bd31012e735dc1dfea3131a2d5eae7978b251083d6247bd/PyYAML-5.3.1-cp27-cp27m-macosx_10_15_x86_64.whl
Collecting requests
Using cached https://files.pythonhosted.org/packages/1a/70/1935c770cb3be6e3a8b78ced23d7e0f3b187f5cbfab4749523ed65d7c9b1/requests-2.23.0-py2.py3-none-any.whl
Collecting idna<3,>=2.5
Using cached https://files.pythonhosted.org/packages/89/e3/afebe61c546d18fb1709a61bee788254b40e736cff7271c7de5de2dc4128/idna-2.9-py2.py3-none-any.whl
Collecting chardet<4,>=3.0.2
Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
Collecting certifi>=2017.4.17
Using cached https://files.pythonhosted.org/packages/57/2b/26e37a4b034800c960a00c4e1b3d9ca5d7014e983e6e729e33ea2f36426c/certifi-2020.4.5.1-py2.py3-none-any.whl
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1
Using cached https://files.pythonhosted.org/packages/e1/e5/df302e8017440f111c11cc41a6b432838672f5a70aa29227bf58149dc72f/urllib3-1.25.9-py2.py3-none-any.whl
Installing collected packages: pyyaml, idna, chardet, certifi, urllib3, requests
ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/PyYAML-5.3.1.dist-info'
Consider using the `--user` option or check the permissions.
Error on or near line 150; exiting with status 1

1. Update conda to latest version:
conda update --all
2. Install the Intel® Distribution of OpenVINO™ Toolkit:
conda install openvino-ie4py -c openvino
3. Install OpenCV. This is required to run a sample:
conda install opencv
4. Verify the package installed:
python -c “import openvino”

Related

pip install IBM_DB does not work on Ubuntu 22.04 python 3.8

I am trying to install ibm_db v3.1.2 on python 3.8.13 Ubuntu 22.04 (5.15.0-40-generic)
pip install ibm_db
Collecting ibm_db
Downloading ibm_db-3.1.2.tar.gz (1.1 MB)
|████████████████████████████████| 1.1 MB 5.5 MB/s
Installing build dependencies ... done
Getting requirements to build wheel ... done
ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/tmp/tmpfv417hua/output.json'
Other commands, such as pip install numpy work as expected
Any help would be appreciated.
Edit: I was able to work around the problem using Anaconda.
conda install -c conda-forge ibm_db. Now the basic use of ibm_db
ibm_db.pconnect(connection_string, "", "")
throws the error
[IBM][CLI Driver] SQL10013N The specified library "GSKit Error: 207" could not be loaded. SQLSTATE=42724 SQLCODE=-10013
which also seems to be known, but the suggested solution does not work.
Edit 2: pip3 install 'ibm_db==3.1.1' worked, so the problem may be with 3.1.2

Can't install spacy for NLP tasks

I'm trying to install spaCy for NLP tasks but when I follow the first instruction from https://spacy.io/usage (pip install -U pip setuptools wheel) I get the error below. I believe my error may come from me creating two different users for my laptop, my lack of understanding of environment variables, virtual environments, and my path variable. I also do not understand the message about no metadata being found.
Microsoft Windows [Version 10.0.19043.1706]
(c) Microsoft Corporation. All rights reserved.
C:\Python310\Scripts>pip install -U pip setuptools wheel
Requirement already satisfied: pip in c:\users\user\appdata\roaming\python\python310\site-packages (22.0.4)
Collecting pip
Using cached pip-22.1.2-py3-none-any.whl (2.1 MB)
Requirement already satisfied: setuptools in c:\python310\lib\site-packages (62.3.2)
Requirement already satisfied: wheel in c:\python310\lib\site-packages (0.37.1)
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 22.0.4
Uninstalling pip-22.0.4:
Successfully uninstalled pip-22.0.4
WARNING: No metadata found in c:\users\user\appdata\roaming\python\python310\site-packages
Rolling back uninstall of pip
Moving to c:\users\user\appdata\roaming\python\python310\scripts\pip.exe
from C:\Users\User\AppData\Local\Temp\pip-uninstall-on_65qs2\pip.exe
Moving to c:\users\user\appdata\roaming\python\python310\scripts\pip3.10.exe
from C:\Users\User\AppData\Local\Temp\pip-uninstall-on_65qs2\pip3.10.exe
Moving to c:\users\user\appdata\roaming\python\python310\scripts\pip3.exe
from C:\Users\User\AppData\Local\Temp\pip-uninstall-on_65qs2\pip3.exe
Moving to c:\users\user\appdata\roaming\python\python310\site-packages\pip-22.0.4.dist-info\
from C:\Users\User\AppData\Roaming\Python\Python310\site-packages\~ip-22.0.4.dist-info
Moving to c:\users\user\appdata\roaming\python\python310\site-packages\pip\
from C:\Users\User\AppData\Roaming\Python\Python310\site-packages\~ip
ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: 'C:\\Python310\\Lib\\site-packages\\pip\\__init__.py'
Consider using the `--user` option or check the permissions.
WARNING: You are using pip version 22.0.4; however, version 22.1.2 is available.
You should consider upgrading via the 'C:\Python310\python.exe -m pip install --upgrade pip' command.
C:\Python310\Scripts>
Screenshot of error message

Error installing geopandas in python on mac m1

I'm trying to install geopandas on my M1 mac and I'm running into errors
I tried to pip install all the dependencies individually but where I'm tripping up is in the install of pyproj.
I installed PROJ using brew install proj and that worked fine
When I try to pip install pyproj, I get the follow error
Building wheels for collected packages: pyproj
Building wheel for pyproj (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for pyproj (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [12 lines of output]
PROJ_DIR is set, using existing PROJ installation..
running bdist_wheel
running build
running build_py
running build_ext
building 'pyproj._geod' extension
pyproj/_geod.c:704:10: fatal error: 'geodesic.h' file not found
#include "geodesic.h"
^~~~~~~~~~~~
1 error generated.
error: command '/usr/bin/clang' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pyproj
Failed to build pyproj
ERROR: Could not build wheels for pyproj, which is required to install pyproject.toml-based projects
Any help would be much appreciated
At the moment, installing geopandas on M1 macs can be achieved via conda or pip+homebrew.
GeoPandas itself is written in pure Python, so there is no issue running that on any architecture. However, it depends on other libraries that are written in other languages (C, C++) that need to be compiled specifically for M1 chips. While you could compile it yourself, I am not going to cover this option as it is not user friendly.
There are three possible sources of required libraries - pip wheels, conda-forge, and Homebrew.
When a Python package requires C dependency, it can create wheels with the dependency compiled for each system and chip architecture. See for example pygeos - https://pypi.org/project/pygeos/#files. What you need is *macosx_11_0_arm64.whl . If your package doesn't offer it, you have to find another way of installing than pip. Since GeoPandas requires shapely and fiona (among others) that do not have these wheels, you should look elsewhere - either on conda-forge or Homebrew. Below are both options tested as of today.
Conda and conda-forge way (recommended)
Conda-forge currently has all packages geopandas needs
Install M1 version of miniforge or mambaforge. It can be downloaded from here - https://github.com/conda-forge/miniforge.
conda install -c conda-forge geopandas pygeos
Note: if you install x86 (Intel) version of conda, it will run under Rosetta2 and install all packages using x86 architecture, meaning that everything will run under emulation. Try to avoid that.
Pip and Homebrew way
Homebrew can install C libraries compiled for M1. Python packages will find and use them.
Using an environment with Python 3.9
Install shapely:
brew install geos
export DYLD_LIBRARY_PATH=/opt/homebrew/opt/geos/lib/
pip install shapely
DYLD_LIBRARY_PATH is needed for shapely to find GEOS installation.
Install fiona:
brew install gdal
pip install fiona
Install pyproj:
brew install proj
pip install pyproj
Install geopandas and pygeos for speedups:
pip install pygeos
pip install geopandas
Note that this is a copy&paste of my own explanation given in https://github.com/geopandas/geopandas/issues/1816#issuecomment-1003093329.
Related https://github.com/pyproj4/pyproj/issues/1027
I was stuck with the same problem, I also tried setting the environment values for PROJ_DIR, PROJ_LIBDIR, PROJ_INCDIR but perhaps setting the values is causing the error, so closed the terminal and tried again and was able to install correctly

How can I install GRPCIO on an Apple M1 Silicon laptop?

Every time I try to install a pip package with GRPCIO as a dependency inside a .direnv project I get a build failure due to my architecture being arm64. How can I work around this while waiting for the GRPCIO crew to release an update?
Using cached grpcio-1.34.0.tar.gz (21.0 MB)
ERROR: Command errored out with exit status 1:
command: /Users/yoav/Library/Caches/pypoetry/virtualenvs/orca-g6p4a6cZ-py3.8/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/jj/r3j0p91s2qgdpcpf5ptqr9qm0000gn/T/pip-install-n05vw0u0/grpcio_103d947f24954cde8b8a019b4c9f88fe/setup.py'"'"'; __file__='"'"'/private/var/folders/jj/r3j0p91s2qgdpcpf5ptqr9qm0000gn/T/pip-install-n05vw0u0/grpcio_103d947f24954cde8b8a019b4c9f88fe/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/jj/r3j0p91s2qgdpcpf5ptqr9qm0000gn/T/pip-pip-egg-info-z41yqiw6
cwd: /private/var/folders/jj/r3j0p91s2qgdpcpf5ptqr9qm0000gn/T/pip-install-n05vw0u0/grpcio_103d947f24954cde8b8a019b4c9f88fe/
Complete output (10 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/jj/r3j0p91s2qgdpcpf5ptqr9qm0000gn/T/pip-install-n05vw0u0/grpcio_103d947f24954cde8b8a019b4c9f88fe/setup.py", line 359, in <module>
if mac_target and (pkg_resources.parse_version(mac_target) <
File "/Users/yoav/Library/Caches/pypoetry/virtualenvs/orca-g6p4a6cZ-py3.8/lib/python3.8/site-packages/pkg_resources/__init__.py", line 113, in parse_version
return packaging.version.Version(v)
File "/Users/yoav/Library/Caches/pypoetry/virtualenvs/orca-g6p4a6cZ-py3.8/lib/python3.8/site-packages/pkg_resources/_vendor/packaging/version.py", line 275, in __init__
match = self._regex.search(version)
TypeError: expected string or bytes-like object
ASM Builds for BoringSSL currently not supported on: macosx-11-arm64
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
This seems to work well, do the following in the terminal
export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1
export GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1
And then install whatever package that you wanted to install, in my case I was trying to install firebase admin and I had to run the following
pip install firebase-admin
Or just run the below command if you just want to install grpcio
pip install grpcio
I found this thread helpful to understand this issue in detail
https://github.com/grpc/grpc/issues/25082
CFLAGS="-I /opt/homebrew/opt/openssl/include" LDFLAGS="-L /opt/homebrew/opt/openssl/lib" GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1 GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1 pip install -r requirements.txt
this works for me in my mac book pro M1 bigsur.
Thanks for the solution
I found a solution that works taking from https://github.com/grpc/grpc/issues/25082 with more detail and the removal of certain unnecessary steps. Note that this only works on python version 3.9 as of this post date.
First, install pyenv and pyenv-virtualenv.
brew install pyenv pyenv-virtualenv
Note that you might need to futz with the shell evaluation variable as simply adding eval "$(pyenv init -)" does not seem to work on the Apple M1 computers. Instead, run the following
pyenv init - >> .zshrc
pyenv virtualenv-init - >> .zshrc
Then go to your python project directory and create an .envrc and register it with direnv
echo 'layout pyenv 3.9.1' > .envrc
direnv allow
Next there install your requirements.txt via
GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1 GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1 pip install -r requirements.txt
Collecting google-cloud-pubsub
Using cached google_cloud_pubsub-2.3.0-py2.py3-none-any.whl (210 kB)
Collecting proto-plus>=1.7.1
Using cached proto_plus-1.17.0-py3-none-any.whl (42 kB)
Collecting grpc-google-iam-v1<0.13dev,>=0.12.3
Using cached grpc-google-iam-v1-0.12.3.tar.gz (13 kB)
Collecting libcst>=0.3.10
Using cached libcst-0.3.17-py3-none-any.whl (507 kB)
Collecting google-api-core[grpc]<2.0.0dev,>=1.22.2
Using cached google_api_core-1.26.1-py2.py3-none-any.whl (92 kB)
Collecting protobuf>=3.12.0
Using cached protobuf-3.15.6-py2.py3-none-any.whl (173 kB)
Collecting grpcio<2.0.0dev,>=1.0.0
Using cached grpcio-1.36.1.tar.gz (21.5 MB)
Collecting googleapis-common-protos[grpc]<2.0.0dev,>=1.5.2
Using cached googleapis_common_protos-1.53.0-py2.py3-none-any.whl (198 kB)
Collecting typing-inspect>=0.4.0
Using cached typing_inspect-0.6.0-py3-none-any.whl (8.1 kB)
Processing /Users/rkmacmini/Library/Caches/pip/wheels/b7/a5/c4/504d913c2a55bb09c607541578ec5f844d1ff33467abe93ba5/PyYAML-5.4.1-cp39-cp39-macosx_11_0_arm64.whl
Collecting typing-extensions>=3.7.4.2
Using cached typing_extensions-3.7.4.3-py3-none-any.whl (22 kB)
Collecting six>=1.13.0
Using cached six-1.15.0-py2.py3-none-any.whl (10 kB)
Collecting google-auth<2.0dev,>=1.21.1
Using cached google_auth-1.27.1-py2.py3-none-any.whl (136 kB)
Collecting pytz
Using cached pytz-2021.1-py2.py3-none-any.whl (510 kB)
Requirement already satisfied: setuptools>=40.3.0 in ./.direnv/python-3.9.1/lib/python3.9/site-packages (from google-api-core[grpc]<2.0.0dev,>=1.22.2->google-cloud-pubsub->-r requirements.txt (line 1)) (49.2.1)
Collecting packaging>=14.3
Using cached packaging-20.9-py2.py3-none-any.whl (40 kB)
Collecting requests<3.0.0dev,>=2.18.0
Using cached requests-2.25.1-py2.py3-none-any.whl (61 kB)
Collecting mypy-extensions>=0.3.0
Using cached mypy_extensions-0.4.3-py2.py3-none-any.whl (4.5 kB)
Collecting pyasn1-modules>=0.2.1
Using cached pyasn1_modules-0.2.8-py2.py3-none-any.whl (155 kB)
Collecting cachetools<5.0,>=2.0.0
Using cached cachetools-4.2.1-py3-none-any.whl (12 kB)
Collecting rsa<5,>=3.1.4; python_version >= "3.6"
Using cached rsa-4.7.2-py3-none-any.whl (34 kB)
Collecting pyparsing>=2.0.2
Using cached pyparsing-2.4.7-py2.py3-none-any.whl (67 kB)
Collecting idna<3,>=2.5
Using cached idna-2.10-py2.py3-none-any.whl (58 kB)
Collecting urllib3<1.27,>=1.21.1
Downloading urllib3-1.26.4-py2.py3-none-any.whl (153 kB)
|████████████████████████████████| 153 kB 1.1 MB/s
Collecting certifi>=2017.4.17
Using cached certifi-2020.12.5-py2.py3-none-any.whl (147 kB)
Collecting chardet<5,>=3.0.2
Using cached chardet-4.0.0-py2.py3-none-any.whl (178 kB)
Collecting pyasn1<0.5.0,>=0.4.6
Using cached pyasn1-0.4.8-py2.py3-none-any.whl (77 kB)
Using legacy 'setup.py install' for grpc-google-iam-v1, since package 'wheel' is not installed.
Using legacy 'setup.py install' for grpcio, since package 'wheel' is not installed.
Installing collected packages: six, protobuf, proto-plus, grpcio, googleapis-common-protos, grpc-google-iam-v1, mypy-extensions, typing-extensions, typing-inspect, pyyaml, libcst, pyasn1, pyasn1-modules, cachetools, rsa, google-auth, pytz, pyparsing, packaging, idna, urllib3, certifi, chardet, requests, google-api-core, google-cloud-pubsub
Running setup.py install for grpcio ... done
Running setup.py install for grpc-google-iam-v1 ... done
Successfully installed cachetools-4.2.1 certifi-2020.12.5 chardet-4.0.0 google-api-core-1.26.1 google-auth-1.27.1 google-cloud-pubsub-2.3.0 googleapis-common-protos-1.53.0 grpc-google-iam-v1-0.12.3 grpcio-1.36.1 idna-2.10 libcst-0.3.17 mypy-extensions-0.4.3 packaging-20.9 proto-plus-1.17.0 protobuf-3.15.6 pyasn1-0.4.8 pyasn1-modules-0.2.8 pyparsing-2.4.7 pytz-2021.1 pyyaml-5.4.1 requests-2.25.1 rsa-4.7.2 six-1.15.0 typing-extensions-3.7.4.3 typing-inspect-0.6.0 urllib3-1.26.4
NOTE: Some references say you need to point your CFLAGS, etc, at the brew installed openssl locations but that has not seemed necessary for me. If you have issue you can try the command with the CFLAGS enabled via
CFLAGS="-I /opt/homebrew/opt/openssl/include" LDFLAGS="-L /opt/homebrew/opt/openssl/lib" GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1 GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1 pip install -r requirements.txt
There's a much simpler and more reliable option:
pip uninstall grpcio
conda install grpcio
Unfortunately, Google does not provide grpcio wheels built for Apple Silicon Macs. As you see from this issue, users have come up with a variety of compiler flags to compile the library on M1, which don't always work.
Tired of these problems, I published the grpcio-mac-arm-build repository, which contains a daily GitHub Actions job that compiles the latest stable grpcio and grpcio-tools releases for Apple Silicon. The compiled wheels for Python 3.8, 3.9, 3.10, and 3.11 are available for download in the "Releases" page. Everything is open sourced and released with the same license of the grpcio library. This way, you don't need to compile the library at all.
After many attempts, I finally got it installed by running these commands:
xcode-select --install
brew install openssl re2
export LDFLAGS="-L$(/opt/homebrew/bin/brew --prefix openssl)/lib -L$(/opt/homebrew/bin/brew --prefix re2)/lib"
export CPPFLAGS="-I$(/opt/homebrew/bin/brew --prefix openssl)/include -I$(/opt/homebrew/bin/brew --prefix re2)/include"
GRPC_BUILD_WITH_BORING_SSL_ASM=""
GRPC_PYTHON_BUILD_SYSTEM_RE2=true
GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=true
GRPC_PYTHON_BUILD_SYSTEM_ZLIB=true
pip install grpcio
Taken from here: https://candid.technology/error-command-usr-bin-clang-failed-with-exit-code-1/
I manage to get it work without changing any variable in my OS. This seems to be to do with python version issue.. i was using 3.7.12 failed. 3.8.12 failed. Finally, 3.10.2 got this package installed.
None of the suggestion worked for me. What worked is below (assuming you have homebrew installed):
Run brew install miniconda (follow through with - conda init "$(basename "${SHELL}")", as instructed.)
Either source your ~/.zshrc or kill your terminal and reopen.
Run conda create --name myenv python=3.10.
Run conda activate myenv.
Run pip install grpcio.
This has brew install the correct arm64 conda env in step 1, hence the rest is doable.
The following settings worked for me,
Used https://asdf-vm.com/ to install and manage my python
Used https://direnv.net and created $PWD/.envrc with just one line
layout python
Made sure I installed latest python 3.9 using asdf
asdf plugin-add python
asdf install python 3.9.15
Then did,
direnv allow .
That should create a python venv under $PWD/.direnv, then did
pip install -U pip wheel grpcio
IMPORTANT: Python versions other than 3.9.x did not work for my e.g. 3.10 fails with some clang issue

How to install Ansible 2.4.x with Brew on MacOS Sierra

brew install ansible installs the current version of Ansible (2.5.x as of this writing). I have an application that requires version 2.4, and does not work with earlier or later versions. brew search ansible results in the following:
==> Searching local taps...
ansible ✔ ansible-lint ansible#2.0
ansible-cmdb ansible#1.9 terraform-provisioner-ansible
==> Searching taps on GitHub...
homebrew/cask/ansible-dk
==> Searching blacklisted, migrated and deleted formulae...
Installing ansible#2.0 gives me version 2.3.
How do you install version 2.4?
Attempting to install with easy_install + pip results in this which is reportedly caused by a TLS bug with MacOS Sierra 10.12.
➜ ~ sudo easy_install pip
Searching for pip
Reading https://pypi.python.org/simple/pip/
Download error on https://pypi.python.org/simple/pip/: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) -- Some packages may not be found!
Couldn't find index page for 'pip' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
Download error on https://pypi.python.org/simple/: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) -- Some packages may not be found!
No local packages or download links found for pip
error: Could not find suitable distribution for Requirement.parse('pip')
This is the way I have in my Mac:
First install python with brew: brew install python. This will install python 3.6.5:
==> Downloading https://homebrew.bintray.com/bottles/python-3.6.5.high_sierra.bottle.1.tar.gz
Already downloaded: /Users/imjoseangel/Library/Caches/Homebrew/python-3.6.5.high_sierra.bottle.1.tar.gz
==> Pouring python-3.6.5.high_sierra.bottle.1.tar.gz
==> /usr/local/Cellar/python/3.6.5/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-scripts=/usr/local/Cellar/
==> /usr/local/Cellar/python/3.6.5/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-scripts=/usr/local/Cellar/
==> /usr/local/Cellar/python/3.6.5/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-scripts=/usr/local/Cellar/
==> Caveats
Python has been installed as
/usr/local/bin/python3
Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to
`python3`, `python3-config`, `pip3` etc., respectively, have been installed into
/usr/local/opt/python/libexec/bin
If you need Homebrew's Python 2.7 run
brew install python#2
Pip, setuptools, and wheel have been installed. To update them run
pip3 install --upgrade pip setuptools wheel
You can install Python packages with
pip3 install <package>
They will install into the site-package directory
/usr/local/lib/python3.6/site-packages
See: https://docs.brew.sh/Homebrew-and-Python
==> Summary
🍺 /usr/local/Cellar/python/3.6.5: 4,736 files, 99.2MB
From there, install virtualenv with pip3 install virtualenv:
Collecting virtualenv
Using cached https://files.pythonhosted.org/packages/b6/30/96a02b2287098b23b875bc8c2f58071c35d2efe84f747b64d523721dc2b5/virtualenv-16.0.0-py2.py3-none-any.whl
Installing collected packages: virtualenv
Found existing installation: virtualenv 16.0.0
Uninstalling virtualenv-16.0.0:
Successfully uninstalled virtualenv-16.0.0
Successfully installed virtualenv-16.0.0
Create your environment with virtualenv ansible24
Using base prefix '/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6'
New python executable in /Users/imjoseangel/Source/ansible24/bin/python3.6
Also creating executable in /Users/imjoseangel/Source/ansible24/bin/python
Installing setuptools, pip, wheel...done.
Activate your environment - source ansible24/bin/activate
And Install Ansible 2.4 - pip install ansible==2.4.0
Collecting ansible==2.4.0
Downloading https://files.pythonhosted.org/packages/1e/7c/385ccbeb0fbefc13eaef53df76e42ef778170bdfe5fd425879735b43106e/ansible-2.4.0.0.tar.gz (6.6MB)
100% |████████████████████████████████| 6.6MB 4.3MB/s
Collecting jinja2 (from ansible==2.4.0)
Using cached https://files.pythonhosted.org/packages/7f/ff/ae64bacdfc95f27a016a7bed8e8686763ba4d277a78ca76f32659220a731/Jinja2-2.10-py2.py3-none-any.whl
Collecting PyYAML (from ansible==2.4.0)
Collecting paramiko (from ansible==2.4.0)
Using cached https://files.pythonhosted.org/packages/3e/db/cb7b6656e0e7387637ce850689084dc0b94b44df31cc52e5fc5c2c4fd2c1/paramiko-2.4.1-py2.py3-none-any.whl
Collecting cryptography (from ansible==2.4.0)
Using cached https://files.pythonhosted.org/packages/40/87/acdcf84ce6d25a7db1c113f4b9b614fd8d707b7ab56fbf17cf18cd26a627/cryptography-2.2.2-cp34-abi3-macosx_10_6_intel.whl
Requirement already satisfied: setuptools in ./ansible24/lib/python3.6/site-packages (from ansible==2.4.0) (39.2.0)
Collecting MarkupSafe>=0.23 (from jinja2->ansible==2.4.0)
Collecting pyasn1>=0.1.7 (from paramiko->ansible==2.4.0)
Using cached https://files.pythonhosted.org/packages/a0/70/2c27740f08e477499ce19eefe05dbcae6f19fdc49e9e82ce4768be0643b9/pyasn1-0.4.3-py2.py3-none-any.whl
Collecting bcrypt>=3.1.3 (from paramiko->ansible==2.4.0)
Using cached https://files.pythonhosted.org/packages/7e/59/d48fd712941da1a5d6490964a37bb3de2e526965b6766273f6a7049ee590/bcrypt-3.1.4-cp36-cp36m-macosx_10_6_intel.whl
Collecting pynacl>=1.0.1 (from paramiko->ansible==2.4.0)
Using cached https://files.pythonhosted.org/packages/74/8e/a6c0d340972d9e2f1a405aaa3f2460950b4c0337f92db0291a4355974529/PyNaCl-1.2.1-cp36-cp36m-macosx_10_6_intel.whl
Collecting cffi>=1.7; platform_python_implementation != "PyPy" (from cryptography->ansible==2.4.0)
Using cached https://files.pythonhosted.org/packages/8e/be/40b1bc2c3221acdefeb9dab6773d43cda7543ed0d8c8df8768f05af2d01e/cffi-1.11.5-cp36-cp36m-macosx_10_6_intel.whl
Collecting asn1crypto>=0.21.0 (from cryptography->ansible==2.4.0)
Using cached https://files.pythonhosted.org/packages/ea/cd/35485615f45f30a510576f1a56d1e0a7ad7bd8ab5ed7cdc600ef7cd06222/asn1crypto-0.24.0-py2.py3-none-any.whl
Collecting idna>=2.1 (from cryptography->ansible==2.4.0)
Using cached https://files.pythonhosted.org/packages/27/cc/6dd9a3869f15c2edfab863b992838277279ce92663d334df9ecf5106f5c6/idna-2.6-py2.py3-none-any.whl
Collecting six>=1.4.1 (from cryptography->ansible==2.4.0)
Using cached https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Collecting pycparser (from cffi>=1.7; platform_python_implementation != "PyPy"->cryptography->ansible==2.4.0)
Building wheels for collected packages: ansible
Running setup.py bdist_wheel for ansible ... done
Stored in directory: /Users/imjoseangel/Library/Caches/pip/wheels/ea/e1/f4/f5654529457978b69c0369212794664b88b51c95fa267346ea
Successfully built ansible
Installing collected packages: MarkupSafe, jinja2, PyYAML, pyasn1, pycparser, cffi, asn1crypto, idna, six, cryptography, bcrypt, pynacl, paramiko, ansible
Successfully installed MarkupSafe-1.0 PyYAML-3.12 ansible-2.4.0.0 asn1crypto-0.24.0 bcrypt-3.1.4 cffi-1.11.5 cryptography-2.2.2 idna-2.6 jinja2-2.10 paramiko-2.4.1 pyasn1-0.4.3 pycparser-2.18 pynacl-1.2.1 six-1.11.0

Resources