I am trying to use pyodbc on OS X 10.7 and Python 2.7.
But the 'import pyodbc' statement causes the following error:
>>> import pyodbc
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: dlopen(./pyodbc.so, 2): Symbol not found: _GetPrivateProfileString
Referenced from: /usr/lib/libiodbc.2.dylib
Expected in: flat namespace
I have been looking on Google and tried to reinstall pyodbc by following different tutorials, without any luck. Any help is appreciated.
Related
I've just got a new Macbook running OSX 10.15.7. I installed it from a Time Machine backup of my old machine.
Now when I try to import the ctypes library in Python:
python -c "import ctypes"
I see this:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/Cellar/python#3.9/3.9.1_2/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ctypes/__init__.py", line 8, in <module>
from _ctypes import Union, Structure, Array
ImportError: dlopen(/usr/local/Cellar/python#3.9/3.9.1_2/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib-dynload/_ctypes.cpython-39-darwin.so, 2): Symbol not found: __dyld_shared_cache_contains_path
Referenced from: /usr/local/Cellar/python#3.9/3.9.1_2/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib-dynload/_ctypes.cpython-39-darwin.so (which was built for Mac OS X 11.0)
Expected in: /usr/lib/libSystem.B.dylib
in /usr/local/Cellar/python#3.9/3.9.1_2/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib-dynload/_ctypes.cpython-39-darwin.so
I have no idea how to debug this - can anyone advise? It means I can't run Jupyter notebooks, among other things.
I'm getting an error that Django did not find the pyodbc library in the build directory. Will use an installed version.
Traceback (most recent call last):
File "C:\Users\ggang1\Downloads\pyodbc-4.0.17\pyodbc-4.0.17\tests3\test.py", line 5, in <module>
import pyodbc
ImportError: No module named pyodbc
Any help would be appreciated.
>>> import MySQLdb
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MySQL_python-1.2.4b4-py2.7-macosx-10.6-intel.egg/MySQLdb/__init__.py", line 19, in <module>
import _mysql
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MySQL_python-1.2.4b4-py2.7-macosx-10.6-intel.egg/_mysql.so, 2): no suitable image found. Did find:
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MySQL_python-1.2.4b4-py2.7-macosx-10.6-intel.egg/_mysql.so: mach-o, but wrong architecture
I'm having a lot of troubles with MySQLdb installation on MAC 10.6.8 I read many guides on how to solve without success.
What's the output on:
# which python
# which pip
If pip is installed try:
# pip install mysqldb
i use flask.I installed MySQL using easy_install mysql-python and then tried to run my app.py but got this lines of error.What is those mean?
Traceback (most recent call last):
File "app.py", line 7, in <module>
import MySQLdb
File "/Users/ozcan/Documents/python/venv/lib/python2.7/site-packages/MySQLdb/__init__.py", line 19, in <module>
import _mysql
ImportError: dlopen(/Users/ozcan/Documents/python/venv/lib/python2.7/site-packages/_mysql.so, 2): no suitable image found. Did find:
/Users/ozcan/Documents/python/venv/lib/python2.7/site-packages/_mysql.so: mach-o, but wrong architecture
I would suggest to use Flask-MySQL instead.
Here's documentation https://flask-mysql.readthedocs.org/en/latest/
I'm getting the below error while trying to import python module pjsua. I have Mac OS 10.8.1 version. I verified the solution provided in http://www.darrensessions.com/?p=292 and the solution seemed to have fixed this issue in MacOS-10.7. Seems like this is broken again for MacOS-10.8. I did not got any errors when compiling the code. Only get the below error when importing PJSUA module.
>>> import pjsua
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "pjsua.py", line 59, in <module>
import _pjsua
ImportError: dlopen(/Library/Python/2.7/site-packages/_pjsua.so, 2): Symbol not found: _AudioOutputUnitStart
Referenced from: /Library/Python/2.7/site-packages/_pjsua.so
Expected in: flat namespace
in /Library/Python/2.7/site-packages/_pjsua.so
Your help in highly appreciated.
Thanks,
One straight-forward solution would be (purely theoretical, haven't tested):
Look at http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/2011-November/013722.html
See, where the patch says:
# OS X Lion Support
if platform.mac_ver()[0].startswith("10.7"):
extra_link_args += ["-framework", "AudioUnit"]
Change line
if platform.mac_ver()[0].startswith("10.7"):
to
if platform.mac_ver()[0].startswith("10.7") or platform.mac_ver()[0].startswith("10.8"):
Recompile
-- edit --
Ok, I patched it as I suggested and:
> python ~/a.py
a
> cat ~/a.py
import pjsua
test = "a"
print test
This error was recently fixed as showed above in PJSIP 2.4 python package:
# OS X Lion (10.7.x) or above support
if version[0] == '10' and int(version[1]) >= 7:
extra_link_args += ["-framework", "AudioUnit"]
The funny thing is that I run in the same error:
macbookproloreto:python admin$ python samples/simplecall.py
Traceback (most recent call last):
File "samples/simplecall.py", line 23, in <module>
import pjsua as pj
File "/Library/Python/2.7/site-packages/pjsua.py", line 59, in <module>
import _pjsua
ImportError: dlopen(/Library/Python/2.7/site-packages/_pjsua.so, 2): Symbol not found: _pj_atexit
Referenced from: /Library/Python/2.7/site-packages/_pjsua.so
Expected in: flat namespace
in /Library/Python/2.7/site-packages/_pjsua.so
not understanding why since the Python setup.py script checking the platform version seems to be fine:
>>> import platform
>>> version = platform.mac_ver()[0].split(".")
>>> version
['10', '10', '4']
>>>