Homebrew Anaconda



Anaconda Easy Button - Microsoft SQL Server and Python May 09, 2017. Python on a Mac to connect to SQL Server, however with Microsoft's renewed support for Python and Microsoft's own Mac Homebrew packages it is now the case that pyodbc is the leader. Anaconda is a package manager, an environment manager, and Python distribution that contains a collection of many open source packages. An installation of Anaconda comes with many packages such as numpy, scikit-learn, scipy, and pandas preinstalled and is also the recommended way to install Jupyter Notebooks.This tutorial will include.

  1. Homebrew Anaconda アンインストール
  2. Homebrew Anaconda Conflict
  3. Anaconda Python

Note

Anaconda

Using Anaconda in a commercial setting? You may need to purchase a license to stay compliant with our Terms of Service. This can be accomplished through Anaconda Commercial Edition, Anaconda Team Edition, or Anaconda Enterprise. If you have already purchased Commercial Edition, please proceed to the Authenticating Commercial Edition section after completing your installation here.

Haven’t purchased Commercial Edition yet? Visit https://anaconda.cloud/register to get started.

Prerequisites¶

To use GUI packages with Linux, you will need to install the following extended dependencies for Qt:

Debianapt-getinstalllibgl1-mesa-glxlibegl1-mesalibxrandr2libxrandr2libxss1libxcursor1libxcomposite1libasound2libxi6libxtst6
RedHatyuminstalllibXcompositelibXcursorlibXilibXtstlibXrandralsa-libmesa-libEGLlibXdamagemesa-libGLlibXScrnSaver
ArchLinuxpacman-Sylibxaulibxilibxsslibxtstlibxcursorlibxcompositelibxdamagelibxfixeslibxrandrlibxrendermesa-libglalsa-liblibglvnd
OpenSuse/SLESzypperinstalllibXcomposite1libXi6libXext6libXau6libX11-6libXrandr2libXrender1libXss1libXtst6libXdamage1libXcursor1libxcb1libasound2libX11-xcb1Mesa-libGL1Mesa-libEGL1
Gentooemergex11-libs/libXaux11-libs/libxcbx11-libs/libX11x11-libs/libXextx11-libs/libXfixesx11-libs/libXrenderx11-libs/libXix11-libs/libXcompositex11-libs/libXrandrx11-libs/libXcursorx11-libs/libXdamagex11-libs/libXScrnSaverx11-libs/libXtstmedia-libs/alsa-libmedia-libs/mesa

Installation¶

For x86 systems.

  1. In your browser, download the Anaconda installer for Linux.

  2. RECOMMENDED: Verify data integrity with SHA-256.For more information on hashes, see What about cryptographic hash verification?

    • Open a terminal and run the following:

  3. Enter the following to install Anaconda for Python 3.7:

    OR Enter the following to install Anaconda for Python 2.7:

    Note

    Include the bash command regardless of whether or not you areusing Bash shell.

    Note

    If you did not download to your Downloads directory, replace~/Downloads/ with the path to the file you downloaded.

  4. The installer prompts “In order to continue the installation process,please review the license agreement.” Click Enter to view license terms.

  5. Scroll to the bottom of the license terms and enter “Yes” to agree.

  6. The installer prompts you to click Enter to accept the default install location,CTRL-C to cancel the installation, or specify an alternate installationdirectory. If you accept the default install location, the installer displays“PREFIX=/home/<user>/anaconda<2 or 3>” and continues the installation.It may take a few minutes to complete.

    Note

    We recommend you accept the default install location. Do not choose the path as /usr for theAnaconda/Miniconda installation.

  7. The installer prompts “Do you wish the installer to initialize Anaconda3by running conda init?” We recommend “yes”.

    Note

    If you enter “no”, then conda will not modify your shell scripts at all.In order to initialize after the installation process is done, first runsource<pathtoconda>/bin/activate and then run condainit.See FAQ.

  8. The installer finishes and displays “Thank you for installing Anaconda<2 or 3>!”

  9. The installer provides a link to install PyCharm for Anaconda athttps://www.anaconda.com/pycharm.

  10. Close and open your terminal window for the installation to takeeffect, or you can enter the command source~/.bashrc.

  11. To control whether or not each shell session has the base environmentactivated or not, run condaconfig--setauto_activate_baseFalseorTrue. To run conda from anywhere without having the base environmentactivated by default, use condaconfig--setauto_activate_baseFalse.This only works if you have run condainit first.

    Note

    condainit is available in conda versions 4.6.12 and later.

  12. Verify your installation.

    Note

    If you install multiple versions of Anaconda, the system defaults tothe most current version as long as you haven’t altered the default installpath.

