Pyculib ImportError: cannot import name config - python

when trying to import pyculib I get ImportError: cannot import name config
I have tried pip installing and conda installing various versions of the cudatoolkit but none seem to work.
import pyculib
I get this error the first time I try to import pyculib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/andillio/anaconda2/lib/python2.7/site-packages/pyculib/__init__.py", line 49, in <module>
from . import blas, sparse, fft, rand, sorting
File "/home/andillio/anaconda2/lib/python2.7/site-packages/pyculib/sorting/__init__.py", line 1, in <module>
from .radixsort import RadixSort
File "/home/andillio/anaconda2/lib/python2.7/site-packages/pyculib/sorting/radixsort.py", line 38, in <module>
lib = load_lib('radixsort')
File "/home/andillio/anaconda2/lib/python2.7/site-packages/pyculib/sorting/common.py", line 24, in load_lib
libpath = os.path.join(findlib.get_lib_dir(), fullname)
AttributeError: 'module' object has no attribute 'get_lib_dir'
and this error if I try a second time
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named config

Related

sklearn.utils module is not found

So I have sklearn installed, but for some reason whenever I try to import sklearn it says:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\joeya\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\sklearn\__init__.py", line 82, in <module>
from .base import clone
File "C:\Users\joeya\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\sklearn\base.py", line 17, in <module>
from .utils import _IS_32BIT
ModuleNotFoundError: No module named 'sklearn.utils'
Does anyone have any ideas? I have Python 3.8.7 installed.

how to correct AttributeError

