Error installing on Mac High Sierra

What is the problem?
I get an error during the install. The ' python setup.py install' command ends with "AttributeError: 'module' object has no attribute 'version'.

What did you already try to solve it?
I searched for the error but can't find an instance of the same problem.

Logs (octoprint.log, serial.log or output on terminal tab at a minimum, browser error console if UI issue ... no logs, no support!)

Running MarkupSafe-2.0.0a1/setup.py -q bdist_egg --dist-dir /var/folders/9d/8_dp7sss09n920nfyvx0fyh00000gn/T/easy_install-OMZdKE/MarkupSafe-2.0.0a1/egg-dist-tmp-EqhRPU
Traceback (most recent call last):
  File "setup.py", line 277, in <module>
    setup(**params())
  File "/Users/ITD/OctoPrint/venv/lib/python2.7/site-packages/setuptools/__init__.py", line 145, in setup
    return distutils.core.setup(**attrs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/Users/ITD/OctoPrint/venv/lib/python2.7/site-packages/setuptools/command/install.py", line 67, in run
    self.do_egg_install()
  File "/Users/ITD/OctoPrint/venv/lib/python2.7/site-packages/setuptools/command/install.py", line 117, in do_egg_install
    cmd.run(show_deprecation=False)
  File "/Users/ITD/OctoPrint/venv/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 424, in run
    self.easy_install(spec, not self.no_deps)
  File "/Users/ITD/OctoPrint/venv/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 666, in easy_install
    return self.install_item(None, spec, tmpdir, deps, True)
  File "/Users/ITD/OctoPrint/venv/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 713, in install_item
    self.process_distribution(spec, dist, deps)
  File "/Users/ITD/OctoPrint/venv/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 758, in process_distribution
    [requirement], self.local_index, self.easy_install
  File "/Users/ITD/OctoPrint/venv/lib/python2.7/site-packages/pkg_resources/__init__.py", line 782, in resolve
    replace_conflicting=replace_conflicting
  File "/Users/ITD/OctoPrint/venv/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1065, in best_match
    return self.obtain(req, installer)
  File "/Users/ITD/OctoPrint/venv/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1077, in obtain
    return installer(requirement)
  File "/Users/ITD/OctoPrint/venv/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 685, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "/Users/ITD/OctoPrint/venv/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 711, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File "/Users/ITD/OctoPrint/venv/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 896, in install_eggs
    return self.build_and_install(setup_script, setup_base)
  File "/Users/ITD/OctoPrint/venv/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1164, in build_and_install
    self.run_setup(setup_script, setup_base, args)
  File "/Users/ITD/OctoPrint/venv/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1150, in run_setup
    run_setup(setup_script, args)
  File "/Users/ITD/OctoPrint/venv/lib/python2.7/site-packages/setuptools/sandbox.py", line 253, in run_setup
    raise
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/contextlib.py", line 35, in __exit__
    self.gen.throw(type, value, traceback)
  File "/Users/ITD/OctoPrint/venv/lib/python2.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
    yield
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/contextlib.py", line 35, in __exit__
    self.gen.throw(type, value, traceback)
  File "/Users/ITD/OctoPrint/venv/lib/python2.7/site-packages/setuptools/sandbox.py", line 166, in save_modules
    saved_exc.resume()
  File "/Users/ITD/OctoPrint/venv/lib/python2.7/site-packages/setuptools/sandbox.py", line 141, in resume
    six.reraise(type, exc, self._tb)
  File "/Users/ITD/OctoPrint/venv/lib/python2.7/site-packages/setuptools/sandbox.py", line 154, in save_modules
    yield saved
  File "/Users/ITD/OctoPrint/venv/lib/python2.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
    yield
  File "/Users/ITD/OctoPrint/venv/lib/python2.7/site-packages/setuptools/sandbox.py", line 250, in run_setup
    _execfile(setup_script, ns)
  File "/Users/ITD/OctoPrint/venv/lib/python2.7/site-packages/setuptools/sandbox.py", line 45, in _execfile
    exec(code, globals, locals)
  File "/var/folders/9d/8_dp7sss09n920nfyvx0fyh00000gn/T/easy_install-OMZdKE/MarkupSafe-2.0.0a1/setup.py", line 56, in <module>
    "semantic_version>=2.8,<2.9",
  File "/var/folders/9d/8_dp7sss09n920nfyvx0fyh00000gn/T/easy_install-OMZdKE/MarkupSafe-2.0.0a1/setup.py", line 43, in run_setup
    "werkzeug>=0.16,<0.17",
  File "/Users/ITD/OctoPrint/venv/lib/python2.7/site-packages/setuptools/__init__.py", line 145, in setup
    return distutils.core.setup(**attrs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 124, in setup
    dist.parse_config_files()
  File "/Users/ITD/OctoPrint/venv/lib/python2.7/site-packages/_virtualenv.py", line 21, in parse_config_files
    result = old_parse_config_files(self, *args, **kwargs)
  File "/Users/ITD/OctoPrint/venv/lib/python2.7/site-packages/setuptools/dist.py", line 702, in parse_config_files
    ignore_option_errors=ignore_option_errors)
  File "/Users/ITD/OctoPrint/venv/lib/python2.7/site-packages/setuptools/config.py", line 121, in parse_configuration
    meta.parse()
  File "/Users/ITD/OctoPrint/venv/lib/python2.7/site-packages/setuptools/config.py", line 426, in parse
    section_parser_method(section_options)
  File "/Users/ITD/OctoPrint/venv/lib/python2.7/site-packages/setuptools/config.py", line 399, in parse_section
    self[name] = value
  File "/Users/ITD/OctoPrint/venv/lib/python2.7/site-packages/setuptools/config.py", line 184, in __setitem__
    value = parser(value)
  File "/Users/ITD/OctoPrint/venv/lib/python2.7/site-packages/setuptools/config.py", line 515, in _parse_version
    version = self._parse_attr(value, self.package_dir)
  File "/Users/ITD/OctoPrint/venv/lib/python2.7/site-packages/setuptools/config.py", line 350, in _parse_attr
    value = getattr(module, attr_name)
AttributeError: 'module' object has no attribute '__version__'

Additional information about your setup (OctoPrint version, OctoPi version, printer, firmware, browser, operating system, ... as much data as possible)
OctoPrint-1.4.0-py2.7.egg
OS X 10.13.6
python 2.7.16

Did you activiate the venv in your shell?

source venv/bin/activate

Yes, the command to install were:

git clone https://github.com/foosel/OctoPrint.git
cd OctoPrint
virtualenv venv
source venv/bin/activate
pip install -U pyobjc
python setup.py install

This last command is the only one with an error. The log has scrolled off terminal's history.

Alright. That was just a shot in the dark :slight_smile:

I never worked with Mac and can't help you further.
Iirc @OutsourcedGuru is a Mac guy. I tagged him and maybe he knows what to do :slight_smile:

This error is usually associated with not first activating the virtual environment. If you got a different error after doing this and then running python setup.py install then let us know what that error was.

I am following these install instructions: Setting up OctoPrint on MacOS, which include activating the virtual environment:

git clone https://github.com/foosel/OctoPrint.git
cd OctoPrint
virtualenv venv
source venv/bin/activate
pip install -U pyobjc
python setup.py install

The last command ended in the AttributeError. There were no other errors. I have reinstalled twice with the same error. I have inserted an additional 'source venv/bin/activate' between the last two commands. None of these attempts has changed the result.

I've just adjusted the guide since python setup.py install is outdated and should no longer be used directly, try pip install . instead.

1 Like

Thanks. This did run with no errors and Octoprint is running now. Again, thanks.