0

Like many others I was not able to install (using pip) pandas on my MacBook M1, eventually thanks to this answer I managed to install it from source.
After cloning pandas the steps are

source venv/bin/activate
pip install cython
cd pandas
python3 setup.py install

I am obviously able to do the same for every project (virtualenv) I work with, but I would like to install in each project the locally built pandas module (v1.3.0.dev0+1019.gc10dd1a5f1) without a full rebuild from source.

Is that possible?

Beppe C
  • 11,256
  • 2
  • 19
  • 41

2 Answers2

1

Instead of python3 setup.py install run pip wheel ., save the wheel from dist/ folder and next time install from the wheel:

pip install /path/to/pandas.whl
phd
  • 82,685
  • 13
  • 120
  • 165
  • Run `pip wheel .` didnt work, got a lot of errors ('clang: error: the clang compiler does not support 'faltivec')' but `python setup.py bdist_wheel` did the job creating a .whl file. What is the difference? – Beppe C Mar 12 '21 at 08:31
  • Shouldn't be that much. You can try `pip wheel -vvv .` to see what `pip` is doing. – phd Mar 12 '21 at 08:43
  • No luck, still lots of compilation error. I tried the same on a different module (requests) and `pip wheel` does not fail but it does not create the dist folder with the .whl file – Beppe C Mar 12 '21 at 08:53
  • My fault. The wheel(s) are created in the current directory, not in `dist/`. – phd Mar 12 '21 at 08:55
  • Yes, I see now in the root `requests-2.25.1-py2.py3-none-any.whl`. Pandas still no luck, I will try to grab the whole output log (now truncated by PyCharm terminal) – Beppe C Mar 12 '21 at 10:00
0

Run the following code

 brew install openblas

 pip3 install cython

 OPENBLAS="$(brew --prefix openblas)" pip3 install numpy --no-use-pep517

 OPENBLAS="$(brew --prefix openblas)" pip3 install pandas --no-use-pep517
dbc
  • 104,963
  • 20
  • 228
  • 340
pierra
  • 1