Hellisotherpeople/CX_DB8

Error when installing: TypeError: Class advice impossible in Python3. Use the @implementer class decorator instead.

jimfangx opened this issue · 0 comments

Hi, I am getting TypeError: Class advice impossible in Python3. Use the @implementer class decorator instead. when installing CX_DB8.

After pasting in the install script from the readme, I got a number of errors:

  1. ERROR: Could not find a version that satisfies the requirement tensorflow_gpu==1.14.0 (from -r requirements.txt (line 6)) (from versions: none) ERROR: No matching distribution found for tensorflow_gpu==1.14.0 (from -r requirements.txt (line 6)) -> I fixed this by updating the tensorflow_gpu in the requirements.txt to 1.1.0 then reinstalled all the requirements using pip3
  2. flair 0.4.2 has requirement urllib3<1.25,>=1.20, but you'll have urllib3 1.25.8 which is incompatible. -> Updated flair in requirements.txt to 0.4.5. Then reinstalled requirements
  3. Command "/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/sj/dh5wbtx51wvfns1mclspk8d80000gp/T/pip-install-hfqih3yb/cryptacular/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/sj/dh5wbtx51wvfns1mclspk8d80000gp/T/pip-record-cws__7h9/install-record.txt --single-version-externally-managed --compile" failed with error code 2 in /private/var/folders/sj/dh5wbtx51wvfns1mclspk8d80000gp/T/pip-install-hfqih3yb/cryptacular/ got this weird error. I ignored this and this never came back
  4. While trying to downgrade urllib3 to be compatiable with flair, I got: requests 2.22.0 has requirement urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1, but you'll have urllib3 1.20 which is incompatible. -> I replaced it with 1.25.8 using pip3 install urllib3==1.25.8
  5. The requirements install came back without errors but as soon as I tried to run the script using python3 -i cx_db8_flair.py , I got ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/torch/_C.cpython-36m-darwin.so, 9): Library not loaded: /usr/local/opt/libomp/lib/libomp.dylib Referenced from: /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/torch/lib/libshm.dylib Reason: image not found -> I did some searching online and installed brew install libomp
  6. Re ran the script and got Class advice impossible in Python3. Use the @implementer class decorator instead.

Seeing this has not worked, I deleted everything and started over. This instance I got flair 0.4.5 has requirement pytest>=5.3.2, but you'll have pytest 4.6.1 which is incompatible. while updating flair. -> I updated it to "5.3.2" in the requirements.txt

Later it turns out that pytorch_transformers was outdated too: so I updated it to 1.2.0

Then I realized apex was extremely out dated: the website is down and the github was last updated like 6 years ago. I think this is the main cause of the series of errors that I am getting.


Below is the full install log:
CX_DB8 Install Log

Below is my requirements.txt with the updated version:
requirements.txt

Issues ref.: #11 pytorch/pytorch#20030
https://github.com/cd34/apex
flairNLP/flair#1236
huggingface/transformers#163

Let me know if you need any other information.