-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Issues installing and running lightning in Pipenv #14789
Comments
Received new repro instructions from @krishnakalyan3: conda create -n break python=3.8
conda activate break requirements.txt file:
app.py file: import lightning as L
from lightning_app.components.serve import ServeGradio
import gradio as gr
import whisper
class LitGradio(ServeGradio):
inputs = gr.inputs.Textbox(default='lightning', label='name input')
outputs = gr.outputs.Textbox(label='output')
examples = [["hello lightning"]]
def predict(self, input_text):
return self.model(input_text)
def build_model(self):
fake_model = lambda x: f"hello {x}"
return fake_model
class RootFlow(L.LightningFlow):
def __init__(self):
super().__init__()
self.lit_gradio = LitGradio()
def run(self):
self.lit_gradio.run()
def configure_layout(self):
return [{"name": "home", "content": self.lit_gradio}]
app = L.LightningApp(RootFlow()) Error:
He reports that running with
Despite these precise instructions, I could not reproduce on my machine (M1 Mac, Miniconda) :( |
I tested this on my personal ubuntu laptop. Perhaps this issue is because of me using anaconda incorrectly. |
This is what I found in my investigation. I am using M1 mac
|
So, I think I figured out the problem. When you install a package, all of its entrypoints are prepended with a shebang containing absolute path to current python version used when installing such package. This for example means that in my environment, One solution would be to not register In general, it seems that the issue is caused by not running |
This issue did not occur anymore |
Bug description
The original report is here (internal access only): https://linear.app/lightning-ai/issue/LAI2-8803/use-python-m-pip-in-all-examples
It seems that users who create an environment with Pipenv can't install Lightning or run apps without prefixing
python -m
. The python -m cancer is spreading to examples and documentation, but is clearly diminishing the UX for users. A real CLI shouldn't require this awkward prefix.How to reproduce the bug
Error messages and logs
Important info
More info
A PR attempting to fix this (or something related) was made at launch on the old repo: https://github.com/Lightning-AI/lightning-app/pull/855
We have guides for virtualenv and conda on our beginner guide for installation. Until this issue is resolved, we should communicate that Pipenv is not supported and that support is coming soon.
The text was updated successfully, but these errors were encountered: