bluesheeptoken / CPT

Compact Prediction Tree: A Lossless Model for Accurate Sequence Prediction (cython implementation)
https://cpt.readthedocs.io/en/latest/
MIT License
41 stars 7 forks source link

Mac M2 Isssue #109

Open Deepan-mn opened 7 months ago

Deepan-mn commented 7 months ago

I was not able install and run cpt in Mac M2 pro. Please provide a guide for it

bluesheeptoken commented 7 months ago

Hello, What have you tried so far?

Could you run a

python3 --version
python3 -m platform
python3 -m pip install cpt --verbose

And paste here the outputs?

bluesheeptoken commented 7 months ago

There is probably a wheel missing for M2 users. It seems like my CI is broken for macOS wheels.

Locally, I was able to install cpt 1.3.2. No new feature since then, only versions bumps. So if you have Python3.11, a python3 -m pip install cpt==1.3.2 should be enough

Deepan-mn commented 7 months ago

Hello, What have you tried so far?

Could you run a

python3 --version
python3 -m platform
python3 -m pip install cpt --verbose

And paste here the outputs?

python3 --version Python 3.9.18 python3 -m platform macOS-14.2.1-arm64-arm-64bit python3 -m pip install cpt --verbose Using pip 23.3.2 from /Users/deepan-11678/Documents/PythonWorkSpace/lib/python3.9/site-packages/pip (python 3.9) WARNING: Ignoring invalid distribution -rypto (/Users/deepan-11678/Documents/PythonWorkSpace/lib/python3.9/site-packages) Requirement already satisfied: cpt in /Users/deepan-11678/Documents/PythonWorkSpace/lib/python3.9/site-packages/cpt-1.3.4-py3.9-macosx-13-arm64.egg (1.3.4) WARNING: Ignoring invalid distribution -rypto (/Users/deepan-11678/Documents/PythonWorkSpace/lib/python3.9/site-packages)

Deepan-mn commented 7 months ago

There is probably a wheel missing for M2 users. It seems like my CI is broken for macOS wheels.

Locally, I was able to install cat 1.3.2. No new feature since then, only versions bumps. So if you have Python3.11, a python3 -m pip install cpt==1.3.2 should be enough

tried this one . but whl is not generated only cpt folder is there inside site-pakcages

bluesheeptoken commented 7 months ago

Thanks for the outputs, from what I am seeing, M1 and M2 should have the same wheels. And indeed, I cannot install 1.3.4 either.

Could you try a python3 -m pip uninstall cpt && python3 -m pip install cpt==1.3.2 --verbose? I believe this should do the trick for now while I investigate why the latests builds are broken

Deepan-mn commented 7 months ago

Thanks for the outputs, from what I am seeing, M1 and M2 should have the same wheels. And indeed, I cannot install 1.3.4 either.

Could you try a python3 -m pip uninstall cpt && python3 -m pip install cpt==1.3.2 --verbose? I believe this should do the trick for now while I investigate why the latests builds are broken

while i uninstalled and installed cpt again, this exception shows in import

Cannot find reference 'cpt' in 'imported module cpt | __init__.py'

bluesheeptoken commented 7 months ago

With which command the import is failing?

Deepan-mn commented 7 months ago

With which command the import is failing?

from cpt.cpt import Cpt cpt.cpt is not recognized not in Mac M2

in ubuntu it is working fine!

bluesheeptoken commented 7 months ago

Sorry for the noise, it looks like my MacOS ARM builds are broken atm (MacOS intel works fine though)

If you wish, you can try to install from sources while I publish other wheels. This ticket should give you a hand: https://github.com/bluesheeptoken/CPT/issues/68, I believe brew home has also changed, using a bit of this code should also help: https://github.com/bluesheeptoken/CPT/blob/c6d546baab27ef2227c80ed128af2227c9cbfab8/CI/github/build_wheels.sh#L8-L16

Sorry for the inconvenience, I will try to have a look at it

