Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

cura and UM module error

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
9 posts • Page 1 of 1
Author
Message
andrewwalker27
l33t
l33t
User avatar
Posts: 660
Joined: Mon Jun 27, 2005 6:56 pm

cura and UM module error

  • Quote

Post by andrewwalker27 » Thu Feb 01, 2018 9:25 pm

I'm trying to install cura and whilst it has installed without errors, it won't actually run. The error I get is this

Code: Select all

raceback (most recent call last):
  File "/usr/bin/cura", line 9, in <module>
    from UM.Platform import Platform
ModuleNotFoundError: No module named 'UM'
I have so far done the following,

Code: Select all

emerge  dev-python/pip
and installed pip-9.0.1-r2, surprised it wasn't a dependency but never mind. I then did

Code: Select all

pip install --user UM
to install the missing module which I'm assuming is the correct solution? I also did

Code: Select all

pip list
to check it is installed, and it is

Code: Select all

um (1.4.0)
but I still get the same error.
The version of cura I've installed is media-gfx/cura-2.6.0, can anyone help me out? I'm not familiar with python but if I try to re-install the UM module I get this saying it's definitely installed

Code: Select all

Requirement already satisfied: UM in ./.local/lib64/python3.5/site-packages
and the python version seems to match cura python version

Code: Select all

Calculating dependencies... done!
[ebuild   R    ] media-gfx/cura-2.6.0::gentoo  USE="usb" PYTHON_SINGLE_TARGET="python3_5 -python3_4 -python3_6" PYTHON_TARGETS="python3_4 python3_5 -python3_6" 0 KiB
Anyone know what I'm doing wrong? Is there a python path that needs editing?
Top
fedeliallalinea
Administrator
Administrator
User avatar
Posts: 31985
Joined: Sat Mar 08, 2003 11:15 pm
Location: here
Contact:
Contact fedeliallalinea
Website

Re: cura and UM module error

  • Quote

Post by fedeliallalinea » Fri Feb 02, 2018 7:34 am

andrewwalker27 wrote:I'm trying to install cura and whilst it has installed without errors, it won't actually run. The error I get is this

Code: Select all

raceback (most recent call last):
  File "/usr/bin/cura", line 9, in <module>
    from UM.Platform import Platform
ModuleNotFoundError: No module named 'UM'
I have so far done the following,

Code: Select all

emerge  dev-python/pip
and installed pip-9.0.1-r2, surprised it wasn't a dependency but never mind. I then did

Code: Select all

pip install --user UM
to install the missing module which I'm assuming is the correct solution? I also did

Code: Select all

pip list
to check it is installed, and it is

Code: Select all

um (1.4.0)
Using pip is a bad idea when in portage exists package that you need.
In your case package that provide UM library is dev-python/uranium-2.6.0 that is a dependency of cura.
I tried install cura on my system and work fine.
Now remove package installed with pip and rebuild from portage dev-python/uranium-2.6.0.
Questions are guaranteed in life; Answers aren't.

"Those who would give up essential liberty to purchase a little temporary safety,
deserve neither liberty nor safety."
- Ben Franklin
https://www.news.admin.ch/it/nsb?id=103968
Top
andrewwalker27
l33t
l33t
User avatar
Posts: 660
Joined: Mon Jun 27, 2005 6:56 pm

  • Quote

Post by andrewwalker27 » Fri Feb 02, 2018 9:25 am

Oh, I see, unfortunately I only installed it with pip because previously it complained of um not being installed despite uranium already being installed as a dependency of cura. I'll remove it and re-install uranium and go from there, thanks for the info.
Top
andrewwalker27
l33t
l33t
User avatar
Posts: 660
Joined: Mon Jun 27, 2005 6:56 pm

  • Quote

Post by andrewwalker27 » Sat Feb 03, 2018 12:37 pm

Ok, I've uninstalled um with pip and re-emerged uranium-2.6.0 but still get exactly the same error

Code: Select all

Traceback (most recent call last):
  File "/usr/bin/cura", line 9, in <module>
    from UM.Platform import Platform
ModuleNotFoundError: No module named 'UM'
I think I know what the problem is, it seems to be a python version issue. Cura is python3.5

