32bit Python not working with sqlite3 - python

I have a very weird problem, my 64 bit python works fine with sqlite3, there are no errors when I import sqlite3. However, my 32 bit python won't work, here's the error message. I installed python using homebrew, and I'm using the lastest version of OS X Lion and Xcode. Any help would be appreciated.
Edit: On my friend's computer, also a mac, sqlite3 works with both 32 bit and 64 bit python.
Python 2.7.2 (default, Mar 19 2012, 20:52:31)
[GCC 4.2.1 Compatible Apple Clang 3.1 (tags/Apple/clang-318.0.54)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sqlite3/__init__.py", line 24, in <module>
from dbapi2 import *
File "/usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sqlite3/dbapi2.py", line 27, in <module>
from _sqlite3 import *
ImportError: dlopen(/usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_sqlite3.so, 2): Symbol not found: _sqlite3_aggregate_context
Referenced from: /usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_sqlite3.so
Expected in: dynamic lookup

Related

Python 3: No module named 'AudioSignal'

The code below gives this error when I'm trying to execute it:
>>> import nussl
>>> history = nussl.AudioSignal('HistoryRepeatingPropellerHeads.wav')
Error is:
C:\Users\MyPCUser>python
Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:57:15) [MSC v.1915 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import nussl
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\MyPCUser\AppData\Local\Programs\Python\Python37\lib\site-packages\nussl\__init__.py", line 26, in <modul
e>
from .core.constants import *
File "C:\Users\MyPCUser\AppData\Local\Programs\Python\Python37\lib\site-packages\nussl\core\__init__.py", line 7, in <m
odule>
from audio_signal import AudioSignal
ModuleNotFoundError: No module named 'audio_signal'
>>>
This module does not work yet (23-Feb-2019) with Python 3 according to Issue 135 and Issue 133. From the docs: This package has been tested with python 2.7, but not python 3.x yet. Use python 3 at your own peril!
I got the same issue when trying to use it with Python 3.

python3 does not allow urllib import

I installed anaconda for Python 3.6 in MacOs Sierra.
It comes with its own python and it changed the default python to this new one.
Now, I am not able to import anything from urllib.
Here is a snippet of my terminal.
Can someone give some suggestions?
devassy#mydire $ python
Python 3.6.5 |Anaconda, Inc.| (default, Apr 26 2018, 08:42:37)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from urllib.request import url2pathname
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/devassy/anaconda3/lib/python3.6/urllib/request.py", line 2585, in <module>
from _scproxy import _get_proxy_settings, _get_proxies
ImportError: dlopen(/Users/devassy/anaconda3/lib/python3.6/lib-dynload/_scproxy.cpython-36m-darwin.so, 2): Symbol not found: _iconv
Referenced from: /usr/lib/libcups.2.dylib
Expected in: /Users/devassy/anaconda3/lib/libiconv.2.dylib
in /usr/lib/libcups.2.dylib
>>>

Python 3 cannot import socket in CMD but available in IDLE

I have installed python 3.7 on my computer. It seems not possible to import socket in CMD:
C:\Users\Sina\py
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:06:47) [MSC v.1914 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python37-32\lib\socket.py", line 49, in <module>
import _socket
ImportError: Module use of python27.dll conflicts with this version of
Python.
>>>
But surprisingly, I am able to import socket in IDLE (Python 3.7).
I searched but didn't find any 'python27.dll' file in the installation directory
of python 3.7 (C:\Python37-32)
EDIT: There was a _socket.pyd file at "C:\Users\Sina" which used to make the confliction. I deleted it and the problem got fixed. Thanks to Aran-Fey!

Cannot import python naoqi library after upgrading Ubuntu 14.04 to 16.04

I have recently upgraded the system to 16.04 Gnome. The most troubling thing that I am facing is that I cannot import a NAOqi library for my work. The python version of this library was pretty simple to set-up. One just has to untar the file and then enter a path variable called PYTHONPATH pointing to this library and it worked like a charm in 14.04. Now since upgrade I am facing:
Python 2.7.12 (default, Jul 1 2016, 15:12:24)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import naoqi
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/dell/nao_sdk/pynaoqi/naoqi.py", line 7, in <module>
import qi
File "/home/dell/nao_sdk/pynaoqi/qi/__init__.py", line 72, in <module>
from _qi import Application as _Application
ImportError: libqipython.so: cannot open shared object file: No such file or directory
If I add a path variable:
export LD_LIBRARY_PATH=:/home/dell/nao_sdk/pynaoqi/
The error changes to:
Python 2.7.12 (default, Jul 1 2016, 15:12:24)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import naoqi
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/dell/nao_sdk/pynaoqi/naoqi.py", line 7, in <module>
import qi
File "/home/dell/nao_sdk/pynaoqi/qi/__init__.py", line 72, in <module>
from _qi import Application as _Application
ImportError: libboost_regex.so.1.55.0: cannot open shared object file: No such file or directory
Please help me what should I do to get it working? I have also used python 2.6.9 but same error occurs with error below.
ImportError: libboost_python.so.1.55.0: cannot open shared object file: No such file or directory
Installing libboost1.55 did the trick. 16.04 comes with libboost1.58 but naoqi is not yet compatible with it. Manual installation of libboost1.55 solved the import error.

ImportError: DLL load failed with downloaded PYQT4. 64bit python2.7

I am going to run a GUI program with main.py
After I run the main.py with using cmd, it shows the result.
Traceback (most recent call last):
File "Main.py", line 1, in <module>
from MainGlobalVar import *
File "C:\G02FYP\MainGlobalVar.py", line 4, in <module
from NetworkConsole import *
File "C:\G02FYP\NetworkConsole.py", line 1, in <modul
from PyQt4.QtGui import *
ImportError: DLL load failed: %1 is not a valid Win32 application.
I have double-checked that my version is 64 and I have re-installed the PYQT4
with using 64bits and python 2.7.9
Moreover,if I type python in cmd, it shows:
C:\>python
Python 2.7.9 (default, Dec 10 2014, 12:24:55) [MSC v.1500 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>>
What should i do for this importerror.

Categories