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

fix installation guide for macOS users on lxml #1718

Closed
aiden-leong opened this issue Jan 14, 2024 · 12 comments
Closed

fix installation guide for macOS users on lxml #1718

aiden-leong opened this issue Jan 14, 2024 · 12 comments
Labels
stale 🪨话题搁置

Comments

@aiden-leong
Copy link

 % python3 infer-web.py                                     
Traceback (most recent call last):
  File "infer-web.py", line 8, in <module>
    from infer.modules.vc.modules import VC
  File "/Users/aiden/SQuAD/Retrieval-based-Voice-Conversion-WebUI/infer/modules/vc/modules.py", line 19, in <module>
    from infer.modules.vc.utils import *
  File "/Users/aiden/SQuAD/Retrieval-based-Voice-Conversion-WebUI/infer/modules/vc/utils.py", line 3, in <module>
    from fairseq import checkpoint_utils
  File "/Users/aiden/miniconda3/envs/rvc/lib/python3.8/site-packages/fairseq/__init__.py", line 40, in <module>
    import fairseq.scoring  # noqa
  File "/Users/aiden/miniconda3/envs/rvc/lib/python3.8/site-packages/fairseq/scoring/__init__.py", line 55, in <module>
    importlib.import_module("fairseq.scoring." + module)
  File "/Users/aiden/miniconda3/envs/rvc/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/Users/aiden/miniconda3/envs/rvc/lib/python3.8/site-packages/fairseq/scoring/bleu.py", line 14, in <module>
    from fairseq.scoring.tokenizer import EvaluationTokenizer
  File "/Users/aiden/miniconda3/envs/rvc/lib/python3.8/site-packages/fairseq/scoring/tokenizer.py", line 8, in <module>
    import sacrebleu as sb
  File "/Users/aiden/miniconda3/envs/rvc/lib/python3.8/site-packages/sacrebleu/__init__.py", line 21, in <module>
    from .utils import smart_open, SACREBLEU_DIR, download_test_set  # noqa: F401
  File "/Users/aiden/miniconda3/envs/rvc/lib/python3.8/site-packages/sacrebleu/utils.py", line 597, in <module>
    from .dataset import DATASETS, SUBSETS, DOMAINS, COUNTRIES
  File "/Users/aiden/miniconda3/envs/rvc/lib/python3.8/site-packages/sacrebleu/dataset/__init__.py", line 73, in <module>
    from .wmt_xml import WMTXMLDataset
  File "/Users/aiden/miniconda3/envs/rvc/lib/python3.8/site-packages/sacrebleu/dataset/wmt_xml.py", line 3, in <module>
    import lxml.etree as ET
ImportError: dlopen(/Users/aiden/miniconda3/envs/rvc/lib/python3.8/site-packages/lxml/etree.cpython-38-darwin.so, 0x0002): symbol not found in flat namespace '_exsltDateXpathCtxtRegister'

ref: langchain-ai/chat-langchain#213 (comment)
Quote:

I was able to solve this by doing

First Install:

brew install libxml2
brew install libxslt
And then doing this:
pip install lxml==4.9.2
@Conghdos
Copy link

Conghdos commented Jan 15, 2024

I still have the same error on mac m2 max

@aiden-leong
Copy link
Author

I still have the same error on mac m2 max

I'm pretty sure the above commands will work. You may double check your current python env and/or if these packages are installed to the right env.

@Conghdos
Copy link

Conghdos commented Jan 15, 2024

If I install it the normal manual way (using conda python 3.8), the installation can be successful, however when I run convert on the model I have trained, the process takes forever.

  • If I run run.sh, I will get the error as described even though I have installed the command as you instructed.
  • If running on Windows parallels, conversion and training are completely normal (However very slow)

@aiden-leong
Copy link
Author

If I install it the normal manual way (using conda), the installation can be successful, however when I run convert on the model I have trained, the process takes forever.

  • If you run run.sh, you will get the error as described even though you have installed the command as you instructed.
  • If running on Windows parallels, conversion and training are completely normal (However very slow)

Do NOT use run.sh. venv is NOT conda.

Run python xxxx.py instead.

@Conghdos
Copy link

I successfully reinstalled it on Mac M2 Max according to the instructions, but when I run inference I get the error below and the program automatically crashes.

