Setup on Windows

Paul de Vries edited this page Dec 4, 2016 · 20 revisions

While OctoPrint's intended use case is to be run on low-powered embedded devices with Linux, it is being developed under Windows 7 and 10 and therefore also compatible to that.

To install OctoPrint from source under Windows, you'll need to do the following:

  1. Install Python 2.7 for 32bit from here (choose the "Windows x86 MSI Installer" package). Make sure to include pip in the installation and also to have the installer add python to your path.

    Python installation dialog

  2. Install the Microsoft Visual C++ Compiler for Python 2.7 from here.

  3. Open a command prompt (Win+R and execute cmd) and install virtualenv using pip install virtualenv:

    pip install virtualenv
    

    You'll see something like the following (prompt and output included, do not copy-paste this!):

    C:\Users\YourUser>pip install virtualenv
    You are using pip version 7.0.1, however version 7.1.2 is available.
    You should consider upgrading via the 'pip install --upgrade pip' command.
    Collecting virtualenv
      Using cached virtualenv-13.1.2-py2.py3-none-any.whl
    Installing collected packages: virtualenv
    Successfully installed virtualenv-13.1.2
    

    If you get a message about pip not having been found, your PATH hasn't yet been updated to include. Do it manually for now on the active prompt by redefining PATH:

    PATH=%PATH%;C:\Python27\Scripts
    

    Do not close the window with the prompt, keep it open!

  4. Acquire OctoPrint's source, either by cloning the Git respository at https://github.com/foosel/OctoPrint.git (you can use e.g. TortoiseGit, Git for Windows or Github for Windows) to a directory in your disk or by downloading the current tarball of either the master (for the stable version) or the development branch (for a less stable version including the most recent features being developed) and unpacking it to a directory on your disk. If you are unsure, choose master. For the rest of this tutorial it is assumed you unpacked the sources to C:\OctoPrint.

  5. On the command prompt change into OctoPrint's source folder you just created (as already mentioned here that is located at C:\OctoPrint - depending on where you put OctoPrint's sources you might first have to change to another drive and the path will probably look completely different too) and create a new virtualenv: virtualenv venv. Activate it: venv\Scripts\activate.bat. Note: If you did not unpack OctoPrint's sources into C:\OctoPrint, you must change the cd command below - make sure you are in the correct folder before executing the virtualenv and activate.bat lines or it will not work.

    cd C:\OctoPrint
    virtualenv venv
    venv\Scripts\activate.bat
    

    That will looks like this (prompt and output included, do not copy-paste this!):

    C:\Users\YourUser>cd C:\OctoPrint
    C:\OctoPrint>virtualenv venv
    New python executable in venv\Scripts\python.exe
    Installing setuptools, pip, wheel...done.
    
    C:\OctoPrint>venv\Scripts\activate.bat
    (venv) C:\OctoPrint>
    

    Note: At this point it might be a good idea to make sure you have the most current version of pip installed in your venv, so better update that now:

    pip install --upgrade pip
    

  6. Perform a python setup.py install (or if you intend to make changes, python setup.py develop):

    python setup.py install
    

    That will looks like this (prompt and output included, do not copy-paste this!):

    (venv) C:\OctoPrint>python setup.py install
    running install
    [...]
    Finished processing dependencies for OctoPrint==1.2.7
    
  7. Start OctoPrint simply by executing octoprint:

    (venv) C:\OctoPrint>octoprint
    2015-11-04 11:36:45,576 - octoprint.server - INFO - Starting OctoPrint 1.2.7 (master branch)
    [...]
    

You can use something like YawCAM for similar functionality to MJPEG-Streamer under Windows. Enable the "HTTP" and "Stream" outputs. If you leave the configured ports at their defaults, your webcam configuration section in OctoPrint's config will then have to look like the following:

webcam:
  stream: http://<your PC's ip or hostname>:8081/video.mjpg
  snapshot: http://localhost:8888/out.jpg

If you also want to be able to use timelapsing, you'll have to obtain a static Windows build of FFMPEG. Those can be found here. Then configure the path to your ffmpeg.exe:

webcam:
  stream: http://<your PC's ip or hostname>:8081/video.mjpg
  snapshot: http://localhost:8888/out.jpg
  ffmpeg: C:\your\path\to\ffmpeg.exe