-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Installing a pre-release and facing runtime error on macOS #2049
Comments
Hey there, @GimmeSomeJazz! I'm here to help you out with any bugs, questions, or contributions you have in mind. Let's squash those bugs together while we wait for a human maintainer. To resolve the issue with the
These steps should help resolve the issues you're encountering with the |
hey @dosu. That resolved my first issue. Now I am facing a httpx.ConnectError due to a Request('GET', 'https://pypi.org/pypi/langflow/json') somewhere at the runtime. Certainly due to proxy issues. Any idea to resolve it / to set my proxy? Thank you! (so strange to say thank you to a bot haha) |
To resolve the import httpx
proxies = {
"http://": "http://your_proxy_address:your_proxy_port",
"https://": "http://your_proxy_address:your_proxy_port",
}
async def make_request_with_proxy():
async with httpx.AsyncClient(proxies=proxies) as client:
try:
response = await client.get('https://pypi.org/pypi/langflow/json')
response.raise_for_status()
return response.json()
except httpx.ConnectError as e:
print(f"Connection error: {e}")
except httpx.HTTPStatusError as e:
print(f"HTTP error: {e}")
# Run the request
import asyncio
asyncio.run(make_request_with_proxy()) Replace |
does not working for me @dosu. I have this error when I run the command
|
To resolve the proxy issue causing an Ensure that this function is called before running the server, which is already done in the def set_var_for_macos_issue():
if platform.system() in ["Darwin"]:
import os
os.environ["OBJC_DISABLE_INITIALIZE_FORK_SAFETY"] = "YES"
os.environ["no_proxy"] = "*"
logger.debug("Set OBJC_DISABLE_INITIALIZE_FORK_SAFETY to YES to avoid error")
def run(
host: str = typer.Option("127.0.0.1", help="Host to bind the server to.", envvar="LANGFLOW_HOST"),
workers: int = typer.Option(1, help="Number of worker processes.", envvar="LANGFLOW_WORKERS"),
timeout: int = typer.Option(300, help="Worker timeout in seconds.", envvar="LANGFLOW_WORKER_TIMEOUT"),
port: int = typer.Option(7860, help="Port to listen on.", envvar="LANGFLOW_PORT"),
components_path: Optional[Path] = typer.Option(
Path(__file__).parent / "components",
help="Path to the directory containing custom components.",
envvar="LANGFLOW_COMPONENTS_PATH",
),
env_file: Path = typer.Option(None, help="Path to the .env file containing environment variables."),
log_level: str = typer.Option("critical", help="Logging level.", envvar="LANGFLOW_LOG_LEVEL"),
log_file: Path = typer.Option("logs/langflow.log", help="Path to the log file.", envvar="LANGFLOW_LOG_FILE"),
cache: Optional[str] = typer.Option(
envvar="LANGFLOW_LANGCHAIN_CACHE",
help="Type of cache to use. (InMemoryCache, SQLiteCache)",
default=None,
),
dev: bool = typer.Option(False, help="Run in development mode (may contain bugs)"),
path: str = typer.Option(
None,
help="Path to the frontend directory containing build files. This is for development purposes only.",
envvar="LANGFLOW_FRONTEND_PATH",
),
open_browser: bool = typer.Option(
True,
help="Open the browser after starting the server.",
envvar="LANGFLOW_OPEN_BROWSER",
),
remove_api_keys: bool = typer.Option(
False,
help="Remove API keys from the projects saved in the database.",
envvar="LANGFLOW_REMOVE_API_KEYS",
),
backend_only: bool = typer.Option(
False,
help="Run only the backend server without the frontend.",
envvar="LANGFLOW_BACKEND_ONLY",
),
store: bool = typer.Option(
True,
help="Enables the store features.",
envvar="LANGFLOW_STORE",
),
):
configure(log_level=log_level, log_file=log_file)
set_var_for_macos_issue()
if env_file:
load_dotenv(env_file, override=True)
update_settings(
dev=dev,
remove_api_keys=remove_api_keys,
cache=cache,
components_path=components_path,
store=store,
)
static_files_dir: Optional[Path] = Path(path) if path else None
app = setup_app(static_files_dir=static_files_dir, backend_only=backend_only)
if is_port_in_use(port, host):
port = get_free_port(port)
settings_service = get_settings_service()
settings_service.set("worker_timeout", timeout)
options = {
"bind": f"{host}:{port}",
"workers": get_number_of_workers(workers),
"timeout": timeout,
}
if "pytest" in sys.modules:
return
try:
if platform.system() in ["Windows"]:
process = run_on_windows(host, port, log_level, options, app)
else:
process = run_on_mac_or_linux(host, port, log_level, options, app)
if open_browser:
click.launch(f"http://{host}:{port}")
if process:
process.join()
except KeyboardInterrupt:
pass Make sure the |
does not working for me @dosu. I have this error when I run the command
|
To resolve the Here is how you can do it in the terminal: export no_proxy="*"
python -m langflow run Additionally, Langflow has a built-in function |
@dosu, it does not work. I need to talk to one human please. |
@ogabrielluiz, this one's a bit out of my wheelhouse, could you step in and provide your guidance? |
@dosu @ogabrielluiz I had that error message, but the gui seems to load in fact (ConnectError: [Errno 8] nodename nor servname provided, or not known). So I will try, and if things go ok, I close the issue! |
It looks like the issue with the
If the GUI loads and works fine despite the @ogabrielluiz, could you please provide further assistance if needed? Let us know how it goes! |
@ogabrielluiz thank you for all. I replicated @msmygit successful pattern described here, but I have the following same error with langchain_cohere module when running langflow (installation was successful). Thank you for your help!
The text was updated successfully, but these errors were encountered: