No module named '_gdbm' - python

I don't know much about python and I need help to install a python software.
I am using linux mint 12.8.
Since I have tried many things I think I have several versions of python installed (3.5 and 3.7 I think...).
When I run setup.py install I get:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 7, in <module>
import dbm.gnu as gdbm
File "/home/zach/10_Soft/anaconda3/lib/python3.7/dbm/gnu.py", line 3, in <module>
from _gdbm import *
ModuleNotFoundError: No module named '_gdbm'
I tried to install python3.5-gdbm (which appears to be up to date) and python3.7-gdbm (which is not found).
They both seem to be virtual packages of the same package python3-gdbm. I don't really know what to do with this information however...
Do you know what I should do?

I was able to solve this issue using this command:
sudo cp /usr/lib/python3.5/lib-dynload/_gdbm.cpython-35m-x86_64-linux-gnu.so /usr/lib/python3.7/lib-dynload/_gdbm.cpython-37m-x86_64-linux-gnu.so

Related

Where does Cygwin64 store/look for Python packages?

I'm trying to use Cygwin64 to run a python script, but it's not working because for some reason it can't find the module.
Traceback (most recent call last):
File "makeplot.py", line 1, in <module>
import vplanet
ModuleNotFoundError: No module named 'vplanet'
Where are modules installed in Cygwin64 and How do I make sure my module is installed?
It seems you are expecting that Cygwin version of Python should contain any type of module around.
If you look for vplanet, you will find the specific instruction for installation
https://virtualplanetarylaboratory.github.io/vplanet/install.html
python -m pip install vplanet
Have you tried it ?

No module named 'index' after install pyflann

I have some problems installing pyflann in python 3.7.3, after execute:
pip install pyflann
The installation is successfully accomplished, but when I import the library and a run a python program, I got this error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "D:\Anaconda3\lib\site-packages\pyflann\__init__.py", line 27, in <module>
from index import *
ModuleNotFoundError: No module named 'index'
I'm using window 10. How can I fixed?
pyflann does not have support for python 3 yet, according to this GitHub issue. Your two options are:
Install the pyflann-py3 package:
pip install pyflann-py3
Or, you could take the advice from the issue and use 2to3:
sudo 2to3 -w D:\Anaconda3\lib\site-packages\pyflann
The pyflann package is not compatible with Python 3. It looks like
it is not actively maintained, the last commit was in February 2017:
https://github.com/primetang/pyflann/commits/master
There is an open issues documenting the problem:
https://github.com/primetang/pyflann/issues/1
There are a few open PRs trying to add Python 3 support that were never
merged:
https://github.com/primetang/pyflann/pulls
You might have better luck with one of the forks, but I can't vouch for them,
I've never used pyflann:
https://github.com/primetang/pyflann/network/members

Module can be imported in the terminal, but not IDLE

Recently, when I use pip to install python modules, I will get an error saying that the module has not been downloaded when I run it in the IDLE. However, when I run the same script in the terminal, it works fine. What is this error and how can I solve it?
Traceback (most recent call last):
File "<pyshell#8>", line 1, in <module>
import gspread
ModuleNotFoundError: No module named 'gspread'
Probably you have different versions of python installed.
The version you used pip to install new modules is different from the version you access with IDLE.

Mac reinstall Python

I tried to use the Coursera course downloader from here and it worked for few courses but not all. They have recommended to use Python3.X. So I uninstalled Anaconda (version 2) from my Mac and installed Python3.5.1 from Python's website but still the course downloaders did not work as it was using default Python 2.7.
So I deleted Python from /usr/local/lib and now nothing is working. When I do which python it shows ``usr/local/bin/pythonand bothpythonandpython3` runs.
But when I do pip install coursera it throws error as follows:
Traceback (most recent call last):
File "/usr/local/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
ImportError: No module named pkg_resources
And when I do sudo easy_install pip, I get the following error.
Traceback (most recent call last):
File "/usr/local/bin/easy_install", line 5, in <module>
from pkg_resources import load_entry_point
ImportError: No module named pkg_resources
try Homebrew http://brew.sh/
brew install python3
curl bootstrap.pypa.io/get-pip.py | python3
Your Mac should have Python 2 and Python 3 installed by default. in the terminal "python" will launch Python2, "python3" will launch Python3. With Anaconda you could have just kept the Python 2 version and created an environment for Python 3, http://conda.pydata.org/docs/using/envs.html#managing-environments.
This is the solution you will most likely need, No module named pkg_resources. Setuptools is causing the issue and you will need to wget ez_setup.py. Reinstalling Anaconda will save you a lot of time and pain.

Run-Install python-meep Error

I am new in python meep. I try to use python-meep on Ubuntu 10.04 64 bit (virtual machine).
I install all the necessary things like PCRE swig and python meep, but when I try to run the samples it gives me the same error as in the beginning:
~/Desktop/Python/python-meep/samples/bent_waveguide$ python python_meep_bent_wg.py
Traceback (most recent call last):
File "python_meep_bent_wg.py", line 21, in <module>
from meep import * # make it 'meep_mpi' for MPI-meep and 'meep' for non-MPI meep
File "/usr/local/lib/python2.6/dist-packages/meep.py", line 4693, in <module>
import scipy.weave
ImportError: No module named scipy.weave
(about scipy I have a problem to install it - I get the message:
Error: Dependency is not satisfiable: python (<< 2.6)
... so I install it with dpkg -i, and then made some updates but in the end I have some kind of broken packages)
Right now I am really stuck and have no idea what to do. Maybe somebody has an idea how to fix it or install it correctly overcoming all these problems.
Try to use the python-setuptools, so you install the stuff with pip or easy_install.

Categories