Installing Octoprint For Os X

Octoprint-cli version - get OctoPrint server version information. Octoprint-cli continuous - get continuous refreshing temperature, layer, and print status. Octoprint-cli print status - get current print job status. Octoprint-cli print select path - load file on server. Octoprint-cli print start - start print job on loaded file. Installing OctoPrint should be done within a virtual environment, rather than an OS wide install, to help prevent dependency conflicts. To setup Python, dependencies and the virtual environment, run: cd sudo apt update sudo apt install python3-pip python3-dev python3-setuptools python3-venv git libyaml-dev build-essential mkdir OctoPrint. The official MakerOS OctoPrint plugin will allow you to interface with your MakerOS projects from within OctoPrint. Once installed you will be able to query your projects and download both.gcode and.STL files from your projects to your OctoPrint instance. On the initial call to the MakerOS API a MakerOS folder will be created in your files.

Installing OctoPrint should be done within a virtual environment, rather than an OS wide install, to help prevent dependency conflicts. To setup Python, dependencies and the virtual environment, run: cd sudo apt update sudo apt install python3-pip python3-dev python3-setuptools python3-venv git libyaml-dev build-essential mkdir OctoPrint && cd OctoPrint python3 -m venv venv source venv/bin/activate.

Obtaining, building and running the source¶

Installing Octoprint For Os X Windows 10

This describes the general, platform agnostic steps in obtaining, building and running. OS specific instructions can be foundbelow.

  • Prerequisites:

    • Python 3.7 including pip, setuptools and virtualenv

    • Python 2.7 including pip, setuptools and virtualenv

  • Checkout the OctoPrint sources from their Git repository:

    • gitclonehttps://github.com/OctoPrint/OctoPrint.git

  • Enter the checked out source folder: cdOctoPrint

  • Create virtual environments in the checked out source folder for both Python 2 and Python 3 to use forinstalling and running OctoPrint and its dependencies. Creating virtual environments avoids potential versioningissues for the dependencies with system wide installed instances:

    • PY3: virtualenv--python=python3venv3

    • PY2: virtualenv--python=python2venv2

    Note

    This assumes that python2 and python3 are binaries available directly on your PATH. If your Python 2 and 3binaries cannot be found on your PATH like this you’ll need to specify the full paths to them here,e.g. virtualenv--python=/path/to/python2/bin/pythonvenv2

  • Activate one of the virtual environments (the Python 3 venv should be considered theprimary one at this point):

    • PY3: sourcevenv3/bin/activate (Linux, macOS) or sourcevenv3/Scripts/activate (Git Bash under Windows, see below)

    • PY2: sourcevenv2/bin/activate (Linux, macOS) or sourcevenv2/Scripts/activate (Git Bash under Windows, see below)

  • Update pip in the virtual environment:

  • Install OctoPrint in “editable” mode,including its regular and development and plugin development dependencies:

    • pipinstall-e'.[develop,plugins]'

  • Set up the pre-commit hooks that make sure any changes you do adhere to the styling rules:

  • Tell git where to find the file with revisions to exclude for gitblame:

    • gitconfigblame.ignoreRevsFile.git-blame-ignore-revs

When the virtual environment is activated you can then:

  • run the OctoPrint server via octoprintserve

  • run the test suite from the checked out source folder via pytest

  • trigger the pre-commit check suite manually from the checked out source folder viapre-commitrun--hook-stagemanual--all-files

To switch the activated virtual environment, simply activate the new environment as described above.

To deactivate the virtual environment and return to the system’s default Python: deactivate.

If you also want to be able to build the documentation that resides in the docs subfolder, you need to activatethe Python 3 environment and install the docs dependencies as well:

For

Installing Octoprint For Os X Os

  • sourcevenv3/bin/activate (Linux, macOS) or sourcevenv3/Scripts/activate (Git Bash under Windows, see below)

  • pipinstall-e'.[develop,plugins,docs]'

Go to the directory docs and you can then build the documentation:

The documentation will be available in the newly created _build directory. You can simply browse it locally by opening index.html

Linux¶

This assumes you’ll host your OctoPrint development checkout at ~/devel/OctoPrint. If you want to use a differentlocation, please substitute accordingly.

First make sure you have python 2 and 3 including their header files, pip, setuptools, virtualenv, git and some build requirementsinstalled:

  • On apt based distributions (e.g. Debian, Ubuntu, …):

Todo

Using a Linux distribution that doesn’t use apt? Please send aPull Request to get the necessarysteps into this guide!

Then:

You can then start OctoPrint via octoprint after activating one of the two virtual environments.

Windows¶

Installing Octoprint

Octoprint

This assumes you’ll host your OctoPrint development checkout at C:DevelOctoPrint. If you want to use a differentlocation, please substitute accordingly.

First download & install:

  • Latest *stable* Python 2.7 and Python 3.8 releases from python.org(at the time of writing those are 2.7.18 and 3.8.7)

    • make sure to have the installer add Python to the PATH and have it install pip too

    • it’s recommended to install Python 2.7 into C:Python27 and Python 3 into C:Python38 - if you selectdifferent install locations please substitute accordingly

    • it’s also recommended to have both versions get installed for all users

    • install “C++ build tools” and ensure the latest versions of “MSVCv142 - VS 2019 C++ x64/x86 build tools” and“Windows 10 SDK” are checked under individual components.

Open the Git Bash you just installed and in that:

Optional but recommended tools¶

These are some tools that are recommended but not required to have on hand:

  • Add the following profile to profiles.list in the settings, that will allow you toeasily start Git Bash from the terminal:

Mac OS X¶

Note

This guide is based on the Setup Guide for Mac OS X on OctoPrint’s Community Forum.Please report back if it works for you, due to lack of access to a Mac I cannot test it myself. Thanks.

Todo

This guide is not yet adapted to the concurrent use of Python 2 and 3 environments during development. Please send aPull Request to get the necessarysteps into this guide!

This assumes you’ll host your OctoPrint development checkout at ~/devel/OctoPrint. If you want to use a differentlocation, please substitute accordingly.

Installing Octoprint For Os Xml

You’ll need a user account with administrator privileges.

  • Install the latest version of Xcode suitable for your OS. For example, OS X 10.11 (El Capitan) requires Xcode 7.

  • Install Xcode’s command line tools:

    • xcode-select--install

    • sudoxcodebuild (ensure the license was accepted)

    • If you have more than one Xcode installed: sudoxcode-select-s/Applications/Xcode.app/Contents/Developer

  • Install Homebrew and use that to install Python:

    • ruby-e'$(curl-fsSLhttps://raw.githubusercontent.com/Homebrew/install/master/install)'

    • brewinstallpython

  • Install virtualenv

    • pipinstallvirtualenv

  • Install OctoPrint

IDE Setup¶

Todo

Installing Octoprint For Os X Download

Using another IDE than the ones below? Please send aPull Request to get the necessarysteps into this guide!

