I have a question on how to use pip:

I just installed a package using `pip install pyodbc`. This downloads a 
precompiled version of pyodbc for my platform (macOS 10.12) and Python 
version (3.6), but unfortunately it does not work:

The reason is that the installed package contains a file 
site-packages/pyodbc.cpython-36m-darwin.so, which has a hard-coded 
dependency to /usr/local/opt/unixodbc/lib/libodbc.2.dylib (see below to 
check for yourself). Unfortunately, while libodbc is installed, it is not 
installed at that location on my computer. In fact, /usr/local/opt/ is a 
fairly uncommon path.

My questions:
1. Is there a way to tell pip to change the dependency paths for downloaded 
library? If so, how?
2. If not, is the recommended workaround to compile it myself (`pip install 
pyodbc --no-binary :all:`)?
3. Does pip support the concept of packages with binary code which depend 
on other (non-Python) libraries? If not, shouldn't these (likely) broken 
packages be removed from https://pypi.python.org/packages/?

Regards,
Freek

PS:
A quick check confirms that the path is hard-coded:
% wget 
https://pypi.python.org/packages/4d/4c/f6f708b0d55cc325116ff21ddaeb9161c5fe5046ddbdc00922da90363874/pyodbc-4.0.21-cp36-cp36m-macosx_10_6_intel.whl
% unzip pyodbc-4.0.21-cp36-cp36m-macosx_10_6_intel.whl
% otool -L pyodbc.cpython-36m-darwin.so
pyodbc.cpython-36m-darwin.so:
/usr/local/opt/unixodbc/lib/libodbc.2.dylib (compatibility version 3.0.0, 
current version 3.0.0)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 
104.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 
1252.0.0)

-- 
You received this message because you are subscribed to the Google Groups 
"virtualenv" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python-virtualenv+unsubscr...@googlegroups.com.
To post to this group, send email to python-virtualenv@googlegroups.com.
Visit this group at https://groups.google.com/group/python-virtualenv.
For more options, visit https://groups.google.com/d/optout.

Reply via email to