langflow-ai / langflow

⛓️ Langflow is a dynamic graph where each node is an executable unit. Its modular and interactive design fosters rapid experimentation and prototyping, pushing hard on the limits of creativity.
http://www.langflow.org
MIT License
17.87k stars 2.68k forks source link

Starting Langflow: may have been in progress in another thread when fork() was called #1831

Closed blerimj closed 2 weeks ago

blerimj commented 2 weeks ago

After installing with: python3.10 -m pip install langflow --pre --force-reinstall

getting this error and have no idea whats wrong where to look for a solution. running it on Macbook with Apple M1 Pro

python3.10 -m langflow run /opt/homebrew/lib/python3.10/site-packages/langchain/_api/module_import.py:87: LangChainDeprecationWarning: Importing GuardrailsOutputParser from langchain.output_parsers is deprecated. Please replace the import with the following: from langchain_community.output_parsers.rail_parser import GuardrailsOutputParser warnings.warn( /opt/homebrew/lib/python3.10/site-packages/langchain/_api/module_import.py:87: LangChainDeprecationWarning: Importing JsonSpec from langchain.tools.json is deprecated. Please replace the import with the following: from langchain_community.tools.json.tool import JsonSpec warnings.warn( Starting Langflow v1.0.0a29... objc[39516]: +[__NSPlaceholderSet initialize] may have been in progress in another thread when fork() was called. objc[39516]: +[__NSPlaceholderSet initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug. [05/03/24 08:01:12] ERROR 2024-05-03 08:01:12 - ERROR - glogging - Worker (pid:39516) was sent SIGABRT! glogging.py:272 Starting Langflow v1.0.0a29...

dosubot[bot] commented 2 weeks ago

The error you're encountering is related to macOS's handling of the fork() system call in a multithreaded environment. To address this, you should set the OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES environment variable before running your application. This can be done by adding the following lines to your terminal session:

export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
export no_proxy="*"

These commands set the necessary environment variables to prevent the crash related to fork() you're experiencing. Ensure these are executed in the terminal before starting the Langflow application.

Additionally, regarding the deprecation warnings for GuardrailsOutputParser and JsonSpec, you should follow the instructions provided in the warnings to use the updated import paths. This involves replacing the deprecated imports with the suggested new ones:

These updates will help you avoid potential issues related to deprecated features in the future.

#### Details **Sources** - [src/backend/base/langflow/__main__.py](https://github.com/logspace-ai/langflow/blob/dev/src/backend/base/langflow/__main__.py) - [src/backend/langflow/__main__.py](https://github.com/logspace-ai/langflow/blob/dev/src/backend/langflow/__main__.py) - [docs/docs/migration/possible-installation-issues.mdx](https://github.com/logspace-ai/langflow/blob/dev/docs/docs/migration/possible-installation-issues.mdx) - [src/frontend/package.json](https://github.com/logspace-ai/langflow/blob/dev/src/frontend/package.json) - [pyproject.toml](https://github.com/logspace-ai/langflow/blob/dev/pyproject.toml)
**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.

blerimj commented 2 weeks ago

Thank you