1 year ago

#319078

test-img

Pepsi-Joe

Is it possible to create a conda environment with python compiled for a different architecture?

I have an M1 mac and would like to run multiple conda environments with python copiled for different architectures.

I have been using Anaconda to manage environments via rosetta2 and it works perfectly.

However, I have recently tried installing ARM-compiled python using the guide in this answer to install miniconda and that gave a pretty significant speed improvement in my quick test.

Using rosetta2:

In [1]: import numpy as np

In [2]: %%timeit
   ...: a=np.linspace(1,100,10000)
   ...: a*=3.14
   ...: a+=a
   ...: a**2
   ...: 
   ...: 
32.7 µs ± 50.6 ns per loop (mean ± std. dev. of 7 runs, 10000 loops each)

Using native ARM python:

In [1]: import numpy as np

In [2]:  %%timeit
   ...: a=np.linspace(1,100,10000)
   ...: a*=3.14
   ...: a+=a
   ...: a**2
   ...: 
   ...: 
22.3 µs ± 145 ns per loop (mean ± std. dev. of 7 runs, 10,000 loops each)

My problem is that I have some code that will not run using the native ARM python as it uses packages that are not compatible (yet).

At the moment, I have both anaconda and miniconda installed in different locations and can switch between which version is called using conda by finding the path to their conda executable and running absolute/path/to/executable/conda init.

So what I would like to do is to create a conda environment that acts like the miniconda installation so that I can easily switch between environments if I require performance or compatibility. Is this possible?

python

anaconda

conda

apple-m1

rosetta-2

0 Answers

Your Answer

Accepted video resources