princeton-nlp / SimCSE

[EMNLP 2021] SimCSE: Simple Contrastive Learning of Sentence Embeddings https://arxiv.org/abs/2104.08821

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

couldn't install cimcse

vincent507cpu opened this issue · comments

part of error message:

note: This error originates from a subprocess, and is likely not a problem with pip.
        ERROR: Failed building wheel for numpy
        Running setup.py clean for numpy
        error: subprocess-exited-with-error
      
        × python setup.py clean did not run successfully.
        │ exit code: 1
        ╰─> [10 lines of output]
            Running from numpy source directory.
      
            `setup.py clean` is not supported, use one of the following instead:
      
              - `git clean -xdf` (cleans all files)
              - `git clean -Xdf` (cleans all versioned files, doesn't touch
                                  files that aren't checked into the git repo)
      
            Add `--force` to your command to use it anyway if you must (unsupported).
      
            [end of output]
      
        note: This error originates from a subprocess, and is likely not a problem with pip.
        ERROR: Failed cleaning build dir for numpy
      Failed to build numpy
      ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies 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.

python: 3.10.14
os: macOS 14.4.1
many thanks!

I found the same error message from an issue of numpy. You probably need to use python 3.7, 3.6 or 3.5 to install a numpy with version < 1.20.

I found the same error message from an issue of numpy. You probably need to use python 3.7, 3.6 or 3.5 to install a numpy with version < 1.20.

Thank you for your help. Unfortunately I need a newer version of Python, I need to find another solution.

In that case, I think it's okay to slightly modify the install requirements in setup.py to use later version of numpy, e.g., "numpy>=1.19.5,<1.20" -> "numpy>=1.19.5,<1.24" and "scipy>=1.5.4,<1.6" -> "scipy>=1.5.4,<1.9", it shall also work.

@yaoxingcheng Thank you for the advise, I'll give it a shot

@yaoxingcheng Good morning, I think it works by your solution, however I encountered another error:

2024-05-10 00:01:44.709688: E external/local_xla/xla/stream_executor/cuda/cuda_dnn.cc:9261] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
2024-05-10 00:01:44.709737: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:607] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
2024-05-10 00:01:44.711080: E external/local_xla/xla/stream_executor/cuda/cuda_blas.cc:1515] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
2024-05-10 00:01:45.780213: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
Traceback (most recent call last):
  File "/content/drive/MyDrive/GitHub/SimCSE/./train.py", line 36, in <module>
    from transformers.file_utils import cached_property, torch_required, is_torch_available, is_torch_tpu_available
ImportError: cannot import name 'torch_required' from 'transformers.file_utils' (/usr/local/lib/python3.10/dist-packages/transformers/file_utils.py)

It seems to me that transformers API has changed since then. If you can kindly take a little bit of efforts to update it, it would be very helpful. Thanks!

@vincent507cpu Hi, it seems that you are using an incompatible version of transformers. I suggest downgrading transformers to 4.2.1, or trying some workarounds following this issue from transformers.

Alright, transformers 4.2.1 is not compatible with my project, I will just find alternative solutions. Thanks anyway!