Picking which Python XCode runs scripts on -
i have xcode project runs python scripts during build process. use python packages (beautifulsoup , slimit). setting project on new computer, , used homebrew install python, , pip install 2 packages.
unfortunately, when building project getting error
traceback (most recent call last): file "/users/supersloth/code/projectname/tools/mergehtml.py", line 7, in <module> import slimit importerror: no module named slimit
for while confusing because know slimit there. during research realized computer has 2 versions of python on it
io:~ supersloth$ /usr/local/bin/python -v python 2.7.9 io:~ supersloth$ /usr/bin/python -v python 2.7.6 io:~ supersloth$ python /usr/local/bin/python io:~ supersloth$ echo $path /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin io:~ supersloth$
and these 2 versions have different packages installed
default python (/usr/local)
['beautifulsoup4==4.3.2', 'pip==6.0.8', 'ply==3.4', 'setuptools==14.3', 'slimit==0.8.1']
and second installation doesn't have either (no pip list of packages from, no slimit when trying import hand)
>>> import slimit traceback (most recent call last): file "<stdin>", line 1, in <module> importerror: no module named slimit >>> import pip traceback (most recent call last): file "<stdin>", line 1, in <module> importerror: no module named pip >>>
this leads me believe xcode trying use python 2.7.6 without packages default building during xcode.
how change default, in order verify this?
one way force it.
#! path_to_desired_version
as first line of each python file.
also, if encounter again,
which -a python
will show alternatives have. without '-a', see 1 first in path.
Comments
Post a Comment