Install Setuptools Mac

Setuptools & Pip¶ Homebrew installs Setuptools and pip for you. Setuptools enables you to download and install any compliant Python software over a network (usually the Internet) with a single command (easyinstall). It also enables you to add this network installation capability to your own Python software with very little work. Mar 30, 2021 Homebrew is one of the better package managers for Mac. To install Homebrew, open Terminal. (Python 3.7 currently), pip, and Setuptools. Brew install python.

setuptools is a rich and complex program. This tutorial will focus onthe bare minimum basics you need to get setuptools running so you can:

  • Register your package on pypi.
  • Build egg, source, and window installer ‘distributables’.
  • Upload these ‘distributables’ to pypi.

Installing setuptools and easy install¶

To install setuptools visit http://pypi.python.org/pypi/setuptools andfollow the instructions for your operating system. Also, check outhttp://peak.telecommunity.com/DevCenter/EasyInstall for more instructions onhow to install setup tools.

Currently (as of November, 2009), setuptools is pretty easy to install forPython version 2.3 through 2.6.

Question or issue on macOS: Trying to install a Python pip package (Django Rest Framework docs, drfdocs) on Mac OSX within a virtualenv: Here are the relevant versions of pip, python, easyinstall: $ virtualenv -version 1.11.4 $ mkvirtualenv test New python executable in test/bin/python Installing setuptools, pip.done. (test)$ python -version; which python Python 2.7.10 /Users/me.

Bootstrapping setuptools¶

If you are having trouble setting up setuptools for your platform, you may wantto check out the ‘bootstrap’ setuptools script athttp://peak.telecommunity.com/dist/ez_setup.py.

You can run this like this:

and it will install setuptools for whichever version of Python pythonrefers to. For example on windows:

Install setuptools mac operating system

will install a setuptools for your python24 distribution.

Setting up setup.py

All the features of what can go into a setup.py file is beyond thescope of this simple tutorial. I’ll just focus on a very basic and commonformat needed to get this project onto pypi.

The contents of setup.py is just pure python:

Directory Structure¶

The directory structure, so far, should look like this:

README¶

A nice idea stolen from http://pypi.python.org/pypi/Sphinx-PyPI-upload is toinclude a README text file which your code. This would be visible when someone,say, cloned your repo.

Using the simple read function, it is easy to include this in thelong_description keyword arg for the setuptools.setup() function.

Classifiers¶

A really nice website is http://pypi.python.org/pypi?%3Aaction=list_classifierswhich lists all the classifiers you can use in the setup call.

A sample of this website is:

Using setup.py

The basic usage of setup.py is:

To see all commands type:

And you will get:

Intermezzo: .pypirc file and gpg¶

In order to interact with pypi, you first need to setup an account. Go tohttp://pypi.python.org/pypi and click on Register.

Now, once registered, when you run setup.py commands that interact withpypi you’ll have to enter your username and password each time.

To get around this, place a .pypirc file in your $HOME directory onlinux. On windows, an you’ll need to set a HOME environ var to point tothe directory where this file lives.

The structure of a .pypirc file is pretty simple:

Note

There’s probably away around having your plain text password in this file,but I don’t know of the solution and haven’t looked into it.

Also, you often want to sign the files using gpg encryption. Visithttp://www.gnupg.org/ on linux or http://www.gpg4win.org/ on windows to installthis software.

Registering Your Project¶

With your setup.py and .pypirc in place, registering your project ispretty simple. Just type:

I would say more, but it is just that simple.

Uploading Your Project¶

There are three major setup.py commands we will use:

  • bdist_egg: This creates an egg file. This is what is necessary sosomeone can use easy_installyour_project.
  • bdist_wininst: This will create an .exe that will install your projecton a windows machine.
  • sdist: This create a raw source distribution which someone can downloadand run pythonsetup.py directly.

Note

A key point here is you need to run these commands withthe version of python you want to support. We’ll cover this in thePutting It All Together With The Full Windows Script below.

You can run these commands by themselves and simply create the files but notupload them. However, for this project, we always marry these commands withthe upload directive which will both build and upload the necessaryfiles.

Putting It All Together With The Full Windows Script¶

This project was build on a windows machine. To best understand how it all worksand the other options used when using setup.py let’s just look at the.bat file I use to build the package and upload it to pypi:

For linux, it would be pretty much the same commands, just changing aroundthe directories to point to the correct python versions.

Note

I use the setHOME=C:UsersOwner instead of setting an environ variable on windows

Warning

This documentation is based off of the pre-release mainline branch which may have frequent API breaking changes.

Most users should instead reference the stable release documentation.

Install Setuptools Mac

Note

AutoGluon requires Python version 3.6, 3.7, or 3.8 (3.8 support is experimental).Linux and Mac are the only operating systems fully supported for now (Windows version will be available soon).For troubleshooting the installation process, you can check the Installation FAQ.

Select your preferences below and run the corresponding install commands:

Version:PIPSource

Install Setuptools Mac

Command:

Note

If you don’t have them, please first install:XCode, Homebrew, LibOMP.Once you have Homebrew, LibOMP can be installed via:

Note

GPU usage is not yet supported on Mac OSX, please use Linux to utilize GPUs in AutoGluon.

Note

If you don’t have them, please first install:XCode, Homebrew, LibOMP.Once you have Homebrew, LibOMP can be installed via:

Note

GPU usage is not yet supported on Mac OSX , please use Linux to utilize GPUs in AutoGluon.

AutoGluon is modularized into sub-modules specialized for tabular, text, or image data. You can reduce the number of dependencies required by solely installing a specific sub-module via: python3 -m pip install <submodule>, where <submodule> may be one of the following options:

  • autogluon.tabular - only functionality for tabular data (TabularPredictor)
    • The default installation of autogluon.tabular standalone is a skeleton installation.

    • Install via pip install autogluon.tabular[all] to get the same installation of tabular as via pip install autogluon

    • Available optional dependencies: lightgbm,catboost,xgboost,fastai. These are included in all.

    • To run autogluon.tabular with only the optional LightGBM and CatBoost models for example, you can do: pip install autogluon.tabular[lightgbm,catboost]

    • Experimental optional dependency: skex. This will speedup KNN models by 25x in training and inference on CPU. Use pip install autogluon.tabular[all,skex] to enable, or pip install “scikit-learn-intelex<2021.3” after a standard installation of AutoGluon.

  • autogluon.vision - only functionality for computer vision (ImagePredictor, ObjectDetector)

  • autogluon.text - only functionality for natural language processing (TextPredictor)

  • autogluon.core - only core functionality (Searcher/Scheduler) useful for hyperparameter tuning of arbitrary code/models.

  • autogluon.features - only functionality for feature generation / feature preprocessing pipelines (primarily related to Tabular data).

  • autogluon.extra - miscellaneous extra functionality such as Efficient Neural Architecture Search

  • autogluon.mxnet - miscellaneous extra MXNet functionality.

To install a submodule from source, follow the instructions for installing the entire package from source but replace the line cd autogluon && ./full_install.sh with cd autogluon && python3 -m pip install -e {SUBMODULE_NAME}/{OPTIONAL_DEPENDENCIES}

Install Setuptools Mac Catalina

  • For example, to install autogluon.tabular[lightgbm,catboost] from source, the command would be: cd autogluon && python3 -m pip install -e tabular/[lightgbm,catboost]