Deepan-mn commented 7 months ago
+ [[ '' == \m\a\c\O\S ]]
+ python -m pip install cibuildwheel==2.16.2
WARNING: Ignoring invalid distribution -rypto (/Users/username/Documents/PythonWorkSpace/lib/python3.9/site-packages)
Collecting cibuildwheel==2.16.2
  Downloading cibuildwheel-2.16.2-py3-none-any.whl.metadata (23 kB)
Collecting bashlex!=0.13 (from cibuildwheel==2.16.2)
  Downloading bashlex-0.18-py2.py3-none-any.whl (69 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 69.5/69.5 kB 1.1 MB/s eta 0:00:00
Collecting bracex (from cibuildwheel==2.16.2)
  Downloading bracex-2.4-py3-none-any.whl.metadata (3.6 kB)
Requirement already satisfied: certifi in /Users/user-name/Documents/PythonWorkSpace/lib/python3.9/site-packages (from cibuildwheel==2.16.2) (2023.11.17)
Requirement already satisfied: filelock in /Users/username/Documents/PythonWorkSpace/lib/python3.9/site-packages (from cibuildwheel==2.16.2) (3.13.1)
Requirement already satisfied: packaging>=20.9 in /Users/username/Documents/PythonWorkSpace/lib/python3.9/site-packages (from cibuildwheel==2.16.2) (23.2)
Collecting platformdirs (from cibuildwheel==2.16.2)
  Downloading platformdirs-4.1.0-py3-none-any.whl.metadata (11 kB)
Collecting tomli (from cibuildwheel==2.16.2)
  Using cached tomli-2.0.1-py3-none-any.whl (12 kB)
Requirement already satisfied: typing-extensions>=4.1.0 in /Users/usernameDocuments/PythonWorkSpace/lib/python3.9/site-packages (from cibuildwheel==2.16.2) (4.9.0)
Downloading cibuildwheel-2.16.2-py3-none-any.whl (74 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 74.5/74.5 kB 2.8 MB/s eta 0:00:00
Downloading bracex-2.4-py3-none-any.whl (11 kB)
Downloading platformdirs-4.1.0-py3-none-any.whl (17 kB)
WARNING: Ignoring invalid distribution -rypto (/Users/user-nameDocuments/PythonWorkSpace/lib/python3.9/site-packages)
Installing collected packages: tomli, platformdirs, bracex, bashlex, cibuildwheel
Successfully installed bashlex-0.18 bracex-2.4 cibuildwheel-2.16.2 platformdirs-4.1.0 tomli-2.0.1
+ python -m cibuildwheel --output-dir wheelhouse

cibuildwheel: Unable to detect platform. cibuildwheel should run on your CI server;
Travis CI, AppVeyor, Azure Pipelines, GitHub Actions, CircleCI, Gitlab, and Cirrus CI
are supported. You can run on your development machine or other CI providers
using the --platform argument. Check --help output for more information.

(PythonWorkSpace) user-name:$ python3 -m pip uninstall cpt && python3 -m pip install cpt==1.3.2 --verbose
WARNING: Ignoring invalid distribution -rypto (/Users/user-name/Documents/PythonWorkSpace/lib/python3.9/site-packages)
WARNING: Skipping cpt as it is not installed.
Using pip 23.3.2 from /Users/username/Documents/PythonWorkSpace/lib/python3.9/site-packages/pip (python 3.9)
WARNING: Ignoring invalid distribution -rypto (/Users/user-name/Documents/PythonWorkSpace/lib/python3.9/site-packages)
Collecting cpt==1.3.2
  Using cached cpt-1.3.2-cp39-cp39-macosx_11_0_arm64.whl (94 kB)
WARNING: Ignoring invalid distribution -rypto (/Users/user-name/Documents/PythonWorkSpace/lib/python3.9/site-packages)
Installing collected packages: cpt
Successfully installed cpt-1.3.2

But same import error persists. [cannot find reference]