[Python] Is it just me or are Python modules a nightmare to setup?

Discussão em 'Python' iniciado por Stack, Outubro 2, 2024.

  1. Stack

    Stack Membro Participativo

    I recently made the switch to Python to explore ML and AI. I'm using Linux Mint and Jupyter notebook for Python. So I installed Tensorflow, TFlearn and six.moves and what feels like a score or two of other modules. I try to run the following,

    from __future__ import absolute_import, division, print_function

    import os
    import pickle
    from six.moves import urllib

    import tflearn
    from tflearn.data_utils import *


    I get AttributeError: module 'PIL.Image' has no attribute 'ANTIALIAS' when I run it. So I tried to research it, you know trying to be a good little boy before I ask a question, it seem the pillow module isn't supported anymore or the function was depreciated. How can I get tflearn to work?

    So I tried a different route,I tried to use langchain to run huggingface locally. I installed the module and ran the code to get an error about an uninstalled module. So I would install that mudule run the code again just to get another error about an uninstalled module. So I install that one, rerun the code only to get another error. So finally I get these lines to run

    from langchain.llms import HuggingFacePipeline
    from langchain import PromptTemplate, LLMChain


    After getting the above to finally run, I tried the following. This is all from a tutorial I'm trying to follow.

    model_id = "lmsys/fastchat-t5-3b-v1.0"
    llm = HuggingFacePipeline.from_model_id(
    model_id=model_id,
    task="text2text-generation",
    model_kwargs={"temperature": 0, "max_length": 1000},
    )


    I got a huge ammount of atribute errors and execptions with the above. T tried another way to use a local LLM and installed Dalai Llama downloaded the 13b alpaca model then brought it up in the browser through a port. Then I ask something and get no response. So now I'm wondering why should I even continue with Python. It has been very frustrating even though Python is advertised as "Good for Beginners". I can run SDL2 programs in C++ using only a text editor and Bash on Linux and running docker images so I'm not a complete newbie but so far my programming experience with python has been Debugging the environment, that's it.

    I do hope all my formatting and things like that are correct and you understand me at all. I hope my question is coherent and there is some light out there.

    It seems like I tried everything. I just expected it to work . If a module can't install it's own requisites using updated code what good is it?

    *edit So I guess the whole point of the question is, am I the only one that's having problems trying to set up the python environment with tflearn. Tflearn is effectively broken if I have to go into the code I installed and change something to actually make it work. I had to find a crazy work around to fix my compiler for c++ but once that was done, it was done. I tried Python before c++ but got frustrated with module HELL. I played with c++ for a few years , as a hobby but when I wanted to get more in depth with neural networks and machine learning I heard about tensorflow and tflearn and found my way back into module hell. Maybe I should forget about tflearn and try torch, but I'm worried I'll find module once again. I'm not an expert and am just feeling my way through the dark if you please.

    Continue reading...

Compartilhe esta Página