Code: Select all

[ebuild   R    ] media-gfx/cura-2.6.0::gentoo  USE="usb" PYTHON_SINGLE_TARGET="python3_5 -python3_4 -python3_6" PYTHON_TARGETS="python3_4 python3_5 -python3_6" 0 KiB
so is uranium

Code: Select all

[ebuild   R    ] dev-python/uranium-2.6.0::gentoo  USE="-doc {-test}" PYTHON_SINGLE_TARGET="python3_5 -python3_4 -python3_6" PYTHON_TARGETS="python3_4 python3_5 -python3_6" 0 KiB
but when I run cura it seems to only have the path for python3.6

Code: Select all

>>> for p in sys.path:
...     print (p)
...
                                                                                                                                                                                                                                           
/usr/lib64/python36.zip                                                                                                                                                                                                                   
/usr/lib64/python3.6                                                                                                                                                                                                                       
/usr/lib64/python3.6/lib-dynload                                                                                                                                                                                                           
/usr/lib64/python3.6/site-packages                                                                                                                                                                                                         
>>> 
Any idea how to fix this problem without breaking my system? You used to be able to select the python version you used by eselect but since PYTHON_TARGETS reared it's head I've had trouble understanding it. I don't even have python3.6 in my make.conf so why is the path pointing to it?
Here's the section of my make.conf

Code: Select all

PYTHON_TARGETS="python2_7 python3_4 python3_5"
PYTHON_SINGLE_TARGET="python3_5"
Top
Hu
Administrator
Administrator
Posts: 24401
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Sat Feb 03, 2018 5:58 pm

That looks like you are trying to use Python 3.6 as your interactive Python (for showing sys.path). What is the output of:

Code: Select all

python -c 'import sys;print(sys.version);print("\n".join(sys.path));import UM'
eselect python list
Top
andrewwalker27
l33t
l33t
User avatar
Posts: 660
Joined: Mon Jun 27, 2005 6:56 pm

  • Quote

Post by andrewwalker27 » Mon Feb 05, 2018 9:17 am

Well it looks like you're correct

Code: Select all

gentoo /home/fred # python -c 'import sys;print(sys.version);print("\n".join(sys.path));import UM'
3.6.4 (default, Jan  8 2018, 14:15:07) 
[GCC 7.2.0]

/usr/lib64/python36.zip
/usr/lib64/python3.6
/usr/lib64/python3.6/lib-dynload
/usr/lib64/python3.6/site-packages
gentoo /home/fred # eselect python list
Available Python interpreters, in order of preference:
  [1]   python3.6
  [2]   python3.5
  [3]   python2.7
  [4]   python3.4
gentoo /home/fred # 
but short of un-installing python3.6, how do I stop it using it? It used to be eselect python but since PYTHON_TARGETS etc appeared that no longer seems an option. Any suggestions?
Top
Hu
Administrator
Administrator
Posts: 24401
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Tue Feb 06, 2018 3:39 am

I am not aware of any reason eselect python cannot work. Even if it cannot, you could rebuild these packages with support for Python 3.6. The output you posted earlier seems to indicate that they can support it, but that you have not yet enabled that support.
Top
s0be
Apprentice
Apprentice
User avatar
Posts: 240
Joined: Sat Nov 23, 2002 1:12 pm

  • Quote

Post by s0be » Sun Oct 13, 2019 7:08 pm

(sorry to resurrect an ancient thread, I just ran into this and had to resolve it as well, and the solution wasn't posted here and I couldn't find the right answer anywhere)

Two of the ebuilds in the python dep-chain for Cura do not seem to honor the python versions listed/specified in eselect python, leading to this. The solution I ended up using:

1. Set python 3.6 as the default python interpreter
2. Unmerge python 3.7
3. Re-merge offending packages
a. dev-libs/libarcus
b. dev-libs/libsavitar
c. dev-python/uranium (Probably not offending, but I re-installed anyways)
4. Verify cura works
5. re-install python 3.7
5. Make sure python 3.6 is still ahead of python 3.7

If you don't have python 3.7 in your PYTHON_TARGETS, but have python 3.7 installed, you'll see libarcus/libsavitar still detect python 3.7 and install/build for it.
Top
rufnut
Apprentice
Apprentice
Posts: 252
Joined: Mon May 16, 2005 7:26 am

  • Quote

Post by rufnut » Mon Jun 01, 2020 3:28 am

The thread is quite old, even the 6 month old update didn't work for me.
For what it's worth:

Code: Select all

PYTHON_SINGLE_TARGET="python3_7" emerge cura

Code: Select all

Calculating dependencies... done!
[ebuild   R    ] dev-python/six-1.14.0  PYTHON_TARGETS="python3_7*" 
[ebuild   R    ] dev-python/sip-4.19.21  PYTHON_TARGETS="python3_7*" 
[ebuild   R    ] dev-python/idna-2.8  PYTHON_TARGETS="python3_7*" 
[ebuild   R    ] dev-python/pyserial-3.4  PYTHON_TARGETS="python3_7*" 
[ebuild   R    ] dev-python/chardet-3.0.4  PYTHON_TARGETS="python3_7*" 
[ebuild   R    ] dev-python/ply-3.11  PYTHON_TARGETS="python3_7*" 
[ebuild   R    ] dev-python/PySocks-1.7.1  PYTHON_TARGETS="python3_7*" 
[ebuild   R    ] dev-python/pybind11-2.4.3  PYTHON_TARGETS="python3_7*" 
[ebuild   R    ] dev-python/olefile-0.46  PYTHON_TARGETS="python3_7*" 
[ebuild   R    ] dev-python/PyQt5-sip-4.19.21  PYTHON_TARGETS="python3_7*" 
[ebuild   R    ] dev-python/namespace-google-1  PYTHON_TARGETS="python3_7*" 
[ebuild   R   ~] dev-python/sentry-sdk-0.14.1  PYTHON_TARGETS="python3_7*" 
[ebuild   R    ] dev-python/pycparser-2.20  PYTHON_TARGETS="python3_7*" 
[ebuild   R    ] dev-python/pillow-7.0.0  PYTHON_TARGETS="python3_7*" 
[ebuild   R    ] dev-python/protobuf-python-3.11.4  PYTHON_TARGETS="python3_7*" 
[ebuild   R    ] dev-python/cffi-1.14.0-r2  PYTHON_TARGETS="python3_7*" 
[ebuild   R    ] sci-libs/scipy-1.4.1  PYTHON_TARGETS="python3_7*" 
[ebuild   R    ] sci-libs/Shapely-1.6.4_p2-r1  PYTHON_TARGETS="python3_7*" 
[ebuild   R    ] dev-python/cryptography-2.8-r1  PYTHON_TARGETS="python3_7*" 
[ebuild   R    ] dev-python/pyopenssl-19.1.0  PYTHON_TARGETS="python3_7*" 
[ebuild   R    ] dev-python/urllib3-1.25.8  PYTHON_TARGETS="python3_7*" 
[ebuild   R    ] dev-python/requests-2.23.0  PYTHON_TARGETS="python3_7*" 
[ebuild   R   ~] dev-libs/libarcus-4.6.1  PYTHON_SINGLE_TARGET="python3_7* -python3_6*" 
[ebuild   R   ~] dev-libs/libcharon-4.6.1  PYTHON_SINGLE_TARGET="python3_7* -python3_6*" 
[ebuild   R   ~] dev-libs/libsavitar-4.6.1  PYTHON_SINGLE_TARGET="python3_7* -python3_6*" 
[ebuild   R    ] dev-python/dbus-python-1.2.16  PYTHON_TARGETS="python3_7*" 
[ebuild   R    ] dev-python/PyQt5-5.14.1-r1  PYTHON_TARGETS="python3_7*" 
[ebuild   R   ~] dev-python/uranium-4.6.1  PYTHON_SINGLE_TARGET="python3_7* -python3_6*" 
[ebuild   R   ~] media-gfx/cura-4.6.1  PYTHON_SINGLE_TARGET="python3_7* -python3_6*" 
I had to add quite a bit to package.use after the above command but Cura is again working.


:D
Top
Post Reply

9 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic