I'm running Linux Mint 18.3 with kernel 4.13.0-39-generic.
Every time I run a command in a terminal that is not valid or the program is not installed I get a stacktrace of a python error
Traceback (most recent call last):
File "/usr/lib/python3.5/dbm/gnu.py", line 4, in <module>
from _gdbm import *
ImportError: No module named '_gdbm'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 7, in <module>
import dbm.gnu as gdbm
File "/usr/lib/python3.5/dbm/gnu.py", line 6, in <module>
raise ImportError(str(msg) + ', please install the python3-gdbm package')
ImportError: No module named '_gdbm', please install the python3-gdbm package
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/command-not-found", line 27, in <module>
from CommandNotFound.util import crash_guard
File "/usr/lib/python3/dist-packages/CommandNotFound/__init__.py", line 3, in <module>
from CommandNotFound.CommandNotFound import CommandNotFound
File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 9, in <module>
import gdbm
ImportError: No module named 'gdbm'
To answer the first question, yes gdbm is installed:
ii libgdbm3:amd64 1.8.3-13.1 amd64 GNU dbm database routines (runtime version)
ii python-gdbm 2.7.12-1~16.04 amd64 GNU dbm database support for Python
ii python3-gdbm:amd64 3.6.5-3~16.04.york0.2 amd64 GNU dbm database support for Python 3.x
As you can see in your error message you are missing the module 'gdbm' as it says here:
sudo apt-get install python3.5-gdbm
Related
I have tried upgrading Python version on a Miniconda installation by running conda update python. The version was being taken from 3.8 to 3.10. This seems to have broken the installation. No matter what command I run, I get the following:
➜ project conda activate
Traceback (most recent call last):
File "/home/user/miniconda3/lib/python3.10/site-packages/conda/common/serialize.py", line 13, in <module>
import ruamel_yaml as yaml
ModuleNotFoundError: No module named 'ruamel_yaml'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/user/miniconda3/lib/python3.10/site-packages/conda/common/serialize.py", line 16, in <module>
import ruamel.yaml as yaml
ModuleNotFoundError: No module named 'ruamel'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/user/miniconda3/bin/conda", line 15, in <module>
sys.exit(main())
File "/home/user/miniconda3/lib/python3.10/site-packages/conda/cli/main.py", line 118, in main
from ..exceptions import conda_exception_handler
File "/home/user/miniconda3/lib/python3.10/site-packages/conda/exceptions.py", line 24, in <module>
from .models.channel import Channel
File "/home/user/miniconda3/lib/python3.10/site-packages/conda/models/channel.py", line 17, in <module>
from ..base.context import context, Context
File "/home/user/miniconda3/lib/python3.10/site-packages/conda/base/context.py", line 55, in <module>
from ..common.configuration import (Configuration, ConfigurationLoadError, MapParameter,
File "/home/user/miniconda3/lib/python3.10/site-packages/conda/common/configuration.py", line 42, in <module>
from .serialize import yaml_round_trip_load
File "/home/user/miniconda3/lib/python3.10/site-packages/conda/common/serialize.py", line 18, in <module>
raise ImportError("No yaml library available. To proceed, conda install ruamel_yaml")
ImportError: No yaml library available. To proceed, conda install ruamel_yaml
Help on fixing this is appreciated.
I Am trying to build numpy-1.16.3 version on windows. Seems it was installed correctly to my mentioned directory, but when I try to import numpy, I got the issue:
Successfully installed numpy-1.16.3
WARNING: You are using pip version 21.1.1; however, version 22.2.1 is available.
You should consider upgrading via the '...build\Python-3.8.10\PCbuild\amd64\python.exe -m pip install --upgrade pip' command.
Traceback (most recent call last):
File "..build\Python-3.8.10\lib\site-packages\numpy\core_init_.py", line 40, in
from . import multiarray
File "..\build\Python-3.8.10\lib\site-packages\numpy\core\multiarray.py", line 12, in
from . import overrides
File "..\build\Python-3.8.10\lib\site-packages\numpy\core\overrides.py", line 6, in
from numpy.core._multiarray_umath import (
ImportError: DLL load failed while importing _multiarray_umath: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "", line 1, in
File "..\build\Python-3.8.10\lib\site-packages\numpy_init_.py", line 142, in
from . import core
File "..\build\Python-3.8.10\lib\site-packages\numpy\core_init_.py", line 71, in
raise ImportError(msg)
ImportError:
Maybe someone can help me with this.
You can find the C code in this temporary file:
/tmp/theano_compilation_error_7_ntcw7n
Traceback (most recent call last):
File "/home/vaishnavnimkar/.local/lib/python3.7/site-packages/theano/gof/lazylinker_c.py", line 81, in <module>
actual_version, force_compile, _need_reload))
ImportError: Version check of the existing lazylinker compiled file. Looking for version 0.211, but found None. Extra debug information: force_compile=False, _need_reload=True
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/vaishnavnimkar/.local/lib/python3.7/site-packages/theano/gof/lazylinker_c.py", line 105, in <module>
actual_version, force_compile, _need_reload))
ImportError: Version check of the existing lazylinker compiled file. Looking for version 0.211, but found None. Extra debug information: force_compile=False, _need_reload=True
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/vaishnavnimkar/.local/lib/python3.7/site-packages/theano/__init__.py", line 110, in <module>
from theano.compile import (
File "/home/vaishnavnimkar/.local/lib/python3.7/site-packages/theano/compile/__init__.py", line 12, in <module>
from theano.compile.mode import *
File "/home/vaishnavnimkar/.local/lib/python3.7/site-packages/theano/compile/mode.py", line 11, in <module>
import theano.gof.vm
File "/home/vaishnavnimkar/.local/lib/python3.7/site-packages/theano/gof/vm.py", line 674, in <module>
from . import lazylinker_c
File "/home/vaishnavnimkar/.local/lib/python3.7/site-packages/theano/gof/lazylinker_c.py", line 140, in <module>
preargs=args)
File "/home/vaishnavnimkar/.local/lib/python3.7/site-packages/theano/gof/cmodule.py", line 2396, in compile_str
(status, compile_stderr.replace('\n', '. ')))
Exception: Compilation failed (return status=1): /home/vaishnavnimkar/.theano/compiledir_Linux-5.2-2parrot1-amd64-x86_64-with-Parrot-4.7-stable--3.7.4+-64/lazylinker_ext/mod.cpp:1:10: fatal error: Python.h: No such file or directory. 1 | #include <Python.h>. | ^~~~~~~~~~. compilation terminated..
You need to install the python-dev extensions for proper header-files. For Debian distributions package is python3-dev which can be installed with apt-get. For Redhat distributions its python3-devel which might be installed with yum
I hope this should solve your problem.
I am running Linux Mint 18.1 and python 3.6.
I would like to install idle3.6 but after installing this package
i get the following error :
Traceback (most recent call last):
File "/usr/local/lib/python3.6/idlelib/pyshell.py", line 4, in
<module>
from tkinter import *
File "/usr/local/lib/python3.6/tkinter/__init__.py", line 36, in
<module>
import _tkinter # If this fails your Python may not be configured for
Tk
ModuleNotFoundError: No module named '_tkinter'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/idle3.6", line 3, in <module>
from idlelib.pyshell import main
File "/usr/local/lib/python3.6/idlelib/pyshell.py", line 7, in
<module>
"Your Python may not be configured for Tk. **", file=sys.__stderr__)
NameError: name 'sys' is not defined
what i understand is that i need to install the tkinter package.
what i have tried so far is this command:
sudo apt-get install python3-tk
but it i still get the above error.
which command should i use to install tkinter for python 3.6?
Here is a Linux Mint IDLE version: https://community.linuxmint.com/software/view/idle-python3.5, since you are using Linux Mint. There's not yet a idle-python3.6 version.
I am running Mac OS 10.10.5. and Python 3 and XCode 7.2.1. I installed SciKit-Learn and all of its dependencies with pip (PyCharm) and I am getting this error when I try to use the package. I tried it on another computer also running 10.10.5 and didn't get the error. Here is the full error message:
/Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5 /Users/jonathankogan/PycharmProjects/Test/test.py
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/sklearn/__check_build/__init__.py", line 44, in <module>
from ._check_build import check_build
ImportError: dynamic module does not define module export function (PyInit__check_build)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/jonathankogan/PycharmProjects/Test/test.py", line 2, in <module>
from sklearn import datasets
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/sklearn/__init__.py", line 56, in <module>
from . import __check_build
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/sklearn/__check_build/__init__.py", line 46, in <module>
raise_build_error(e)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/sklearn/__check_build/__init__.py", line 41, in raise_build_error
%s""" % (e, local_dir, ''.join(dir_content).strip(), msg))
ImportError: dynamic module does not define module export function (PyInit__check_build)
___________________________________________________________________________
Contents of /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/sklearn/__check_build:
__init__.py __pycache__ _check_build.cpython-35m-darwin.so
setup.py
___________________________________________________________________________
It seems that scikit-learn has not been built correctly.
If you have installed scikit-learn from source, please do not forget
to build the package before using it: run `python setup.py install` or
`make` in the source directory.
If you have used an installer, please check that it is suited for your
Python version, your operating system and your platform.