ImportError: No module named gconf when importing dogtail - python

I have successfully install dogtail 0.7.1.1 on my system but when I try to
from dogtail import tree
I get this error instead
Traceback (most recent call last):
File "appstartup.py", line 9, in ?
from dogtail.procedural import *
File "/usr/lib/python2.4/site-packages/dogtail/procedural.py", line 18, in ?
import tree
File "/usr/lib/python2.4/site-packages/dogtail/tree.py", line 66, in ?
checkForA11y()
File "/usr/lib/python2.4/site-packages/dogtail/utils.py", line 185, in checkForA11y
if not isA11yEnabled(): bailBecauseA11yIsDisabled()
File "/usr/lib/python2.4/site-packages/dogtail/utils.py", line 158, in isA11yEnabled
import gconf
ImportError: No module named gconf
I have used the below command to verify that gconf is available on my system. Have anyone encountered this problem?
> gconftool-2 --version
2.16.0

pip install gconf should fix it.

Related

ImportError: cannot import name 'tqdm' from 'conda._vendor.tqdm' (unknown location)

Hello I am using mac actually when I searched analytics in finder I removed some folders (I thought they are useless :) after that when I type conda update or such I am getting those errors and further more.
I am keeping exact error:
Traceback (most recent call last):
File "/Users/nunemunthalashiva/anaconda3/bin/conda", line 13, in <module>
sys.exit(main())
File "/Users/nunemunthalashiva/anaconda3/lib/python3.8/site-packages/conda/cli/main.py", line 151, in main
from ..exceptions import conda_exception_handler
File "/Users/nunemunthalashiva/anaconda3/lib/python3.8/site-packages/conda/exceptions.py", line 25, in <module>
from .common.io import dashlist, timeout
File "/Users/nunemunthalashiva/anaconda3/lib/python3.8/site-packages/conda/common/io.py", line 33, in <module>
from .._vendor.tqdm import tqdm
ImportError: cannot import name 'tqdm' from 'conda._vendor.tqdm' (unknown location)
Python comes with some libraries that are required to preform some basic operation later in python such as update or install libraries. I think you removed those python libraries that are required to update/used in other ....to remove these error you have to add/restore those libraries or reinstall python.

Problem launching Jupyter Notebook from Anaconda

I am having issues launching Jupyter Notebook. I have tried to do it two ways and seem to get errors.
1 - Launching from the Anaconda Prompt using the command jupyter notebook or directly choosing from the Anaconda menu
I get the following:
(base) C:\Users\metni>jupyter notebook
Traceback (most recent call last):
File "C:\Users\metni\anaconda3\lib\site-packages\jsonschema\__init__.py", line 31, in <module>
from importlib import metadata
ImportError: cannot import name 'metadata' from 'importlib' (C:\Users\metni\anaconda3\lib\importlib\__init__.py)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\metni\anaconda3\lib\site-packages\nbformat\validator.py", line 12, in <module>
from jsonschema import ValidationError
File "C:\Users\metni\anaconda3\lib\site-packages\jsonschema\__init__.py", line 33, in <module>
import importlib_metadata as metadata
ModuleNotFoundError: No module named 'importlib_metadata'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\metni\anaconda3\Scripts\jupyter-notebook-script.py", line 6, in <module>
from notebook.notebookapp import main
File "C:\Users\metni\anaconda3\lib\site-packages\notebook\notebookapp.py", line 80, in <module>
from .services.contents.manager import ContentsManager
File "C:\Users\metni\anaconda3\lib\site-packages\notebook\services\contents\manager.py", line 17, in <module>
from nbformat import sign, validate as validate_nb, ValidationError
File "C:\Users\metni\anaconda3\lib\site-packages\nbformat\__init__.py", line 32, in <module>
from .validator import validate, ValidationError
File "C:\Users\metni\anaconda3\lib\site-packages\nbformat\validator.py", line 23, in <module>
raise ImportError(str(e) + verbose_msg)
ImportError: No module named 'importlib_metadata'
Jupyter notebook format depends on the jsonschema package:
https://pypi.python.org/pypi/jsonschema
Please install it first.
2 - Launching from the command line with the same command
I get the following:
C:\Users\metni>jupyter notebook
Traceback (most recent call last):
File "C:\Users\metni\anaconda3\Scripts\jupyter-notebook-script.py", line 6, in <module>
from notebook.notebookapp import main
File "C:\Users\metni\anaconda3\lib\site-packages\notebook\notebookapp.py", line 64, in <module>
from tornado import httpserver
File "C:\Users\metni\anaconda3\lib\site-packages\tornado\httpserver.py", line 29, in <module>
import ssl
File "C:\Users\metni\anaconda3\lib\ssl.py", line 98, in <module>
import _ssl # if we can't import it, let the error propagate
ImportError: DLL load failed: The specified module could not be found.
It seems like this is referring to a package called jsonschema which is not installed apparently, but running a pip install jsonschema does not solve the problem for me...
In the answer above I also have two two commands but they are a bit different
source /opt/anaconda/bin/activate root
and then
jupyter notebook
It seems like you have to go into your anaconda directory then bin, then you can
"activate root"
It also looks like you need to install some other dependencies for jupyter to run. Where is says
Jupyter notebook format depends on the jsonschema package:
https://pypi.python.org/pypi/jsonschema
Please install it first.
So if the above doesn't work try installing the other dependency and try again
Based on this answer from a similar question, I managed to solve the problem by running these two commands:
conda update -n root conda
conda update --all
I thus updated all packages, and the notebook is now launching.