Anaconda

What’s next?¶

Get started programming quickly with Anaconda in the Getting started with Anaconda guide.

This page describes how Python is handled in Homebrew for users. See Python for Formula Authors for advice on writing formulae to install packages written in Python.

Homebrew should work with any CPython and defaults to the macOS system Python.

Homebrew provides formulae to brew Python 3.x.

Homebrew provided a python@2 formula until the end of 2019, at which point it was removed due to the Python 2 deprecation.

Important: If you choose to use a Python which isn’t either of these two (system Python or brewed Python), the Homebrew team cannot support any breakage that may occur.

Python 3.x

Homebrew provides a formula for Python 3.x (python@3.x).

Important: Python may be upgraded to a newer version at any time. Consider using a versionmanager such as pyenv if you require stability of minor or patch versions for virtual environments.

The executables are organised as follows:

  • python3 points to Homebrew’s Python 3.x (if installed)
  • pip3 points to Homebrew’s Python 3.x’s pip (if installed)

Unversioned symlinks for python, python-config, pip etc. are installed here:

Setuptools, Pip, etc.

The Python formulae install pip (as pip3) and Setuptools.

Setuptools can be updated via pip3, without having to re-brew Python:

Similarly, pip3 can be used to upgrade itself via:

site-packages and the PYTHONPATH

The site-packages is a directory that contains Python modules (especially bindings installed by other formulae). Homebrew creates it here:

So, for Python 3.y.z, you’ll find it at /usr/local/lib/python3.y/site-packages.

Python 3.y also searches for modules in:

  • /Library/Python/3.y/site-packages
  • ~/Library/Python/3.y/lib/python/site-packages

Homebrew’s site-packages directory is first created if (1) any Homebrew formula with Python bindings are installed, or (2) upon brew install python.

Why here?

Anaconda

The reasoning for this location is to preserve your modules between (minor) upgrades or re-installations of Python. Additionally, Homebrew has a strict policy never to write stuff outside of the brew --prefix, so we don’t spam your system.

Homebrew-provided Python bindings

Anaconda

Some formulae provide Python bindings.

Warning! Python may crash (see Common Issues) if you import <module> from a brewed Python if you ran brew install <formula_with_python_bindings> against the system Python. If you decide to switch to the brewed Python, then reinstall all formulae with Python bindings (e.g. pyside, wxwidgets, pygtk, pygobject, opencv, vtk and boost-python).

Policy for non-brewed Python bindings

These should be installed via pip install <package>. To discover, you can use pip search or https://pypi.python.org/pypi.

Note: macOS’s system Python does not provide pip. Follow the pip documentation to install it for your system Python if you would like it.

Brewed Python modules

For brewed Python, modules installed with pip3 or python3 setup.py install will be installed to the $(brew --prefix)/lib/pythonX.Y/site-packages directory (explained above). Executable Python scripts will be in $(brew --prefix)/bin.

The system Python may not know which compiler flags to set in order to build bindings for software installed in Homebrew so you may need to run:

Virtualenv

Homebrew Anaconda アンインストール

WARNING: When you brew install formulae that provide Python bindings, you should not be in an active virtual environment.

Activate the virtualenv after you’ve brewed, or brew in a fresh terminal window.Homebrew will still install Python modules into Homebrew’s site-packages and not into the virtual environment’s site-package.

Virtualenv has a --system-site-packages switch to allow “global” (i.e. Homebrew’s) site-packages to be accessible from within the virtualenv.

Homebrew Anaconda Conflict

Why is Homebrew’s Python being installed as a dependency?

Anaconda Python

Formulae that declare an unconditional dependency on the 'python' formula are bottled against Homebrew’s Python 3.x and require it to be installed.