I've been trying to run a web server based in Python 2.6 code here at work. The server requires the python LDAP libraries in order to run. Because I'm working on Mac OS X Lion, I needed to run a manual install of python-ldap 2.4.7 in order to get Python to recognize LDAP at all. Python-ldap appeared to intall correctly, but when I try to run the web server I get the following error (I added some line breaks for the sake of clarity):
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/python_ldap-2.4.7-py2.6-macosx-10.7-fat.egg/_ldap.so, 2): Symbol not found: _ber_pvt_opt_on
Referenced from: /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/python_ldap-2.4.7-py2.6-macosx-10.7-fat.egg/_ldap.so
Expected in: flat namespace
in /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/python_ldap-2.4.7-py2.6-macosx-10.7-fat.egg/_ldap.so
I'm using OpenLDAP 2.4.21, and I set the following system variables before running my python-ldap installation:
export ARCHFLAGS="-arch i386"
export CFLAGS="-isysroot /Developer/SDKs/MacOSX10.7.sdk -arch i386"
export MACOSX_DEPLOYMENT_TARGET="10.7"
I should also probably mention that I've had to force everything I've installed to use 32-bit architecture instead of 64-bit in order to work around some issues with Oracle's 64-bit support. Has anyone encountered a similar situation, or do they know the significance of the "_ber_pvt_opt_on" symbol that LDAP was looking for? The number of Google results I was able to come up with was both small and unhelpful. Any light that you could shed on the situation would be greatly appreciated.
Related
After updating to Mac Catalina (version 10.15.6), I had to re-install Python and all dependent modules.
My problem now is that when adding the module ibm_db, I get the following error message when trying to run my program:
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ibm_db.cpython-37m-darwin.so, 2): Symbol not found: ___cxa_throw_bad_array_new_length
Referenced from: /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/clidriver/lib/libdb2.dylib
Expected in: /usr/lib/libstdc++.6.dylib
in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/clidriver/lib/libdb2.dylib
I am using PyCharm 2018.3.7 (CE).
Anyone that has seen this, and have a fix for this?
The problem is due to older version of /usr/lib/libstdc++.6.dylib installed in your system. New installation of ibm_db is looking for newer version of libstdc++.6.dylib.
There are two quick solution for it. You can use either one:
Install new gcc of version >= 8 in your system and set environment variable to use it so that libstdc++.6.dylib from new version of gcc should get picked up instead of existing old one.
OR,
export DYLD_LIBRARY_PATH=/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/clidriver/lib
Thanks.
I'll start off with saying I read this post already and could not find an answer.
I am on Windows 10, and have been trying to install pipenv through powershell.
Only, it returns me the following error:
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
So I then downloaded ssl-1.16 from this website, but then ran into another error:
ValueError: This extension should not be used with Python 2.6 or later (already built in), and has not been tested with Python 2.3.4 or earlier.
I checked a few forums and still cannot seem to find an answer. So if anyone would know how to come to terms with that, I'd be truly grateful. :)
Thanks
Since my Macbook with an i7 CPU is currently with AppleCare, I am now working on an older Mac mini with a core duo CPU. I simply connected the Macbook's internal disk via USB to the Mac mini.
Now back at my Python scripts, I ran into a problem which I don't fully understand and do not know how to debug. When I import pandas in Python 2.7.9, Python crashes completely and I get the error Illegal instruction: 4. After some googling I assume, that some packages are compiled for the wrong architecture. But I don't know which ones.
I installed Python, numpy and scipy with homebrew and pandas, etc. with pip into a virtual environment. My system is OS X 10.10.5.
The output of python -vc "import pandas" is very long and given here.
I tried re-installing Python, pandas, numpy, and scipy.
How can I find out which package is causing the error?
Do I need to set an architecture flag or something?
How can I fix this?
Removing the .pyc files might work too.
Since it happens right after the call to
dlopen("/usr/local/lib/python2.7/site-packages/matplotlib/_pabc.so", 2);,
you can try checking the arch type that file was built for with:
file /usr/local/lib/python2.7/site-packages/matplotlib/_pabc.so
then check the arch type of your hardward:
uname -a
If the shared object file (_pabc.so) was not built for that machine you may need to re compile/install/whatever, matplotlib or one of its dependancies.
In my recent experience, this was indeed caused by a linked library being of the wrong architecture as the module's library (as chown suggested).
In particular, a C-compiled python library as part of the python module you're importing (the _mymodule.so file in the module directory) calling a linked system library (eg. libgfortran.dylib), and there being an architecture mismatch between the two.
As aforementioned, you can check the architecture of your system with uname -a and check the arch of an offending dylib via the file /path/to/lib.dylib command.
I'm trying to install Trac manually for the first time. I don't want to use a one-click-installer like Bitmani, I want to learn how to install Trac manually, so I'm following the instructions carefully. I'm installing it in a Windows localhost for now, before installing it in a Linux environment.
As I follow the instructions carefully, I needed to install Python+MySQLDb, and I read this:
thread-safety is important
(...) verify that it is thread-safe by calling MySQLdb.thread_safe() from a standalone Python script (i.e., not under Apache). If the stand-alone test reports that MySQLdb is indeed thread-safe (...)
I've just installed MySQLDb 1.2.4 and I'd like to verify this. I've Googled but I haven't found an example about this, and I have no idea about Python. How can I verify if I've got a thread-safe installation?
Run this command. If you get 1 in the output, your installation is threadsafe.
python -c "import MySQLdb ; print MySQLdb.thread_safe()"
I am trying to install mod_wsgi and django. When i "make" mod_wsgi then i get error if i use python2.7 but it went ok with default python.
i already wasted much time to figure that but could not solve it.
I just wanted to know that if continue with default python and install Django then can i change the python to 2.7 later
EDIT:
CENTOS5.5
The error i get is
/usr/bin/ld:
/opt/python27/lib/libpython2.7.a(node.o):
relocation R_X86_64_32 against `a
local symbol' can not be used when
making a shared object; recompile with
-fPIC
/opt/python27/lib/libpython2.7.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
apxs:Error: Command failed with rc=65536
.
make: * [mod_wsgi.la] Error 1
this all heppens if i do
"make" in mod_wsgi directory
Now this error is written on their help site
But i could not configure these things.
According to them
If the version of Python being used
was compiled for X86 64 bit
architecture and a shared library does
exist, but not in the 'config'
directory, then adding the missing
symlink may be all that is required.
i have found that my python version is 64bit . So the only thing left is the other option he talked in above text.
I don't know how to
1) Check if shared library does exist
2) How to add the missing symlink
If i make the mos_wsgi using default python then i get no error.
I just wanted to know that if continue with default python and install Django then can i change the python to 2.7 later
Yes. Upgrades are permitted. AFAIK, there's no law that says you are not permitted to upgrade. Indeed, why ask if an upgrade is possible? Have you been told that you're not permitted to upgrade?
Use the default Python.
Learn Python. Do the entire tutorial.
Install Django.
Learn Django. Do the entire tutorial.
When you go to install mod_wsgi (which you should not do first) please search for CentOS and mod_wsgi. Search is an important skill.
Problem with Django setup using mod_wsgi and apache on centos 5.4
http://library.linode.com/frameworks/django-apache-mod-wsgi/centos-5
And upgrades are permitted. Don't ask for permission. Search for relevant issues.