i have imported ncurses but it shows me this error
Traceback (most recent call last):
File "C:\Users\jai.best-PC\Desktop\the real snk game.py", line 1, in <module>
import ncurses
File "C:\Python27\lib\ncurses.py", line 8, in <module>
import _curses
File "C:\Python27\lib\_curses\__init__.py", line 59, in <module>
import has_key
File "C:\Python27\lib\_curses\has_key.py", line 11, in <module>
_curses.KEY_A1: 'ka1',
AttributeError: 'module' object has no attribute 'KEY_A1'
why i get an Attribute Error here while
import _curses
_capability_names = {
_curses.KEY_A1: 'ka1',
i have it here in has_key.py module
Since you are on windows, python curses isn't provided inbuilt.
Try:
pip install windows-curses

library importing issues in pycharm

I'm doing a project on opencv python which is based on downloaded source code from the internet. When I run the code, this error occurs
C:\Users\Udara\AppData\Local\Programs\Python\Python38-32\python.exe C:/Users/Udara/Desktop/7777/people-counting-opencv/people_counter.py
Traceback (most recent call last):
File "C:/Users/Udara/Desktop/7777/people-counting-opencv/people_counter.py", line 13, in <module>
from pyimagesearch.centroidtracker import CentroidTracker
File "C:\Users\Udara\Desktop\7777\people-counting-opencv\pyimagesearch\centroidtracker.py", line 5, in <module>
import ordereddict
File "C:\Users\Udara\AppData\Local\Programs\Python\Python38-32\lib\site-packages\ordereddict.py", line 23, in <module>
from UserDict import DictMixin
ModuleNotFoundError: No module named 'UserDict'

import matplotlib failed in Anaconda python3.6

I installed Anaconda to simplify the management of many python modules.
After that i tried to "import subprocess":
>>> import subprocess
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/sej/.config/anaconda3/lib/python3.6/subprocess.py", line 155, in <module>
_PopenSelector = selectors.SelectSelector
AttributeError: module 'selectors' has no attribute 'SelectSelector'
How to fix this?
I came accross this problem by trying to use matplotlib.
When trying to import it, this error comes up:
>>> import matplotlib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/sej/.config/anaconda3/lib/python3.6/site-packages/matplotlib/__init__.py", line 127, in <module>
from matplotlib.compat import subprocess
File "/home/sej/.config/anaconda3/lib/python3.6/site-packages/matplotlib/compat/subprocess.py", line 27, in <module>
import subprocess
File "/home/sej/.config/anaconda3/lib/python3.6/subprocess.py", line 155, in <module>
_PopenSelector = selectors.SelectSelector
AttributeError: module 'selectors' has no attribute 'SelectSelector'

python-dbg can't find Py_InitModule4 when debugging

I'm trying to debug a segfault i get in a multithreaded, qt webkit application. I installed python-dbg for the purpose of giving me pretty printing in gdb and get the following error on start
python2.7-dbg node.py
Traceback (most recent call last):
File "node.py", line 4, in <module>
import msgpack
File "/usr/lib/pymodules/python2.7/msgpack/__init__.py", line 3, in <module>
from msgpack._msgpack import *
ImportError: /usr/lib/pymodules/python2.7/msgpack/_msgpack.so: undefined symbol: Py_InitModule4
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/apport_python_hook.py", line 64, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python2.7/dist-packages/apport/__init__.py", line 1, in <module>
from apport.report import Report
File "/usr/lib/python2.7/dist-packages/apport/report.py", line 20, in <module>
import apport.fileutils
File "/usr/lib/python2.7/dist-packages/apport/fileutils.py", line 22, in <module>
from apport.packaging_impl import impl as packaging
File "/usr/lib/python2.7/dist-packages/apport/packaging_impl.py", line 20, in <module>
import apt
File "/usr/lib/python2.7/dist-packages/apt/__init__.py", line 21, in <module>
import apt_pkg
ImportError: /usr/lib/python2.7/dist-packages/apt_pkg.so: undefined symbol: Py_InitModule4
Original exception was:
Traceback (most recent call last):
File "node.py", line 4, in <module>
import msgpack
File "/usr/lib/pymodules/python2.7/msgpack/__init__.py", line 3, in <module>
from msgpack._msgpack import *
ImportError: /usr/lib/pymodules/python2.7/msgpack/_msgpack.so: undefined symbol: Py_InitModule4
I get the same thing when I run a version of the script that doesn't use msgpack...
Traceback (most recent call last):
File "scraper.py", line 2, in <module>
from planeswalker import PlaneswalkerParser
File "/var/www/rails_projects/MCPro.com/lib/planeswalker/planeswalker.py", line 2, in <module>
from PyQt4.QtCore import *
ImportError: /usr/lib/python2.7/dist-packages/PyQt4/QtCore.so: undefined symbol: Py_InitModule4
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/apport_python_hook.py", line 64, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python2.7/dist-packages/apport/__init__.py", line 1, in <module>
from apport.report import Report
File "/usr/lib/python2.7/dist-packages/apport/report.py", line 20, in <module>
import apport.fileutils
File "/usr/lib/python2.7/dist-packages/apport/fileutils.py", line 22, in <module>
from apport.packaging_impl import impl as packaging
File "/usr/lib/python2.7/dist-packages/apport/packaging_impl.py", line 20, in <module>
import apt
File "/usr/lib/python2.7/dist-packages/apt/__init__.py", line 21, in <module>
import apt_pkg
ImportError: /usr/lib/python2.7/dist-packages/apt_pkg.so: undefined symbol: Py_InitModule4
Original exception was:
Traceback (most recent call last):
File "scraper.py", line 2, in <module>
from planeswalker import PlaneswalkerParser
File "/var/www/rails_projects/MCPro.com/lib/planeswalker/planeswalker.py", line 2, in <module>
from PyQt4.QtCore import *
ImportError: /usr/lib/python2.7/dist-packages/PyQt4/QtCore.so: undefined symbol: Py_InitModule4
in both cases its looking Py_InitModule4... any ideas python experts? Code runs fine (except for the segfault much later) with normal python 2.7
If there's an easier way to get pretty printing in gdb I'm open to that as well. Basically just looking for a python style stacktrace
after a bit of poking it looked like there were bugs related to this in past ubuntu python-dbg libraries. I filed a bug in suit and found out I just didn't read documentation. It is required to install the -dbg version of a library (MySQLdb and PyQT4 in this case)
There is no version for message pack so i'm posting another question on how to do that
here was the bug report marked invalid for reference https://bugs.launchpad.net/ubuntu/+source/python2.7/+bug/1040914

Categories

Resources