dify
dify copied to clipboard
can't run api with jieba error
Self Checks
- [X] This is only for bug report, if you would like to ask a quesion, please head to Discussions.
- [X] I have searched for existing issues search for existing issues, including closed ones.
- [X] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
- [X] Pleas do not modify this template :) and fill in all the required fields.
Dify version
0.6.6
Cloud or Self Hosted
Self Hosted (Source)
Steps to reproduce
according to the doc https://docs.dify.ai/v/zh-hans/getting-started/install-self-hosted/local-source-code
i build python 3.10.14 with openssl 3.3.0, install the requirement.txt and install the pytorch then i install the ffmpeg
when i run the
flask run --host 0.0.0.0 --port=5001 --debug
it report the jieba error
✔️ Expected Behavior
No response
❌ Actual Behavior
Hey @cjdxhjj, nice to see you back in the digital trenches! 😎👾 Looks like you've stumbled upon another intriguing puzzle in the matrix. I'm on it, diving into the depths of code to emerge with some answers for you. Hang tight!
the celery -A app.celery worker -P gevent -c 1 -Q dataset,generation,mail --loglevel INFO command report the same error
To address the ImportError issues with 'torch' and 'clint' in your Dify setup, follow these steps:
-
For the PyTorch ImportError: It seems PyTorch might not be installed in your environment or there's a version mismatch. Install or update PyTorch by running:
pip install torch torchvision torchaudio
Ensure you're in the correct virtual environment for your project when you execute this command. Adjust the command to fit any specific version requirements for PyTorch your project might have.
-
For the Clint ImportError: The error indicates that the 'clint' library is missing from your environment. Install 'clint' with:
pip install clint
Again, make sure this is done within the virtual environment you're using for your project.
These steps directly address the ImportError issues you've encountered. It's crucial to ensure these libraries are compatible with your project's dependencies and the Python and OpenSSL versions you're using. If issues persist, consider checking for version-specific conflicts or compatibility problems with other installed packages.
Additionally, verify your Python environment setup, especially if you're deploying from source and using features like text-to-speech that require FFmpeg. The Dify documentation provides detailed steps for installing FFmpeg and setting up the Python environment with the correct version and package management tools.
Details
Sources
- api/config.py
- en/getting-started/install-self-hosted/local-source-code.md
- zh_CN/learn-more/faq/install-faq.md
- api/requirements.txt
About Dosu This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
To continue the conversation, mention @dosu.
pls use below command to reinstall your requirements
pip install -r requirements.txt --upgrade --force-reinstall
@cjdxhjj
thanks very much, that works
i found the jieba version dosn't affected. but it run, maybe something else affect that
please figure out the issure and correct it.