mlx: 'pip install mlx' does not seem to work correctly
Seems like the pip install does not install the correct package on my env
>> pip install mlx
Collecting mlx
Using cached mlx-0.0.0-py3-none-any.whl.metadata (505 bytes)
Using cached mlx-0.0.0-py3-none-any.whl (2.1 kB)
Installing collected packages: mlx
Successfully installed mlx-0.0.0
If you trace the installed package it gives
>> cd ~/opt/anaconda3/envs/test/lib/python3.9/site-packages/mlx
>> ls
__init__.py __pycache__
>> cat __init__.py
print("HELLO WORLD!")
Environment: M1 Mac Air + Miniconda
About this issue
- Original URL
- State: closed
- Created 7 months ago
- Reactions: 6
- Comments: 48 (20 by maintainers)
My problem is fixed. I was running iTerm on rosetta and Homebrew and all the installed packages (including python versions) were all i386 versions. I now switched completely to arm builds and
pip install mlxinstalls correctly and imports just fine. Thank you all πTo summarize on how to install MLX currently using the PyPI packages:
If you meet those requirements and it still doesnβt work, make sure you are using a native python. The output of:
python -c "import platform; print(platform.processor())"should bearm.This seems like something that should be mentioned in the readme/docs in BOLD. I didnβt use a native Python, but the following worked for me:
Iβve created a new conda env and now iβm getting the following error message
pip install mlxERROR: Could not find a version that satisfies the requirement mlx (from versions: none)ERROR: No matching distribution found for mlxEven triedpip install mlx==0.0.3ERROR: Could not find a version that satisfies the requirement mlx==0.0.3 (from versions: none)ERROR: No matching distribution found for mlx==0.0.3Python version: 3.10.13 Pip version: 23.3.1 Macbook air M1 2020 with 8GB memory running Sonoma 14.0 Build version: 23A344
I am having the same issue on a Macbook Air 2020 M1 with a fresh python 3.11 virtual environment. pip only downloads v.0.0.0 of mlx.
tried the following commands after upgrading pip as
pip install --upgrade pip(not in this order):pip install mlxpip --force-reinstall --no-cache-dir --upgrade mlxpip install mlx==0.0.3all of the above commands somehow downloads the v0.0.0.
ProductName: macOS ProductVersion: 13.5.1 BuildVersion: 22G90
I was hitting this and then realized it was because my pyenv/python/pip were all running under rosetta. You can check this with:
If you get back
armitβs the non-rosetta version. If you get backi386it is and you will have to use a non-rosetta python/pip.If youβre in deep with pyenv and pyenv-virtualenv I recommend setting a new
PYENV_ROOTfor your non-rosetta python versions and venvs and then re-evalling the pyenv init and pyenv virtualenv-inits.Nope still getting the same error
Just another (positive) data point: I had no issue with
pip install -U mlxon a fresh conda environment.OS: macOS 13.5.2 Host: MacBookPro17,1 Kernel: 22.6.0 CPU: Apple M1 GPU: Apple M1 Python 3.11.6 conda 23.9.0
It looks like we donβt have a wheel for python 12. So for now you can do:
We will add a wheel for python 12 ASAP
I found an easy fix to this issue:
if you see
i386when you run this command:python3 -c "import platform; print(platform.processor())"Just Download & install macOS 64-bit universal2 installer
Once done, you should see
armnow when you rerun:python3 -c "import platform; print(platform.processor())Now try pip install mlx , it should work.
Hmm very weird, it looks like it might have been a problem with VSCode. I was importing mlx on a jupyter notebook in VSCode and I was getting the above error I mentioned. I moved out of VSCode, and opened a notebook with the conda environment I initially created with an
armarch. I was able to successfully import mlx and I was even able to import mlx using Python in the terminal so it seems like a VSCode issue.Update: I got it to work on VSCode by following @awni your steps to create a fresh env, thanks for the help π
The install docs are updated to include the issues brought up in this thread. I am going to close this for now, but feel free to reopen if there are new issues with installation.
@oliverks your OS is below the supported versions. Your best bet is to update to macOS 13 or 14.
As I learned, the problem on my side in OSX version, Iβm still on Big Sur, but you have build only for 13.x and 14.x.
This seems to have worked for me
python3.10 -m pip install mlx, installed the right package.Your solution works for me. Thanks!
I did but that doesnβt seem to work either