I get the following error when trying to import anydbm in python 2.7.6. Does anyone know whats going wrong? Appreciate your help.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/anydbm.py", line 50, in <module>
_errors.append(_mod.error)
AttributeError: 'module' object has no attribute 'error'
Try dbm it should work. I know in Python3 anydbm to dbm has been renamed.
import dbm
Reloading the information about available software in Ubuntus Software & Updates GUI fixed the problem.
Related
I'm using spyder 2 anaconda 2.3.0 on windows as a python IDE for python 2.7. I've been using this for a long time to code in python but suddenly I don't know what happened and it said I did not have biopython package installed, when I installed biopython using
conda -c install anaconda biopython
command, biopython started running however it broke pandas and numpy.
now when I import pandas I get this:
>>> import pandas as pd
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Anaconda\lib\site-packages\pandas\__init__.py", line 13, in
<module>
"extensions first.".format(module))
ImportError: C extension: hashtable not built. If you want to import pandas
from the source directory, you may need to run 'python setup.py build_ext --
inplace' to build the C extensions first.
and then when I import numpy I get this:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Anaconda\lib\site-packages\numpy\__init__.py", line 142, in <module>
from . import add_newdocs
File "C:\Anaconda\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "C:\Anaconda\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
from .type_check import *
File "C:\Anaconda\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "C:\Anaconda\lib\site-packages\numpy\core\__init__.py", line 26, in <module>
raise ImportError(msg)
ImportError:
Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control). Otherwise reinstall numpy.
Original error was: DLL load failed: The specified module could not be found.
I uninstalled numpy and pandas and then installed them back using pip ... still the same. I entirely unistalled anaconda and installed it back still the same errors. I really do not know what's causing this. Any help will be truly appreciated. I've been trying to fix this for the past three days and its not working out. Thanks for your time.
The caffe is installed on the Ubuntu server,and it test is ok. I just run the following code on the Ubutun(16.04) cloud server:
import caffe
from caffe.proto import caffe_pb2
label_map = caffe_pb2.LabelMap()
and I have run the command as following which provided by the internet, but there is still error:
command:
export PYTHONPATH=$/home2/challenge98/caffe/python:$PYTHONPATH
error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'LabelMap'
Could you guys give me some advices how to solve it. Thanks!
Should install the version of new caffe(https://github.com/weiliu89/caffe) for you work, although you have installed the BVLC caffe. –
I am working on learning how to use pandas but get the following error:
Traceback (most recent call last):
File "data_frame.py", line 2, in <module>
import pandas as pd
File "/Users/gregwinter/anaconda2/lib/python2.7/site-packages/pandas/__init__.py", line 13, in <module>
__import__(dependency)
File "/Users/gregwinter/numpy.py", line 22, in <module>
from pandas.compat.numpy_compat import *
File "/Users/gregwinter/anaconda2/lib/python2.7/site-packages/pandas/compat/numpy_compat.py", line 15, in <module>
_np_version = np.version.short_version
AttributeError: 'module' object has no attribute 'version'
I have no idea how to fix this. Anything you can tell be on how to fix this would be great.
You named a file of your own numpy.py:
/Users/gregwinter/numpy.py
Guess which one Python thinks pandas wants to import? :-) Rename your program, and remove any .pyc or .pyo files that are around.
I experienced this same problem after upgrading Jupyter, but did not have a local file named numpy.py. I was able to fix the issue on an Anaconda build by uninstalling/reinstalling pandas using: conda remove pandas and then conda install pandas
Problem was fixed.
I meet the some error, but the error for my situation is in mmcv library. I solve it with
pip install --upgrade packaging
here is reference link, hope this could help you.
I'm trying to use matplotlib but I'm getting this error saying "No Module named six". I read previous answers and installed six using pip and also tried pip install six --upgrade. But nothing worked. What could be wrong?
EDIT:
The TraceBack:
Traceback (most recent call last):
File "<string>", line 254, in run_nodebug
File "C:\Users\Akshay\Documents\Internship.py", line 290, in <module>
from matplotlib import pyplot
File "C:\Python27\lib\site-packages\matplotlib\__init__.py", line 105, in <module>
import six
ImportError: No module named six
And sorry I'm unfamiliar with the which command. I'm using Python 2.7, and the latest pip.
Out of nowhere I was trying to run a script I'd run hundreds of times that included the module beatbox. When I ran it I got this error:
import beatbox
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
zipimport.ZipImportError: can't decompress data; zlib not available
I tried restarting, no luck. Then tried importing some basic libraries
import datetime
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named datetime
Then things started getting weirder
from bs4 import beautifulsoup
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/bs4/__init__.py", line 30, in <module>
from .builder import builder_registry, ParserRejectedMarkup
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/bs4/builder/__init__.py", line 1, in <module>
from collections import defaultdict
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/collections.py", line 8, in <module>
from _collections import deque, defaultdict
ImportError: No module named _collections
I have no clue what's going on, haven't done anything significant lately.
Any ideas?
Wow, scary stuff.
The solution to this was from wim above.
I downloaded the latest version of python and installed it. Everything is working normally now. I have no clue what happened but we're all good