Python.framework/Versions/3.8/lib/python3.8/multiprocessing/resource_tracker.py:216: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown
warnings.warn('resource_tracker: There appear to be %d '

@Conghdos
Copy link

Well I fixed it, just reinstalling faiss-cpu is enough
pip install faiss-cpu==1.7.0

@jathoo
Copy link

jathoo commented Feb 22, 2024

sorry new to this , so i tired to install it using run.sh and got the exact error

tried to fix it with

brew install libxml2
brew install libxslt

and used

pip3 install lxml==4.9.2

then tried to start the app with run.sh and still getting the same error

want to try this but not really sure which file to use as xxx

Run python xxxx.py instead.``` 

could you please explain this ? 

@R3D347HR4Y
Copy link

@jathoo
run.sh does this command by default but there are some things wrong when running the rest of run.sh in OSX
So instead run this:
python infer-web.py

@burakaydinofficial
Copy link

conda install lxml fixed this issue for me on my M1

@PetervanLunteren
Copy link

I was unable to pip install lxml on my macOS M2 PRO, but thanks to the tip provided by @burakaydinofficial, I was able to successfully get it installed using the command below.

conda install lxml

@edgardmello
Copy link

 % python3 infer-web.py                                     
Traceback (most recent call last):
  File "infer-web.py", line 8, in <module>
    from infer.modules.vc.modules import VC
  File "/Users/aiden/SQuAD/Retrieval-based-Voice-Conversion-WebUI/infer/modules/vc/modules.py", line 19, in <module>
    from infer.modules.vc.utils import *
  File "/Users/aiden/SQuAD/Retrieval-based-Voice-Conversion-WebUI/infer/modules/vc/utils.py", line 3, in <module>
    from fairseq import checkpoint_utils
  File "/Users/aiden/miniconda3/envs/rvc/lib/python3.8/site-packages/fairseq/__init__.py", line 40, in <module>
    import fairseq.scoring  # noqa
  File "/Users/aiden/miniconda3/envs/rvc/lib/python3.8/site-packages/fairseq/scoring/__init__.py", line 55, in <module>
    importlib.import_module("fairseq.scoring." + module)
  File "/Users/aiden/miniconda3/envs/rvc/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/Users/aiden/miniconda3/envs/rvc/lib/python3.8/site-packages/fairseq/scoring/bleu.py", line 14, in <module>
    from fairseq.scoring.tokenizer import EvaluationTokenizer
  File "/Users/aiden/miniconda3/envs/rvc/lib/python3.8/site-packages/fairseq/scoring/tokenizer.py", line 8, in <module>
    import sacrebleu as sb
  File "/Users/aiden/miniconda3/envs/rvc/lib/python3.8/site-packages/sacrebleu/__init__.py", line 21, in <module>
    from .utils import smart_open, SACREBLEU_DIR, download_test_set  # noqa: F401
  File "/Users/aiden/miniconda3/envs/rvc/lib/python3.8/site-packages/sacrebleu/utils.py", line 597, in <module>
    from .dataset import DATASETS, SUBSETS, DOMAINS, COUNTRIES
  File "/Users/aiden/miniconda3/envs/rvc/lib/python3.8/site-packages/sacrebleu/dataset/__init__.py", line 73, in <module>
    from .wmt_xml import WMTXMLDataset
  File "/Users/aiden/miniconda3/envs/rvc/lib/python3.8/site-packages/sacrebleu/dataset/wmt_xml.py", line 3, in <module>
    import lxml.etree as ET
ImportError: dlopen(/Users/aiden/miniconda3/envs/rvc/lib/python3.8/site-packages/lxml/etree.cpython-38-darwin.so, 0x0002): symbol not found in flat namespace '_exsltDateXpathCtxtRegister'

ref: langchain-ai/chat-langchain#213 (comment) Quote:

I was able to solve this by doing

First Install:

brew install libxml2
brew install libxslt
And then doing this:
pip install lxml==4.9.2

Worked here!

@github-actions github-actions bot added the stale 🪨话题搁置 label Apr 13, 2024
Copy link
Contributor

This issue was closed because it has been inactive for 15 days since being marked as stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale 🪨话题搁置
Projects
None yet
Development

No branches or pull requests

7 participants