Ultimaker / Cura

3D printer / slicing GUI built on top of the Uranium framework
GNU Lesser General Public License v3.0
6.08k stars 2.06k forks source link

Run Cura from source on Mac error #3565

Open kirilledelman opened 6 years ago

kirilledelman commented 6 years ago

Tried running Cura from source by following instructions exactly in https://github.com/Ultimaker/Cura/wiki/Running-Cura-from-Source-on-macOS

first run got

$ python cura_app.py

Traceback (most recent call last):
  File "cura_app.py", line 10, in <module>
    from UM.Platform import Platform
  File "/Users/kirilledelman/Uranium/UM/Platform.py", line 17
    def isOSX(cls) -> bool:
                   ^
SyntaxError: invalid syntax

Looks like the instructions to make python 3.6.4 default didn't take. Running

$ python3.6 cura_app.py

Error in sys.excepthook:
Traceback (most recent call last):
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
  File "/Users/kirilledelman/Cura/cura/CrashHandler.py", line 22, in <module>
    from UM.Application import Application
  File "/Users/kirilledelman/Uranium/UM/Application.py", line 15, in <module>
    from UM.Settings.ContainerRegistry import ContainerRegistry
  File "/Users/kirilledelman/Uranium/UM/Settings/ContainerRegistry.py", line 37, in <module>
    import UM.Qt.QtApplication
  File "/Users/kirilledelman/Uranium/UM/Qt/QtApplication.py", line 17, in <module>
    from UM.Application import Application
ImportError: cannot import name 'Application'

Original exception was:
Traceback (most recent call last):
  File "cura_app.py", line 127, in <module>
    import Arcus #@UnusedImport
ModuleNotFoundError: No module named 'Arcus'

I followed setup directions exactly, and got no errors up to this point.

ianpaschal commented 6 years ago

Hey, cool that you're looking to run from source!

Sorry the wiki instructions aren't working quite right. I need to add a disclaimer that with everyone's different system configurations it's always possible that stuff doesn't work.

My guess is that actually the whole virtual environments thing didn't take (for whatever reason) and therefore libArcus is built for Python 2.7 instead of 3.6.4.

So I would review those steps actually. Also, did you run workon [virtualenv name] before building libArcus to ensure it's built for the right version?

kirilledelman commented 6 years ago

@ianpaschal Thanks for your reply. To be honest, I was looking to run from source because I couldn't get it to compile: https://github.com/Ultimaker/cura-build/issues/176

I did run workon Python_3.6.4-PyQt_5.8.2 before Arcus, and remember that name becoming part of the prompt for the duration of the process.

Ghostkeeper commented 6 years ago

To run Cura I always need to provide a PYTHONPATH that contains the dependencies. I run it like this:

PYTHONPATH=~/Projects/Uranium:~/dev/inst/lib/python3/dist-packages python3 ~/Projects/Cura/cura_app.py

The UM.Application module is located in the ~/Projects/Uranium folder and Arcus is located in the ~/dev/inst/lib/python3/dist-packages folder. Maybe you could try pointing Python at where it can locate your dependencies?

I've put these dependencies in a shell script for ease of use.