6

ORIGINAL POST:

I have a project that is requiring me to use underlying macOS install of Python 2.7.10 (it is a matter of how it was compiled). Is there a way to actually use the native macOS Python in the creation of a miniconda environment or is the only thing available to virtualenv the native Python? For example, conda create -n whatever python=2.7.10 will not work for what I am working with.

EDIT:

Is there any way to use the native macOS installed version of Python (in this case, 2.7.10 found in '/usr/bin/python'), when creating a new conda env (vs. pulling from miniconda's repos)? The particular vendor app I am working with, has modules expecting to see the specific compiled version, from Apple. I.e., it is not sufficient enough to conda create -n whatever python=2.7.10. I'm guessing this would be some kinda' clone exercise, if exists. If not used, errors (ex. below)

Thinking my only alternative is to virtualenv the native macOS python env. Meaning, I can use conda for most projects, but if I am working with something that has to be "native"... conda deactviate from base, and (as example) source native/bin/activate the 2.7.10 env.

(test2) $ 
(test2) $ python test.py
Fatal Python error: PyThreadState_Get: no current thread
Abort trap: 6
(test2) $ conda deactivate
(base) $ conda deactivate
$ source ~/virtualenvs/native/bin/activate
$ python --version
Python 2.7.10
(native) $ python test.py
pe2
c12
pe14
c15
pe13
pe10
pe11
pe3
p6
p7
p4
p5
c1
p8
p9
(native) $ 
Charlie
  • 61
  • 2
  • Yes, you should be able to. `conda` actually works with various programming languages, not just Python. Hopefully someone with experience will be able to chime in – juanpa.arrivillaga Feb 16 '19 at 00:33
  • 1
    As far as I know, there is no way to do this. Anaconda deliberately compile Python and the dependencies with the same compiler toolchain to minimize compatibility errors. If you give a description of what you're trying to do, we might be able to help. – darthbith Feb 17 '19 at 11:22
  • juanpa, Thank you and undertsand that conda can be flexible in language (beyond Python) and version. darthbith, I think you are following what I am asking -- and I am not finding anything that looks like you can do, either. Please see the edited version of the OP. – Charlie Feb 17 '19 at 14:54
  • Possible [XY problem](https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem)? – Keldorn Feb 17 '19 at 15:03
  • I guess you could suggest that, but with the edit I'm trying to show/clarify my question and give further example. The vendor code works with macOS supplied Python, not with a repo version of the same rev. Yes, I can craft a solution to my problem, outside of conda. Fundamentally, the question remains: does conda only use repo-ed version of Python in creation of environments? Alternately, anyway to solve this, all in the context of conda? – Charlie Feb 17 '19 at 15:27
  • I don't know then. Maybe [Allow use of system python in conda env?](https://stackoverflow.com/questions/29872316/allow-use-of-system-python-in-conda-env) can help, but it does not look clean. – Keldorn Feb 17 '19 at 16:04

0 Answers0