Reply
Explorer
Posts: 33
Registered: ‎05-21-2017

Not able to login as admin

I am trying to run "analysis.py", its throwing below error

cdsw@9nmx4v1iq3r6thaz:~$ python analysis.py 
Traceback (most recent call last):
  File "analysis.py", line 5, in <module>
    import matplotlib.pyplot as plt
  File "/usr/local/lib/python2.7/site-packages/matplotlib/pyplot.py", line 115, in <module>
    _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
  File "/usr/local/lib/python2.7/site-packages/matplotlib/backends/__init__.py", line 32, in pylab_setup
    globals(),locals(),[backend_name],0)
  File "/usr/local/lib/python2.7/site-packages/matplotlib/backends/backend_qt4agg.py", line 18, in <module>
    from .backend_qt5agg import FigureCanvasQTAggBase as _FigureCanvasQTAggBase
  File "/usr/local/lib/python2.7/site-packages/matplotlib/backends/backend_qt5agg.py", line 16, in <module>
    from .backend_qt5 import QtCore
  File "/usr/local/lib/python2.7/site-packages/matplotlib/backends/backend_qt5.py", line 26, in <module>
    import matplotlib.backends.qt_editor.figureoptions as figureoptions
  File "/usr/local/lib/python2.7/site-packages/matplotlib/backends/qt_editor/figureoptions.py", line 20, in <module>
    import matplotlib.backends.qt_editor.formlayout as formlayout
  File "/usr/local/lib/python2.7/site-packages/matplotlib/backends/qt_editor/formlayout.py", line 56, in <module>
    from matplotlib.backends.qt_compat import QtGui, QtWidgets, QtCore
  File "/usr/local/lib/python2.7/site-packages/matplotlib/backends/qt_compat.py", line 175, in <module>
    "Matplotlib qt-based backends require an external PyQt4, PyQt5,\n"
ImportError: Matplotlib qt-based backends require an external PyQt4, PyQt5,
or PySide package to be installed, but it was not found.

So i try to install PySide using pip it sthrowing below error.

cdsw@9nmx4v1iq3r6thaz:~$ pip install pyside
Collecting pyside
  Using cached PySide-1.2.4.tar.gz
Building wheels for collected packages: pyside
  Running setup.py bdist_wheel for pyside ... error
  Complete output from command /usr/local/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-IGd3Xz/pyside/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', 
'\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpo3P57Spip-wheel- --python-tag cp27:
  Removing /tmp/pip-build-IGd3Xz/pyside/pyside_package
  running bdist_wheel
  running build
  Python architecture is 64bit
  error: Failed to find qmake. Please specify the path to qmake with --qmake parameter.
  
  ----------------------------------------
  Failed building wheel for pyside
  Running setup.py clean for pyside
Failed to build pyside
Installing collected packages: pyside
  Running setup.py install for pyside ... error
    Complete output from command /usr/local/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-IGd3Xz/pyside/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n'
, '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-qb6KhV-record/install-record.txt --single-version-externally-managed --compile --user --prefix=:
    Removing /tmp/pip-build-IGd3Xz/pyside/pyside_package
    running install
    running build
    Python architecture is 64bit
    error: Failed to find qmake. Please specify the path to qmake with --qmake parameter.
    
    ----------------------------------------
Command "/usr/local/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-IGd3Xz/pyside/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(c
ompile(code, __file__, 'exec'))" install --record /tmp/pip-qb6KhV-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-IGd3Xz/pysid
e/

So again i tried installing using "sudo apt-get install python-pyside", again permission error

 

cdsw@9nmx4v1iq3r6thaz:~$ apt-get install python-pyside
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

So i tried switching as root, it dodn't work, its throwing

cdsw@9nmx4v1iq3r6thaz:~$ sudo su
The program 'sudo' can be found in the following packages:
 * sudo
 * sudo-ldap
Ask your administrator to install one of them

How to fix this

 

P.S: I am admin

Highlighted
Cloudera Employee
Posts: 26
Registered: ‎04-28-2017

Re: Not able to login as admin

The analyis.py file is meant to be run within the CDSW console, not directly from the terminal.  See the "Getting Started" guide within the CDSW documentation.  Within CDSW, Python consoles are backed by Jupyter kernels, which have the necessary configuration to create plots.

 

Best,

Tristan

Announcements