Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seeking assistance with ttpy installation #97

Open
juan0603-chem opened this issue Oct 16, 2023 · 4 comments
Open

Seeking assistance with ttpy installation #97

juan0603-chem opened this issue Oct 16, 2023 · 4 comments
Labels

Comments

@juan0603-chem
Copy link

Hi! I'm trying to run !pip install ttpy but I'm facing some problems in my laptop and in Colab. The error in my laptop is the following:
image
And in colab this:
image
I was trying to downgrade the version of numpy because of disutils deprecation, and then the error chenged to the ones above. I need help :c. It seems to work with docker, but I have not too much experience with it. thanks for your attention.

@daskol
Copy link
Collaborator

daskol commented Oct 18, 2023

Indeed, numpy.distutils was deprecated and removed Python 3.12. In order to fix this issue it takes a while since we need to update all package building scripts.

In case if you are working in Google Colab (or Python <3.12 on your laptop) then you can try to install the latest ttpy version directly from repository as follows.

!git clone --recursive https://github.com/oseledets/ttpy.git
!pip -v install ./ttpy

And now you can start using it.

import tt
tt.rand(n=2, d=5)
# This is a 5-dimensional tensor 
# r(0)=1, n(0)=2 
# r(1)=2, n(1)=2 
# r(2)=2, n(2)=2 
# r(3)=2, n(3)=2 
# r(4)=2, n(4)=2 
# r(5)=1

@ACE07-Sev
Copy link

Issue is still persisting.

@ACE07-Sev
Copy link

Submodule path 'tt/cross/rectcross': checked out 'a9b840412775326731c4ba4d35fb196e1d212771'
Submodule path 'tt/cross/rectcross/rect_maxvol': checked out 'ddfbe3d6c69cb261396768974de0a277368448fb'
Submodule path 'tt/tt-fort': checked out '65a62e3a4d7b10ffd00e55628ba1216d1dae3fd9'
Submodule path 'tt/utils/rect_maxvol': checked out 'ddfbe3d6c69cb261396768974de0a277368448fb'
Cloning into 'ttpy'...
Submodule 'tt/cross/rectcross' (https://bitbucket.org/oseledets/rectcross) registered for path 'tt/cross/rectcross'
Submodule 'tt/tt-fort' (https://github.com/oseledets/tt-fort.git) registered for path 'tt/tt-fort'
Submodule 'tt/utils/rect_maxvol' (https://bitbucket.org/muxas/rect_maxvol) registered for path 'tt/utils/rect_maxvol'
Cloning into 'C:/Users/A.C.EA/AppData/Local/Programs/Microsoft VS Code/ttpy/tt/cross/rectcross'...
Cloning into 'C:/Users/A.C.EA/AppData/Local/Programs/Microsoft VS Code/ttpy/tt/tt-fort'...
Cloning into 'C:/Users/A.C.EA/AppData/Local/Programs/Microsoft VS Code/ttpy/tt/utils/rect_maxvol'...
Submodule 'rect_maxvol' (https://bitbucket.org/muxas/rect_maxvol) registered for path 'tt/cross/rectcross/rect_maxvol'
Cloning into 'C:/Users/A.C.EA/AppData/Local/Programs/Microsoft VS Code/ttpy/tt/cross/rectcross/rect_maxvol'...
Using pip 23.3.2 from [C:\Users\A.C.EA\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip](file:///C:/Users/A.C.EA/AppData/Local/Programs/Python/Python312/Lib/site-packages/pip) (python 3.12)
Processing [c:\users\a.c.ea\appdata\local\programs\microsoft](file:///C:/users/a.c.ea/appdata/local/programs/microsoft) vs code\ttpy
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'error'
  Running command pip subprocess to install build dependencies
  Collecting setuptools>=40.6.0
    Using cached setuptools-69.0.3-py3-none-any.whl.metadata (6.3 kB)
  Collecting wheel
    Using cached wheel-0.42.0-py3-none-any.whl.metadata (2.2 kB)
  Collecting numpy
    Downloading numpy-1.26.3-cp312-cp312-win_amd64.whl.metadata (61 kB)
       ---------------------------------------- 0.0/61.2 kB ? eta -:--:--
       ------------ ------------------------- 20.5/61.2 kB 330.3 kB/s eta 0:00:01
       ------------------------------- ------ 51.2/61.2 kB 525.1 kB/s eta 0:00:01
       -------------------------------------- 61.2/61.2 kB 542.2 kB/s eta 0:00:00
  Collecting Cython
    Downloading Cython-3.0.8-cp312-cp312-win_amd64.whl.metadata (3.2 kB)
  Using cached setuptools-69.0.3-py3-none-any.whl (819 kB)
  Using cached wheel-0.42.0-py3-none-any.whl (65 kB)
  Downloading numpy-1.26.3-cp312-cp312-win_amd64.whl (15.5 MB)
     ---------------------------------------- 0.0/15.5 MB ? eta -:--:--
     - -------------------------------------- 0.5/15.5 MB 16.3 MB/s eta 0:00:01
     --- ------------------------------------ 1.5/15.5 MB 18.3 MB/s eta 0:00:01
     ------ --------------------------------- 2.5/15.5 MB 19.6 MB/s eta 0:00:01
     -------- ------------------------------- 3.4/15.5 MB 19.8 MB/s eta 0:00:01
     ----------- ---------------------------- 4.4/15.5 MB 20.1 MB/s eta 0:00:01
     -------------- ------------------------- 5.4/15.5 MB 20.4 MB/s eta 0:00:01
     ---------------- ----------------------- 6.4/15.5 MB 20.5 MB/s eta 0:00:01
     ------------------- -------------------- 7.4/15.5 MB 20.6 MB/s eta 0:00:01
     --------------------- ------------------ 8.3/15.5 MB 20.3 MB/s eta 0:00:01
     ----------------------- ---------------- 9.2/15.5 MB 20.3 MB/s eta 0:00:01
     -------------------------- ------------- 10.2/15.5 MB 20.3 MB/s eta 0:00:01
     ---------------------------- ----------- 11.2/15.5 MB 21.1 MB/s eta 0:00:01
     ------------------------------- -------- 12.4/15.5 MB 21.1 MB/s eta 0:00:01
     ---------------------------------- ----- 13.4/15.5 MB 21.1 MB/s eta 0:00:01
     ------------------------------------ --- 14.3/15.5 MB 21.9 MB/s eta 0:00:01
     ---------------------------------------  15.3/15.5 MB 21.1 MB/s eta 0:00:01
     ---------------------------------------- 15.5/15.5 MB 19.8 MB/s eta 0:00:00
  Downloading Cython-3.0.8-cp312-cp312-win_amd64.whl (2.8 MB)
     ---------------------------------------- 0.0/2.8 MB ? eta -:--:--
     ---------------- ----------------------- 1.2/2.8 MB 24.8 MB/s eta 0:00:01
     --------------------------------- ------ 2.3/2.8 MB 29.5 MB/s eta 0:00:01
     ---------------------------------------- 2.8/2.8 MB 22.2 MB/s eta 0:00:00
  Installing collected packages: wheel, setuptools, numpy, Cython
  Successfully installed Cython-3.0.8 numpy-1.26.3 setuptools-69.0.3 wheel-0.42.0
  Running command Getting requirements to build wheel
  Traceback (most recent call last):
    File "C:\Users\A.C.EA\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
      main()
    File "C:\Users\A.C.EA\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\A.C.EA\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
      return hook(config_settings)
             ^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\A.C.EA\AppData\Local\Temp\pip-build-env-g41ei7ik\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=['wheel'])
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\A.C.EA\AppData\Local\Temp\pip-build-env-g41ei7ik\overlay\Lib\site-packages\setuptools\build_meta.py", line 295, in _get_build_requires
      self.run_setup()
    File "C:\Users\A.C.EA\AppData\Local\Temp\pip-build-env-g41ei7ik\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup
      exec(code, locals())
    File "<string>", line 13, in <module>
  ModuleNotFoundError: No module named 'numpy.distutils'
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: 'C:\Users\A.C.EA\AppData\Local\Programs\Python\Python312\python.exe' 'C:\Users\A.C.EA\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py' get_requires_for_build_wheel 'C:\Users\AC6827~1.EA\AppData\Local\Temp\tmpzze2ja55'
  cwd: [C:\Users\A.C.EA\AppData\Local\Programs\Microsoft](file:///C:/Users/A.C.EA/AppData/Local/Programs/Microsoft) VS Code\ttpy
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

@daskol
Copy link
Collaborator

daskol commented Feb 3, 2024

Try to downgrade either to numpy<1.23.0 or Python to 3.11. The issue is distutils has been deprecated. We need some effort to migrate out of distutils in ttpy and all its downstream dependencies.

daskol added a commit that referenced this issue Feb 3, 2024
Add constraint on NumPy version (#97)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants