Closed Hammad-NobleAI closed 2 years ago
I'm not sure what's going on here because distutils.msvccompiler
is the microsoft visual C++ compiler that you're trying to use. It seems to me like something is broken with your python install. Perhaps it is the Compiler: Installed through Pypi
step you mentioned, which is not necessary. I have an M1 MacBook pro and can install SCS using pip on a clean conda env without issue.
The arm64 wheel is no longer in pypi. I can pip install as I have the wheel in my pip cache but anybody who does not have it in their cache already cannot install it and gets the same error as the OP.
Hm, ok. Was the arm64 mac-os wheel was ever on pypi? The wheels are built and uploaded by this github action and I'm not sure how that could be updated to also upload the arm64 wheels. If anyone knows I would be happy to accept a PR.
On my M1 Macbook pro it appears to successfully use the x86_64 wheel, I'm not sure how, perhaps emulation?
2022-08-16 16:35:52 (base) 0 bodonoghue@bodonoghue-macbookpro2:~:
=> conda activate clean
2022-08-16 16:36:00 (clean) 0 bodonoghue@bodonoghue-macbookpro2:~:
=> pip install scs
Collecting scs
Using cached scs-3.2.0-cp310-cp310-macosx_10_9_x86_64.whl (11.4 MB)
Collecting scipy>=0.13.2
Downloading scipy-1.9.0-cp310-cp310-macosx_12_0_universal2.macosx_10_9_x86_64.whl (58.4 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 58.4/58.4 MB 42.1 MB/s eta 0:00:00
Collecting numpy>=1.7
Downloading numpy-1.23.2-cp310-cp310-macosx_10_9_x86_64.whl (18.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 18.1/18.1 MB 57.3 MB/s eta 0:00:00
Installing collected packages: numpy, scipy, scs
Successfully installed numpy-1.23.2 scipy-1.9.0 scs-3.2.0
2022-08-16 16:36:15 (clean) 0 bodonoghue@bodonoghue-macbookpro2:~:
=> python
Python 3.10.4 (main, Mar 31 2022, 03:38:35) [Clang 12.0.0 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
im>>> import scs
scs.__version__
>>> scs.__version__
'3.2.0'
I have a scs-3.2.0-cp38-cp38-macosx_12_0_arm64.whl
file in my pip cache so I assume it was as it worked fine last week. pip attempts to use scs-3.2.0.tar.gz
which fails with the same error as the OP's error.
And if I use the same python version and download the cp310 x86 wheel manually I get the following. Not sure if Conda is doing something different to pip.
pip install scs-3.2.0-cp310-cp310-macosx_10_9_x86_64.whl
ERROR: scs-3.2.0-cp310-cp310-macosx_10_9_x86_64.whl is not a supported wheel on this platform.
It is possible that it might work under emulation, but for our project, emulation is off the table. Just to add to this... if I clone the scs-python repository and build it using python setup.py install
it installs with no issues.
Ok looks like building from source is the workaround for M1 macs for now. I'm not sure a better option is available until we can automate building and uploading MacOS arm64 wheels from github actions.
Specifications
Description
I'm trying to add scs (it's a dependency of another library for our project) to my Poetry environment, but it seems to fail on importing 'distutils.msvccompiler'. However, when I run Python CLI inside the Poetry virtual env and manually import it, there seems to be no issue with importing it. I installed LAPACK and OPENBLAS through brew using the following set of commands:
How to reproduce
pip install scs
orpoetry add scs
Output