Can not import Marionette - python

When I try to import Marionette driver in Python, I get this response:
Python 2.7.15rc1 (default, Apr 15 2018, 21:51:34)
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> from marionette import Marionette
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/marionette_client-2.0.0-py2.7.egg/marionette/__init__.py", line 7, in <module>
from .marionette_test import (
File "/usr/local/lib/python2.7/dist-packages/marionette_client-2.0.0-py2.7.egg/marionette/marionette_test.py", line 18, in <module>
from marionette_driver.errors import (
File "/usr/local/lib/python2.7/dist-packages/marionette_driver-1.1.1-py2.7.egg/marionette_driver/__init__.py", line 7, in <module>
from marionette_driver import (
File "/usr/local/lib/python2.7/dist-packages/marionette_driver-1.1.1-py2.7.egg/marionette_driver/expected.py", line 8, in <module>
from marionette import HTMLElement
File "/usr/local/lib/python2.7/dist-packages/marionette_driver-1.1.1-py2.7.egg/marionette_driver/marionette.py", line 20, in <module>
from mozrunner import B2GEmulatorRunner
ImportError: cannot import name B2GEmulatorRunner
>>>
I have the Mozrunner package installed, but it does not have any B2GEmulatorRunner. Any suggestion as to what is causing this issue and how I can resolve this?
Edit:
After updating my entire Python 2.7 library with PIP, now I am stuck with this issue:
>>> import marionette
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/marionette/__init__.py", line 7, in <module>
from .marionette_test import (
ImportError: No module named marionette_test

Related

import ldap3 error File "<stdin>", line 1, in <module> File "/usr/local/lib/python3.9/dist-packages/ldap3/__init__.py", line 255, in <module>

I have installed ldap3 module for my python3. When I try to run import ldap3, I get such error. Can someone please advice me what to do?
python3
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ldap3
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.9/dist-packages/ldap3/__init__.py", line 255, in <module>
from .core.connection import Connection
File "/usr/local/lib/python3.9/dist-packages/ldap3/core/connection.py", line 53
from ..strategy.async import AsyncStrategy
^
SyntaxError: invalid syntax
>>>

Python: errors loading numpy and matplotlib

This is an odd problem. I have Python script which imports numpy and matplotlib.
If I put those scripts into /usr/local/bin, I can load the modules and run my scripts with no problem.
But if I have those scripts in my "work" directory, I get errors.
This is also true if I use python in interactive mode:
$ pwd
/usr/local/bin
$ python
Python 2.7.12 (default, Oct 10 2016, 12:56:26)
[GCC 5.4.0] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> import matplotlib
>>>
No problems.
However, if I go to my work directory, I have problems:
$ pwd
/home/Administrator/Documents/Projects/MOCC/rads
$ python
Python 2.7.12 (default, Oct 10 2016, 12:56:26)
[GCC 5.4.0] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/numpy/__init__.py", line 170, in <module>
from . import add_newdocs
File "/usr/lib/python2.7/site-packages/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/usr/lib/python2.7/site-packages/numpy/lib/__init__.py", line 8, in <module>
from .type_check import *
File "/usr/lib/python2.7/site-packages/numpy/lib/type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "/usr/lib/python2.7/site-packages/numpy/core/__init__.py", line 46, in <module>
from numpy.testing import Tester
File "/usr/lib/python2.7/site-packages/numpy/testing/__init__.py", line 13, in <module>
from .utils import *
File "/usr/lib/python2.7/site-packages/numpy/testing/utils.py", line 15, in <module>
from tempfile import mkdtemp
File "/usr/lib/python2.7/tempfile.py", line 32, in <module>
import io as _io
File "/cygdrive/c/Users/Administrator/Documents/Projects/MOCC/rads/io.py", line 63, in <module>
SEEK_CUR = 1
File "/cygdrive/c/Users/Administrator/Documents/Projects/MOCC/rads/io.py", line 58, in main
AttributeError: 'module' object has no attribute 'loadtxt'
This is cygwin on MS Windows.

Occasional error of import matplotlib

In a newly created terminal, I can import matplotlib with no error. After working for some time in the terminal, however, the following happens:
Python 2.7.5 (default, Mar 9 2014, 22:15:05)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
Usage: example.py torrentfile.torrent
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/__init__.py", line 134, in <module>
from matplotlib.rcsetup import (defaultParams,
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/rcsetup.py", line 19, in <module>
from matplotlib.colors import is_color_like
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/colors.py", line 54, in <module>
import matplotlib.cbook as cbook
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/cbook.py", line 15, in <module>
import new
File "new.py", line 12, in <module>
with open(sys.argv[1], 'rb') as fh:
IndexError: list index out of range
What's wrong?
With the help of #CaptainMurphy and #IronManMark20, I discovered new.py and new.pyc under ~/temp, which shadows some matplotlib files. After removing them, the problem is solved.

PyXNAT Error while importing in python3.4

I have installed a package pyxnat on python3.4. i have installed required dependencies like httplib2 package and lxml correctly. but still when i import pyxnat i get following error.
bash-3.2$ python3.4
Python 3.4.2 (v3.4.2:ab2c023a9432, Oct 5 2014, 20:42:22)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from pyxnat import Interface
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/sdb99/usr/lib/python2.7/site-packages/pyxnat/__init__.py", line 13, in <module>
from .core import Interface
File "/Users/sdb99/usr/lib/python2.7/site-packages/pyxnat/core/__init__.py", line 4, in <module>
from .interfaces import Interface
File "/Users/sdb99/usr/lib/python2.7/site-packages/pyxnat/core/interfaces.py", line 19, in <module>
from .select import Select
File "/Users/sdb99/usr/lib/python2.7/site-packages/pyxnat/core/select.py", line 4, in <module>
from .search import Search
File "/Users/sdb99/usr/lib/python2.7/site-packages/pyxnat/core/search.py", line 15, in <module>
from .errors import is_xnat_error, catch_error
File "/Users/sdb99/usr/lib/python2.7/site-packages/pyxnat/core/errors.py", line 31
except Exception, e:
^
SyntaxError: invalid syntax
Any suggestions to correct this?
Thanks!
EDIT:
In python 2.7 i get the following error
>>> myXNAT = Interface('https://hd-hni-xnat.cac.berkley.edu:8443/xnat')
User: sdb356
Password:
(<type 'exceptions.IOError'>, 'interfaces.py', '')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/sdb99/usr/lib/python2.7/site-packages/pyxnat/core/interfaces.py", line 228, in __init__
self._get_entry_point()
File "/Users/sdb99/usr/lib/python2.7/site-packages/pyxnat/core/interfaces.py", line 271, in _get_entry_point
raise e
IOError: [Errno 13] Permission denied
I tried looking into interfaces.py to understand the error but wasnt..
You have installed pyxnat for python2 and are trying to import it in the python3 interpreter, you have also somehow managed to add your python 2 path to your python 3 path.

How to install RunSnakeRun on OS X with MacPorts?

I've installed the wxWidgets-3.0 py27-wxpython-3.0 MacPorts packages. In a clean virtualenv I installed the wx, SquareMap, and RunSnakeRun pip packages. Attempting to run runsnake fails as follows:
Traceback (most recent call last):
File "/Users/lhn/.virtualenvs/snake/bin/runsnake32", line 9, in <module>
load_entry_point('RunSnakeRun==2.0.4', 'gui_scripts', 'runsnake32')()
File "/Users/lhn/.virtualenvs/snake/lib/python2.7/site-packages/pkg_resources.py", line 353, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/Users/lhn/.virtualenvs/snake/lib/python2.7/site-packages/pkg_resources.py", line 2321, in load_entry_point
return ep.load()
File "/Users/lhn/.virtualenvs/snake/lib/python2.7/site-packages/pkg_resources.py", line 2048, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/Users/lhn/.virtualenvs/snake/lib/python2.7/site-packages/runsnakerun/runsnake.py", line 14, in <module>
from squaremap import squaremap
File "/Users/lhn/.virtualenvs/snake/lib/python2.7/site-packages/squaremap/squaremap.py", line 3, in <module>
import wx.lib.newevent
ImportError: No module named lib.newevent
In IDLE I see teh same import error:
Python 2.7.6 (default, Nov 18 2013, 15:12:51)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.2.79)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import wx
>>> import wx.lib.newevent
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named lib.newevent

Categories

Resources