PyCharm¶

  • “File” > “Open …”, select OctoPrint checkout folder (e.g. ~/devel/OctoPrint or C:DevelOctoPrint)

  • Register virtual environments:

    • (Linux, Windows) “File” > “Settings …” > “Project: OctoPrint” > “Project Interpreter” > “Add local …”,select OctoPrint venv2 folder (e.g. ~/devel/OctoPrint/venv2 or C:DevelOctoPrintvenv2).

    • (macOS) “PyCharm” > “Preferences …” > “Project: OctoPrint” > “Project Interpreter” > “Add …” >“Virtualenv Environment > “Existing Environment”, select OctoPrint venv2 folder (e.g. ~/devel/OctoPrint/venv2).

    Repeat for the venv3 folder.

  • Right click “src” in project tree, mark as source folder

  • Add Run/Debug Configuration, select “Python”:

    • Name: OctoPrint server

    • Module name: octoprint

    • Parameters: serve--debug

    • Project: OctoPrint

    • Python interpreter: Project Default

    • Working directory: the OctoPrint checkout folder (e.g. ~/devel/OctoPrint or C:DevelOctoPrint)

    • If you want build artifacts to be cleaned up on run (recommended): “Before Launch” > “+” > “Run external tool” > “+”

      • Name: Clean build directory

      • Program: $ModuleSdkPath$

      • Parameters: setup.pyclean

      • Working directory: $ProjectFileDir$

    • If you want dependencies to auto-update on run if necessary (recommended): “Before Launch” > “+” > “Run external tool” > “+”

      • Name: Update OctoPrint dependencies

      • Program: $ModuleSdkPath$

      • Parameters: -mpipinstall-e'.[develop,plugins]'

      • Working directory: $ProjectFileDir$

      Note that sadly that seems to cause some hiccups on current PyCharm versions due to $PyInterpreterDirectory$being empty sometimes, so if this fails to run on your installation, you should update your dependencies manuallyfor now.

  • Add Run/Debug Configuration, select “Python tests” and therein “pytest”:

    • Name: OctoPrint tests

    • Target: Custom

    • Project: OctoPrint

    • Python interpreter: Project Default

    • Working directory: the OctoPrint checkout folder (e.g. ~/devel/OctoPrint or C:DevelOctoPrint)

    • Just like with the run configuration for the server you can also have the dependencies auto-update on run ofthe tests, see above on how to set this up.

  • Add Run/Debug Configuration, select “Python”:

    • Name: OctoPrint docs

    • Module name: sphinx.cmd.build

    • Parameters: -v-T-E./docs./docs/_build-bhtml

    • Project: OctoPrint

    • Python interpreter: venv3 environment (the docs build requires Python 3)

    • Working directory: the OctoPrint checkout folder (e.g. ~/devel/OctoPrint or C:DevelOctoPrint)

    • Just like with the run configuration for the server you can also have the dependencies auto-update when buildingthe documentation, see above on how to set this up.

    Note that this requires you to also have installed the additional docs dependencies into the Python 3 venv asdescribed above via pipinstall-e'.[develop,plugins,docs]'.

  • Settings > Tools > File Watchers (you might have to enable this, it’s a bundled plugin), add new:

    • Name: pre-commit

    • File type: Python

    • Scope: Module ‘OctoPrint’

    • Program: <OctoPrintvenv3folder>/bin/pre-commit (Linux) or <OctoPrintvenv3folder>/Scripts/pre-commit (Windows)

    • Arguments: run--hook-stagemanual--files$FilePath$

    • Output paths to refresh: $FilePath$

    • Working directory: $ProjectFileDir$

    • disable “Auto-save edited files to trigger the watched”

    • enable “Trigger the watched on external changes”

To switch between Python 2 and 3, all you need to do now is change the Project Default Interpreter and restartOctoPrint. On current PyCharm versions you can do that right from a small selection field in the footer of the IDE.Otherwise go through Settings.

Note

Make sure you are running a PyCharm version of 2016.1 or later, or manually fixa debugger bug contained in earlier versions or plugin managementwill not work in your developer install when running OctoPrint from PyCharm in debug mode.

An OctoPrint plugin integration with the MakerOS Platform API.

This plugin requires a MakerOS business account. Pleasenote that there is no free subscription tier.

The official MakerOS OctoPrint plugin will allow you to interface with yourMakerOS projects from within OctoPrint. Once installed you will be able to queryyour projects and download both .gcode and .STL files from your projects to yourOctoPrint instance.

On the initial call to the MakerOS API a MakerOS folder will be created in yourfiles. From there, upon downloading a file, a project specific folder will becreated for you within the MakerOS folder.

Please note that downloading .STL files will require you to install theCuraEngine Legacy plugin which can be installed in the same way as you installedthe MakerOS plugin.

Setting up the plugin is simple - you may install via the Plugin Manager ormanually using this URL: https://github.com/makeros3d/Octoprint-Makeros/archive/master.zip

Once the plugin is installed it is easily configurable via the plugin’s settingsin the settings menu. All that you’ll need are your MakerOS Provider ID, APIkey, and API URL.

Pictures