You are not logged in.

#1 2014-08-15 19:12:22

r00tr4t
Member
Registered: 2013-01-16
Posts: 101

[Solved]Openshot Failed to import 'from openshot.openshot import main'

Hi there ArcLinux forum of awesomenes.
I got problem with my Openshot installation.
i have tried to fix this problem by both remove/reinstall openshot/mlt/mlt-python-bindings  and cheeked my locale.gen file.
Nothing works hmm

------------------------- ERROR 1 ------------------------------
Failed to import 'from openshot import main'
Error Message: cannot import name main
----------------------------------------------------------------

------------------------- ERROR 2 ------------------------------
Failed to import 'from openshot.openshot import main'
Error Message: Non-ASCII character '\xc2' in file /usr/lib/python3.4/site-packages/cairo/__init__.py on line 3, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (__init__.py, line 2)
----------------------------------------------------------------

OpenShot has failed to import some of the Python files or libraries 
required for our application to run.  Here are some trouble shooting
tips:

Tip 1) Check if MLT can be successfully imported in Python.  Run the 
 following commands, and see if any errors are displayed.  If you get 
 an error, you need to investigate the correct way to install MLT.
 NOTE:  Do not type the $ or >> characters in the examples below.

       $ python
       >> import mlt
       >> mlt.Factory().init()

Tip 2) If MLT is working from the first example, then the next tip is 
 to look at the above error messages very closely, and google for more 
 help.  It's likely the problem is already reported, and maybe there is
 a simple work-around.  Also, you can search for bugs or report a new 
 bug at https://bugs.launchpad.net/openshot.  Good luck!

But If i understand it correctly Openshot have problem whit python3 because when i do

$python3
>>> import mlt
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'mlt'
>>>exit()


$python2
>>> import mlt
>>> mlt.Factory().init()
<mlt.Repository; proxy of <Swig Object of type 'Mlt::Repository *' at 0x7f49db191e40> >
>>>exit()

Can any one give me a hint how i force Openshot to use python2 instead?
Thanks.

Last edited by r00tr4t (2014-08-19 18:08:13)

Offline

#2 2014-08-17 10:30:15

Morn
Member
Registered: 2012-09-02
Posts: 886

Re: [Solved]Openshot Failed to import 'from openshot.openshot import main'

r00tr4t wrote:

Can any one give me a hint how i force Openshot to use python2 instead?

Openshot from the Arch community repo is already using Python 2. Are you really using Arch Linux or some other distro?

Offline

#3 2014-08-17 17:38:54

r00tr4t
Member
Registered: 2013-01-16
Posts: 101

Re: [Solved]Openshot Failed to import 'from openshot.openshot import main'

No i'm on Arch.

$ uname -a
Linux Phanter-ArcLinux 3.15.5-2-ARCH #1 SMP PREEMPT Fri Jul 11 07:56:02 CEST 2014 x86_64 GNU/Linux 
$ pacman -Q openshot mlt mlt-python-bindings
openshot 1.4.3-3
mlt 0.9.2-1
mlt-python-bindings 0.9.2-1

The thing is if i

$ cat /usr/bin/openshot 
#!/usr/bin/python2
...
..

Butt the error message says it do not find the mlt library in /usr/lib/python3.4/site-packages/cairo/

That got me thinking maybe it is a Python problem.

Thanks for your help. smile

Offline

#4 2014-08-17 17:47:08

Morn
Member
Registered: 2012-09-02
Posts: 886

Re: [Solved]Openshot Failed to import 'from openshot.openshot import main'

If you start openshot from a terminal, it should use Python 2. So I don't see how you got a Python 3 error message.

Offline

#5 2014-08-18 05:41:04

r00tr4t
Member
Registered: 2013-01-16
Posts: 101

Re: [Solved]Openshot Failed to import 'from openshot.openshot import main'

It should use python2 but it uses python3 because the error message says so.

------------------------- ERROR 2 ------------------------------
Failed to import 'from openshot.openshot import main'
Error Message: Non-ASCII character '\xc2' in file /usr/lib/python3.4/site-packages/cairo/__init__.py on line 3, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (__init__.py, line 2)
----------------------------------------------------------------

Any one got any ides ?

Offline

#6 2014-08-18 05:53:52

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,601

Re: [Solved]Openshot Failed to import 'from openshot.openshot import main'

How are you starting openshot?  From a menu of some kind? or from a command line?


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#7 2014-08-18 11:28:56

r00tr4t
Member
Registered: 2013-01-16
Posts: 101

Re: [Solved]Openshot Failed to import 'from openshot.openshot import main'

First i tried to start from awesome wm but it did not work then i went in to gnome-terminal tried to start it that way.

Offline

#8 2014-08-18 15:38:21

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,601

Re: [Solved]Openshot Failed to import 'from openshot.openshot import main'

Okay.  I had asked because menu programs might not read the shebang in line one of the program.  I know it is read when launched from a shell.
Also, you install from the AUR, Community, or did you install it by hand?
What if you launch it from a shell as python2 openshot
and lastly, what is the output of head $(which openshot)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#9 2014-08-19 02:05:01

r00tr4t
Member
Registered: 2013-01-16
Posts: 101

Re: [Solved]Openshot Failed to import 'from openshot.openshot import main'

Hmm interesting.

$ python2 openshot
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/lib/python3.4/site-packages/__main__.py", line 5, in <module>
    from .colorize import Configuration
ValueError: Attempted relative import in non-package

Offline

#10 2014-08-19 09:19:10

Morn
Member
Registered: 2012-09-02
Posts: 886

Re: [Solved]Openshot Failed to import 'from openshot.openshot import main'

Very odd. Maybe you have some borked environment variables, e.g. PYTHONPATH? What does "env|grep -i python" give you? Obviously exec is a bit confused and uses the wrong Python library directory.

Offline

#11 2014-08-19 12:06:45

r00tr4t
Member
Registered: 2013-01-16
Posts: 101

Re: [Solved]Openshot Failed to import 'from openshot.openshot import main'

Yes

$ env | grep python
PYTHONPATH=/usr/local/lib/python2.7/site-packages/:/usr/lib/python3.4/site-packages/

Offline

#12 2014-08-19 13:57:49

Morn
Member
Registered: 2012-09-02
Posts: 886

Re: [Solved]Openshot Failed to import 'from openshot.openshot import main'

r00tr4t wrote:

Yes

$ env | grep python
PYTHONPATH=/usr/local/lib/python2.7/site-packages/:/usr/lib/python3.4/site-packages/

Where is this variable set? PYTHONPATH should not be defined at all on a standard Arch install. Get rid of this and I bet OpenShot will work. smile

Offline

#13 2014-08-19 18:03:31

r00tr4t
Member
Registered: 2013-01-16
Posts: 101

Re: [Solved]Openshot Failed to import 'from openshot.openshot import main'

Morn wrote:
r00tr4t wrote:

Yes

$ env | grep python
PYTHONPATH=/usr/local/lib/python2.7/site-packages/:/usr/lib/python3.4/site-packages/

Where is this variable set? PYTHONPATH should not be defined at all on a standard Arch install. Get rid of this and I bet OpenShot will work. smile

Magic. It works.
I have PYTHONPATH in my /etc/profile and i think it had something to do with getting vim to work with Python a few month back.
Commented it out and rebooted the computer and now Openshot works smile

Thanks a 10e9. smile

Offline

#14 2014-12-02 22:07:08

r00tr4t
Member
Registered: 2013-01-16
Posts: 101

Re: [Solved]Openshot Failed to import 'from openshot.openshot import main'

Reporting back on an old issue as i figured out why i needed the

PYTHONPATH=/usr/local/lib/python2.7/site-packages/:/usr/lib/python3.4/site-packages/

The arduino-ino package from AUR gives this message if you run it with out PYTHONPATH variable.

 Traceback (most recent call last):
  File "/usr/local/bin/ino", line 3, in <module>
    from ino.runner import main
ImportError: No module named ino.runner

Offline

#15 2015-05-26 15:53:05

rrt
Member
Registered: 2015-05-26
Posts: 1

Re: [Solved]Openshot Failed to import 'from openshot.openshot import main'

Same issue here. I solved it by changing the library mlt 0.9.6-7 (extra) -> mlt-git v0.9.2.r247.ge06718f-1 (aur).

Offline

Board footer

Powered by FluxBB