Find answers from the community

s
F
Y
a
P
Updated 2 years ago

i struggled a lot with the dependencies

i struggled a lot with the dependencies on this :/
L
s
32 comments
Interesting! Are you using venv or conda?

Personally, this will get you a near-perfect setup every time in a fresh environment
Plain Text
conda create --name llama_index python=3.11
conda activate llama_index
pip install flask llama_index


Or if you already have the python version you need installed
Plain Text
python -m venv venv
source venv/bin/activate
pip install flask llama_index


Generally, I use conda when I need specific python versions, since it simplifies the setup
i was using conda, to be honest I am looking at just staying on node with langchain 😬 I have been fighting these dependencies for almost 2 weeks
wont be as good but its been a major blocker
i will try that though
the issue is mostly in production, i can get it running locally fine
@Logan M is this from the docker template you set up?
Yea! Using that docker template everything worked perfectly when I tested the docker image
@Logan M using that conda env, I got the following in my requirements.txt:
Plain Text
certifi @ file:///private/var/folders/sy/f16zz6x50xz3113nwtb9bvq00000gp/T/abs_fdy66ybhuv/croot/certifi_1669749572520/work/certifi
this is failing in prod cuz obviously that doesn't exist, but i am curious how this happens
1) Is certifi a requirement? and why would it pull from the local file structure in this scenario?
yeah man shit is WHACK lol i am cursed
hahaha is that error from your docker image or?
how are you building your requirements.txt?
yea, pip freeze dumps out waaaay too much haha

You have to kind of figure out which top level packages you need, because each top level package installs it's own stuff
In my demo, my requirements.txt is just flask, llama_index, and langchain
the only extra requirement i added there was boto3 :sadcat:
Then I would add boto3 to my example requirements.txt, and let pip figure out the rest πŸ’ͺ
haha yeah thats what i did! thats why i feel like im going in circles
seems like it should be simple to add a requirement, call pip freeze in the new environment with that reuiqmenet, and move on
so even if you are in a new virtual env, pip freeze requirements.txt still pulls out arbitrary dependencies from the rest of the system?
yeaaa not so simple haha There's probably a python library out there that reads all your imports and creates a minimum requirements.txt xD
haha pure madness
That's why everyone who uses python is a mad scientist πŸ˜‰
well, i guess im learning things :robotshrug:
Not even that they are arbitrary, but just things that the top level packages installed (like certificates!)
seems to be working on the prod server atm, i am in shock haha
Attachment
Screen_Shot_2023-03-10_at_3.04.52_PM.png
thanks @Logan M πŸ™
Nice!! Congrats! πŸŽ‰
Add a reply
Sign up and join the conversation on Discord