Import error while trying to run jupyter notebook

An import error occurs when trying to run jupyter notebook
I'm trying to run jupyter notebook using anaconda (git bash platform), and as I type in jupyter notebook, an import error occurs every time. I tried to lauch it inside an environment, but the same error occured.
$ jupyter notebook
Traceback (most recent call last):
File "C:\Users\User\Anaconda3\Scripts\jupyter-notebook-script.py", line 6, in
<module>
from notebook.notebookapp import main
File "C:\Users\User\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 47, in <module>
from zmq.eventloop import ioloop
File "C:\Users\User\Anaconda3\lib\site-packages\zmq\__init__.py", line 47, in <module>
from zmq import backend
File "C:\Users\User\Anaconda3\lib\site-packages\zmq\backend\__init__.py", line 40, in <module>
reraise(*exc_info)
File "C:\Users\User\Anaconda3\lib\site-packages\zmq\utils\sixcerpt.py", line 34, in reraise
raise value
File "C:\Users\User\Anaconda3\lib\site-packages\zmq\backend\__init__.py", line 27, in <module>
_ns = select_backend(first)
File "C:\Users\User\Anaconda3\lib\site-packages\zmq\backend\select.py", line 27, in select_backend
mod = __import__(name, fromlist=public_api)
File "C:\Users\User\Anaconda3\lib\site-packages\zmq\backend\cython\__init__.py", line 6, in <module>
from . import (constants, error, message, context,
ImportError: DLL load failed: The specified module could not be found.
EDITED
After reinstalling pyzmq (and I tried reinstalling conda too), the following error occurs:
$ jupyter notebook
Traceback (most recent call last): File
"C:\Users\User\Anaconda3\lib\site-packages\notebook\services\sessions\sessionmanager.py",
line 10, in
import sqlite3
File "C:\Users\User\Anaconda3\lib\sqlite3__init__.py", line 23, in
from sqlite3.dbapi2 import *
File "C:\Users\User\Anaconda3\lib\sqlite3\dbapi2.py", line 27, in
from _sqlite3 import *
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File
"C:\Users\User\Anaconda3\Scripts\jupyter-notebook-script.py", line 6,
in
from notebook.notebookapp import main
File
"C:\Users\User\Anaconda3\lib\site-packages\notebook\notebookapp.py",
line 86, in
from .services.sessions.sessionmanager import SessionManager
File
"C:\Users\User\Anaconda3\lib\site-packages\notebook\services\sessions\sessionmanager.py",
line 13, in
from pysqlite2 import dbapi2 as sqlite3
ModuleNotFoundError: No module named 'pysqlite2'
I found a similar issue open on GitHub for zmq. The recommendation by GitHub user harsh23tyagi that seems to work for most is to run the following:
pip uninstall pyzmq
pip install pyzmq
Working with conda env, jupyter notebook worked in (base) env but gave the .libzmq error in (my_env).
To be able to run notebooks from my_env, this worked for me :
pip uninstall pyzmq
pip install pyzmq==20 (no version for pyzmq didn't fix the issue for me)
It seems that updating pyzmq to the latest version fixes this problem for me.
conda install pyzmq=22

Could not run jupyter on Mac OS (gives pysqlite2 errror)

I have installed anaconda in mac os sierra. Simple python scripts run fine. However, when I try to run jupyter-notebook it fails.
The error message is following:
Traceback (most recent call last):
File "/Users/poudel/anaconda3/lib/python3.6/site-packages/notebook/services/sessions/sessionmanager.py", line 10, in <module>
import sqlite3
File "/Users/poudel/anaconda3/lib/python3.6/sqlite3/__init__.py", line 23, in <module>
from sqlite3.dbapi2 import *
File "/Users/poudel/anaconda3/lib/python3.6/sqlite3/dbapi2.py", line 27, in <module>
from _sqlite3 import *
ImportError: dlopen(/Users/poudel/anaconda3/lib/python3.6/lib-dynload/_sqlite3.cpython-36m-darwin.so, 2): Symbol not found: _sqlite3_enable_load_extension
Referenced from: /Users/poudel/anaconda3/lib/python3.6/lib-dynload/_sqlite3.cpython-36m-darwin.so
Expected in: /usr/lib/libsqlite3.dylib
in /Users/poudel/anaconda3/lib/python3.6/lib-dynload/_sqlite3.cpython-36m-darwin.so
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/poudel/anaconda3/bin/jupyter-notebook", line 7, in <module>
from notebook.notebookapp import main
File "/Users/poudel/anaconda3/lib/python3.6/site-packages/notebook/notebookapp.py", line 79, in <module>
from .services.sessions.sessionmanager import SessionManager
File "/Users/poudel/anaconda3/lib/python3.6/site-packages/notebook/services/sessions/sessionmanager.py", line 13, in <module>
from pysqlite2 import dbapi2 as sqlite3
ModuleNotFoundError: No module named 'pysqlite2'
I checked the dylib file, but it is there. What's wrong here?
Bhishan:ls /usr/lib/libsqlite3.dylib
/usr/lib/libsqlite3.dylib*
Similar problems:
No module named _sqlite3
But they did not solve my problem.
Your problem is most likely due to several python envirionments.
Check this question.
Also this question maybe relevant.
Also try to see all installed packages with conda.
I have faced the same issue.
For me installing sqlite via brew solved the issue.
brew install sqlite

Error while building ns-3

I am trying to install ns-3 by tarball but when I try to build with following command
./build.py --enable-examples --enable-tests
as given in manual I get following error:
Traceback (most recent call last):
File "./build.py", line 170, in <module>
sys.exit(main(sys.argv))
File "./build.py", line 111, in main
config = dom.parse(dot_config)
File "/usr/local/lib/python2.7/xml/dom/minidom.py", line 1917, in parse
from xml.dom import expatbuilder
File "/usr/local/lib/python2.7/xml/dom/expatbuilder.py", line 32, in <module>
from xml.parsers import expat
File "/usr/local/lib/python2.7/xml/parsers/expat.py", line 4, in <module>
from pyexpat import *
ImportError: /usr/local/lib/python2.7/lib-dynload/pyexpat.so: undefined symbol: PyUnicodeUCS2_DecodeUTF
I know this error is related to python but not able to resolve after doing a lot of Google search.Can anybody help me how to proceed further?
Solved:
After exhausted research I found Python for Linux default setting is UCS2.
I rebuilt Python from source using
./configure --enable-unicode=ucs4
to force compile using UCS4.
Here is the link.

Categories