Help improving with tkinter /u/Ranch1k Python Education

Help improving with tkinter /u/Ranch1k Python Education

Do you guys have any idea on how can I improve this python tkinter widget that I am making to create a jarvis like program, and how to remove the white border in the button?

import tkinter as tk from tkinter import PhotoImage from tkinter import ttk from tkinter import * from PIL import ImageTk def open_secondary_window(): # Create secondary (or popup) window. secondary_window = tk.Toplevel() secondary_window.title("Apps") secondary_window.config(width=1950, height=1800, background="purple") # Create a button to close (destroy) this window. button_close = ttk.Button( secondary_window, text="Batcave", command=secondary_window.destroy ) button_close.place(x=5, y=5) # Create the main window. root = tk.Tk() root.config(width=1800, height=800) root.title("Batcave.V1") root.attributes('-fullscreen',True) # Create a button inside the main window that # invokes the open_secondary_window() function # when pressed. jarvis = "jarvisbg.png" canvas = tk.Canvas(root, width=1920, height=1750) canvas.pack() tk_img = ImageTk.PhotoImage(file = jarvis) canvas.create_image(960, 540, image=tk_img) button_exit = ttk.Button(root, text="Exit", command=root.destroy) button_open = ttk.Button(root, text="Apps Room", command=open_secondary_window) button_exit.place(x=5, y=50) button_open.place(x=5, y=5) root.mainloop() 

submitted by /u/Ranch1k
[link] [comments]

​r/learnpython Do you guys have any idea on how can I improve this python tkinter widget that I am making to create a jarvis like program, and how to remove the white border in the button? import tkinter as tk from tkinter import PhotoImage from tkinter import ttk from tkinter import * from PIL import ImageTk def open_secondary_window(): # Create secondary (or popup) window. secondary_window = tk.Toplevel() secondary_window.title(“Apps”) secondary_window.config(width=1950, height=1800, background=”purple”) # Create a button to close (destroy) this window. button_close = ttk.Button( secondary_window, text=”Batcave”, command=secondary_window.destroy ) button_close.place(x=5, y=5) # Create the main window. root = tk.Tk() root.config(width=1800, height=800) root.title(“Batcave.V1”) root.attributes(‘-fullscreen’,True) # Create a button inside the main window that # invokes the open_secondary_window() function # when pressed. jarvis = “jarvisbg.png” canvas = tk.Canvas(root, width=1920, height=1750) canvas.pack() tk_img = ImageTk.PhotoImage(file = jarvis) canvas.create_image(960, 540, image=tk_img) button_exit = ttk.Button(root, text=”Exit”, command=root.destroy) button_open = ttk.Button(root, text=”Apps Room”, command=open_secondary_window) button_exit.place(x=5, y=50) button_open.place(x=5, y=5) root.mainloop() submitted by /u/Ranch1k [link] [comments] 

Do you guys have any idea on how can I improve this python tkinter widget that I am making to create a jarvis like program, and how to remove the white border in the button?

import tkinter as tk from tkinter import PhotoImage from tkinter import ttk from tkinter import * from PIL import ImageTk def open_secondary_window(): # Create secondary (or popup) window. secondary_window = tk.Toplevel() secondary_window.title("Apps") secondary_window.config(width=1950, height=1800, background="purple") # Create a button to close (destroy) this window. button_close = ttk.Button( secondary_window, text="Batcave", command=secondary_window.destroy ) button_close.place(x=5, y=5) # Create the main window. root = tk.Tk() root.config(width=1800, height=800) root.title("Batcave.V1") root.attributes('-fullscreen',True) # Create a button inside the main window that # invokes the open_secondary_window() function # when pressed. jarvis = "jarvisbg.png" canvas = tk.Canvas(root, width=1920, height=1750) canvas.pack() tk_img = ImageTk.PhotoImage(file = jarvis) canvas.create_image(960, 540, image=tk_img) button_exit = ttk.Button(root, text="Exit", command=root.destroy) button_open = ttk.Button(root, text="Apps Room", command=open_secondary_window) button_exit.place(x=5, y=50) button_open.place(x=5, y=5) root.mainloop() 

submitted by /u/Ranch1k
[link] [comments]  Do you guys have any idea on how can I improve this python tkinter widget that I am making to create a jarvis like program, and how to remove the white border in the button? import tkinter as tk from tkinter import PhotoImage from tkinter import ttk from tkinter import * from PIL import ImageTk def open_secondary_window(): # Create secondary (or popup) window. secondary_window = tk.Toplevel() secondary_window.title(“Apps”) secondary_window.config(width=1950, height=1800, background=”purple”) # Create a button to close (destroy) this window. button_close = ttk.Button( secondary_window, text=”Batcave”, command=secondary_window.destroy ) button_close.place(x=5, y=5) # Create the main window. root = tk.Tk() root.config(width=1800, height=800) root.title(“Batcave.V1”) root.attributes(‘-fullscreen’,True) # Create a button inside the main window that # invokes the open_secondary_window() function # when pressed. jarvis = “jarvisbg.png” canvas = tk.Canvas(root, width=1920, height=1750) canvas.pack() tk_img = ImageTk.PhotoImage(file = jarvis) canvas.create_image(960, 540, image=tk_img) button_exit = ttk.Button(root, text=”Exit”, command=root.destroy) button_open = ttk.Button(root, text=”Apps Room”, command=open_secondary_window) button_exit.place(x=5, y=50) button_open.place(x=5, y=5) root.mainloop() submitted by /u/Ranch1k [link] [comments]

Read more

Good resources to learn Python /u/PriorSherbet5034 Python Education

Good resources to learn Python /u/PriorSherbet5034 Python Education

Just finished my data structures and algorithms II course in college, which is taught C++. Therefore, I wouldn’t say I’m a beginner programmer, as I already have a quite good grasp of programming concepts and algorithms. With that in mind, I think it’s time I start diving into other languages, such as Python. What are some good resources you guys recommend?

submitted by /u/PriorSherbet5034
[link] [comments]

​r/learnpython Just finished my data structures and algorithms II course in college, which is taught C++. Therefore, I wouldn’t say I’m a beginner programmer, as I already have a quite good grasp of programming concepts and algorithms. With that in mind, I think it’s time I start diving into other languages, such as Python. What are some good resources you guys recommend? submitted by /u/PriorSherbet5034 [link] [comments] 

Just finished my data structures and algorithms II course in college, which is taught C++. Therefore, I wouldn’t say I’m a beginner programmer, as I already have a quite good grasp of programming concepts and algorithms. With that in mind, I think it’s time I start diving into other languages, such as Python. What are some good resources you guys recommend?

submitted by /u/PriorSherbet5034
[link] [comments]  Just finished my data structures and algorithms II course in college, which is taught C++. Therefore, I wouldn’t say I’m a beginner programmer, as I already have a quite good grasp of programming concepts and algorithms. With that in mind, I think it’s time I start diving into other languages, such as Python. What are some good resources you guys recommend? submitted by /u/PriorSherbet5034 [link] [comments]

Read more

Have to learn python in a month. /u/vuaxno Python Education

Have to learn python in a month. /u/vuaxno Python Education

In high school I completed ap comp sci introduction classes that were taught only in java and because of that I did not have to take Intro to CS l in my first semester of college. I couldn’t take the second class because of a math prerequisite but I am now starting intro to CS II on jan 21 and I have to know almost everything from Intro to CS I in python and I have no python knowledge, I understand concepts like iteration, variables, functions, and some other basic ones but nothing java wise.

tldr What would be the best way or road map to learn python in a month?

submitted by /u/vuaxno
[link] [comments]

​r/learnpython In high school I completed ap comp sci introduction classes that were taught only in java and because of that I did not have to take Intro to CS l in my first semester of college. I couldn’t take the second class because of a math prerequisite but I am now starting intro to CS II on jan 21 and I have to know almost everything from Intro to CS I in python and I have no python knowledge, I understand concepts like iteration, variables, functions, and some other basic ones but nothing java wise. tldr What would be the best way or road map to learn python in a month? submitted by /u/vuaxno [link] [comments] 

In high school I completed ap comp sci introduction classes that were taught only in java and because of that I did not have to take Intro to CS l in my first semester of college. I couldn’t take the second class because of a math prerequisite but I am now starting intro to CS II on jan 21 and I have to know almost everything from Intro to CS I in python and I have no python knowledge, I understand concepts like iteration, variables, functions, and some other basic ones but nothing java wise.

tldr What would be the best way or road map to learn python in a month?

submitted by /u/vuaxno
[link] [comments]  In high school I completed ap comp sci introduction classes that were taught only in java and because of that I did not have to take Intro to CS l in my first semester of college. I couldn’t take the second class because of a math prerequisite but I am now starting intro to CS II on jan 21 and I have to know almost everything from Intro to CS I in python and I have no python knowledge, I understand concepts like iteration, variables, functions, and some other basic ones but nothing java wise. tldr What would be the best way or road map to learn python in a month? submitted by /u/vuaxno [link] [comments]

Read more

Suggest sites , chnanels /u/CommercialCode13 Python Education

Suggest sites , chnanels /u/CommercialCode13 Python Education

I want to learn by python by being quizzed. I occasionally see questions being posted on u tube, but can really specifically search for these question snippet posts on utube.

Can someone suggest be u tube channels or telegram channels or websites that post questions of python alone

submitted by /u/CommercialCode13
[link] [comments]

​r/learnpython I want to learn by python by being quizzed. I occasionally see questions being posted on u tube, but can really specifically search for these question snippet posts on utube. Can someone suggest be u tube channels or telegram channels or websites that post questions of python alone submitted by /u/CommercialCode13 [link] [comments] 

I want to learn by python by being quizzed. I occasionally see questions being posted on u tube, but can really specifically search for these question snippet posts on utube.

Can someone suggest be u tube channels or telegram channels or websites that post questions of python alone

submitted by /u/CommercialCode13
[link] [comments]  I want to learn by python by being quizzed. I occasionally see questions being posted on u tube, but can really specifically search for these question snippet posts on utube. Can someone suggest be u tube channels or telegram channels or websites that post questions of python alone submitted by /u/CommercialCode13 [link] [comments]

Read more

Why is the spawner function in the class printing twice befoure enemy attack runs? /u/Amazing_Pattern_3382 Python Education

Why is the spawner function in the class printing twice befoure enemy attack runs? /u/Amazing_Pattern_3382 Python Education

----------------------------------------------------------------------------- this is the output :) == 3 ENEMIES HAS SPAWNED! == == NAME: PLAGUE SPITTER HP: 33 == == NAME: BLOOD REAVER HP: 30 == == NAME: FROST WRAITH HP: 30 == == STARTING ROUND == == WHO DO YOU WANT TO ATTACK == == 4 ENEMIES HAS SPAWNED! == == NAME: FROST WRAITH HP: 32 == == NAME: BLOOD REAVER HP: 24 == == NAME: VOID STALKER HP: 25 == == NAME: PLAGUE SPITTER HP: 26 == == STARTING ROUND == == WHO DO YOU WANT TO ATTACK == DEBUG: Entered EnemyMenu == NAME: FROST WRAITH HEALTH: 32 == == NAME: BLOOD REAVER HEALTH: 24 == == NAME: VOID STALKER HEALTH: 25 == == NAME: PLAGUE SPITTER HEALTH: 26 == Choose Enemy > ----------------------------------------------------------------------------- this is the EnemyMenu() that is causing spawer to print twice: def EnemyMenu(): from GameClasses import GameVariables for i, p in zip(GameVariables.chosen_names, GameVariables.chosen_hp): print (f"== NAME: {i} HEALTH: {p} ==") ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- This is the main bit of the code that i am working on right now :D i am only calling the spawner and enemy attack to run but whenever i do run the code spawner runs twiec but only when i put EnemyMenu() into the enemy attack function. def Spawner(self): import random, time global GameVariables print (f"== {GameVariables.enemy_count} ENEMIES HAS SPAWNED! ==") for _ in range(GameVariables.enemy_count): self.name = random.choice(GameVariables.name_list) GameVariables.name_list.remove(self.name) GameVariables.chosen_names.append(self.name) self.health = random.randint(20, 40) creationtext = f"== NAME: {self.name} HP: {self.health} ==" GameVariables.chosen_hp.append(self.health) print(creationtext) GameVariables.enemycreation.append(creationtext) def EnemyAttack(self): from Gamelists import shield_bash_response ,raging_strike_response, whirlwind_slash_response import random from GameFunctions import kill_section3, show_charcter_Death, EnemyMenu while True: print("== STARTING ROUND ==") print("== WHO DO YOU WANT TO ATTACK ==") EnemyMenu() answer = input("Choose Enemy > ").lower() if answer == "1": print(f"== YOU CHOSE TO ATTACK {GameVariables.chosen_names[0]} ==") print(f"== HOW WILL YOU ATTACK ==n Name: {GameVariables.chosen_names[0]} HP: {GameVariables.chosen_hp[0]} ==") print(f"== Choose Shield Bash - {GameVariables.shield_bash}Dmg - Raging Strike {GameVariables.shield_bash}Dmg - Whirlwind Strike {GameVariables.whirlwind_slash}Dmg ==") attack_answer = input("Choose Atack > ") if attack_answer == "shield bash": GameVariables.chosen_hp[0] -= 10 shield_bash_print = random.shuffle(shield_bash_response) print(shield_bash_print) print("== WHO DO YOU CHOOSE TO ATTACK NEXT! ==") elif attack_answer == "raging strike": GameVariables.chosen_hp[0] -= 15 raging_strike_print = random.shuffle(raging_strike_response) print(raging_strike_print) print("== WHO DO YOU CHOOSE TO ATTACK NEXT! ==") elif attack_answer == "whirlwind strike": GameVariables.chosen_hp[0] -= 5 whirlwind_strike_print = random.shuffle(whirlwind_slash_response) print(whirlwind_strike_print) print("== WHO DO YOU CHOOSE TO ATTACK NEXT! ==") else: print("== PLEASE ENTER A VALID INPUT ==") elif answer == "2": print(f"== YOU CHOSE TO ATTACK {GameVariables.chosen_names[1]} ==") print(f"== HOW WILL YOU ATTACK ==n Name: {GameVariables.chosen_names[1]} HP: {GameVariables.chosen_hp[1]} ==") print(f"== Choose Shield Bash - {GameVariables.shield_bash}Dmg - Raging Strike {GameVariables.shield_bash}Dmg - Whirlwind Strike {GameVariables.whirlwind_slash}Dmg ==") attack_answer = input("Choose Atack > ") if attack_answer == "shield bash": GameVariables.chosen_hp[1] -= 10 shield_bash_print = random.shuffle(shield_bash_response) print(shield_bash_print) print("== WHO DO YOU CHOOSE TO ATTACK NEXT! ==") elif attack_answer == "raging strike": GameVariables.chosen_hp[1] -= 15 raging_strike_print = random.shuffle(raging_strike_response) print(raging_strike_print) print("== WHO DO YOU CHOOSE TO ATTACK NEXT! ==") elif attack_answer == "whirlwind strike": GameVariables.chosen_hp[1] -= 5 whirlwind_strike_print = random.shuffle(whirlwind_slash_response) print(whirlwind_strike_print) print("== WHO DO YOU CHOOSE TO ATTACK NEXT! ==") else: print("== PLEASE ENTER A VALID INPUT ==") elif answer == "3": print(f"== YOU CHOSE TO ATTACK {GameVariables.chosen_names[2]} ==") print(f"== HOW WILL YOU ATTACK ==n Name: {GameVariables.chosen_names[2]} HP: {GameVariables.chosen_hp[2]} ==") print(f"== Choose Shield Bash - {GameVariables.shield_bash}Dmg - Raging Strike {GameVariables.shield_bash}Dmg - Whirlwind Strike {GameVariables.whirlwind_slash}Dmg ==") attack_answer = input("Choose Atack > ") if attack_answer == "shield bash": GameVariables.chosen_hp[2] -= 10 shield_bash_print = random.shuffle(shield_bash_response) print(shield_bash_print) print("== WHO DO YOU CHOOSE TO ATTACK NEXT! ==") elif attack_answer == "raging strike": GameVariables.chosen_hp[2] -= 15 raging_strike_print = random.shuffle(raging_strike_response) print(raging_strike_print) print("== WHO DO YOU CHOOSE TO ATTACK NEXT! ==") elif attack_answer == "whirlwind strike": GameVariables.chosen_hp[2] -= 5 whirlwind_strike_print = random.shuffle(whirlwind_slash_response) print(whirlwind_strike_print) print("== WHO DO YOU CHOOSE TO ATTACK NEXT! ==") else: print("== PLEASE ENTER A VALID INPUT ==") elif answer == "4": print(f"== YOU CHOSE TO ATTACK {GameVariables.chosen_names[3]} ==") print(f"== HOW WILL YOU ATTACK ==n Name: {GameVariables.chosen_names[3]} HP: {GameVariables.chosen_hp[3]} ==") print(f"== Choose Shield Bash - {GameVariables.shield_bash}Dmg - Raging Strike {GameVariables.shield_bash}Dmg - Whirlwind Strike {GameVariables.whirlwind_slash}Dmg ==") attack_answer = input("Choose Atack > ") if attack_answer == "shield bash": GameVariables.chosen_hp[3] -= 10 shield_bash_print = random.shuffle(shield_bash_response) print(shield_bash_print) print("== WHO DO YOU CHOOSE TO ATTACK NEXT! ==") elif attack_answer == "raging strike": GameVariables.chosen_hp[3] -= 15 raging_strike_print = random.shuffle(raging_strike_response) print(raging_strike_print) print("== WHO DO YOU CHOOSE TO ATTACK NEXT! ==") elif attack_answer == "whirlwind strike": GameVariables.chosen_hp[3] -= 5 whirlwind_strike_print = random.shuffle(whirlwind_slash_response) print(whirlwind_strike_print) print("== WHO DO YOU CHOOSE TO ATTACK NEXT! ==") else: print("== PLEASE ENTER A VALID INPUT ==") else: print("== PLEASE TYPE A VALID INPUT :) ==") if not all(x == 0 for x in GameVariables.chosen_hp): kill_section3() elif GameVariables.Warrior <= 0: show_charcter_Death() ----------------------------------------------------------------------------- 

submitted by /u/Amazing_Pattern_3382
[link] [comments]

​r/learnpython —————————————————————————– this is the output 🙂 == 3 ENEMIES HAS SPAWNED! == == NAME: PLAGUE SPITTER HP: 33 == == NAME: BLOOD REAVER HP: 30 == == NAME: FROST WRAITH HP: 30 == == STARTING ROUND == == WHO DO YOU WANT TO ATTACK == == 4 ENEMIES HAS SPAWNED! == == NAME: FROST WRAITH HP: 32 == == NAME: BLOOD REAVER HP: 24 == == NAME: VOID STALKER HP: 25 == == NAME: PLAGUE SPITTER HP: 26 == == STARTING ROUND == == WHO DO YOU WANT TO ATTACK == DEBUG: Entered EnemyMenu == NAME: FROST WRAITH HEALTH: 32 == == NAME: BLOOD REAVER HEALTH: 24 == == NAME: VOID STALKER HEALTH: 25 == == NAME: PLAGUE SPITTER HEALTH: 26 == Choose Enemy > —————————————————————————– this is the EnemyMenu() that is causing spawer to print twice: def EnemyMenu(): from GameClasses import GameVariables for i, p in zip(GameVariables.chosen_names, GameVariables.chosen_hp): print (f”== NAME: {i} HEALTH: {p} ==”) —————————————————————————– —————————————————————————– This is the main bit of the code that i am working on right now 😀 i am only calling the spawner and enemy attack to run but whenever i do run the code spawner runs twiec but only when i put EnemyMenu() into the enemy attack function. def Spawner(self): import random, time global GameVariables print (f”== {GameVariables.enemy_count} ENEMIES HAS SPAWNED! ==”) for _ in range(GameVariables.enemy_count): self.name = random.choice(GameVariables.name_list) GameVariables.name_list.remove(self.name) GameVariables.chosen_names.append(self.name) self.health = random.randint(20, 40) creationtext = f”== NAME: {self.name} HP: {self.health} ==” GameVariables.chosen_hp.append(self.health) print(creationtext) GameVariables.enemycreation.append(creationtext) def EnemyAttack(self): from Gamelists import shield_bash_response ,raging_strike_response, whirlwind_slash_response import random from GameFunctions import kill_section3, show_charcter_Death, EnemyMenu while True: print(“== STARTING ROUND ==”) print(“== WHO DO YOU WANT TO ATTACK ==”) EnemyMenu() answer = input(“Choose Enemy > “).lower() if answer == “1”: print(f”== YOU CHOSE TO ATTACK {GameVariables.chosen_names[0]} ==”) print(f”== HOW WILL YOU ATTACK ==n Name: {GameVariables.chosen_names[0]} HP: {GameVariables.chosen_hp[0]} ==”) print(f”== Choose Shield Bash – {GameVariables.shield_bash}Dmg – Raging Strike {GameVariables.shield_bash}Dmg – Whirlwind Strike {GameVariables.whirlwind_slash}Dmg ==”) attack_answer = input(“Choose Atack > “) if attack_answer == “shield bash”: GameVariables.chosen_hp[0] -= 10 shield_bash_print = random.shuffle(shield_bash_response) print(shield_bash_print) print(“== WHO DO YOU CHOOSE TO ATTACK NEXT! ==”) elif attack_answer == “raging strike”: GameVariables.chosen_hp[0] -= 15 raging_strike_print = random.shuffle(raging_strike_response) print(raging_strike_print) print(“== WHO DO YOU CHOOSE TO ATTACK NEXT! ==”) elif attack_answer == “whirlwind strike”: GameVariables.chosen_hp[0] -= 5 whirlwind_strike_print = random.shuffle(whirlwind_slash_response) print(whirlwind_strike_print) print(“== WHO DO YOU CHOOSE TO ATTACK NEXT! ==”) else: print(“== PLEASE ENTER A VALID INPUT ==”) elif answer == “2”: print(f”== YOU CHOSE TO ATTACK {GameVariables.chosen_names[1]} ==”) print(f”== HOW WILL YOU ATTACK ==n Name: {GameVariables.chosen_names[1]} HP: {GameVariables.chosen_hp[1]} ==”) print(f”== Choose Shield Bash – {GameVariables.shield_bash}Dmg – Raging Strike {GameVariables.shield_bash}Dmg – Whirlwind Strike {GameVariables.whirlwind_slash}Dmg ==”) attack_answer = input(“Choose Atack > “) if attack_answer == “shield bash”: GameVariables.chosen_hp[1] -= 10 shield_bash_print = random.shuffle(shield_bash_response) print(shield_bash_print) print(“== WHO DO YOU CHOOSE TO ATTACK NEXT! ==”) elif attack_answer == “raging strike”: GameVariables.chosen_hp[1] -= 15 raging_strike_print = random.shuffle(raging_strike_response) print(raging_strike_print) print(“== WHO DO YOU CHOOSE TO ATTACK NEXT! ==”) elif attack_answer == “whirlwind strike”: GameVariables.chosen_hp[1] -= 5 whirlwind_strike_print = random.shuffle(whirlwind_slash_response) print(whirlwind_strike_print) print(“== WHO DO YOU CHOOSE TO ATTACK NEXT! ==”) else: print(“== PLEASE ENTER A VALID INPUT ==”) elif answer == “3”: print(f”== YOU CHOSE TO ATTACK {GameVariables.chosen_names[2]} ==”) print(f”== HOW WILL YOU ATTACK ==n Name: {GameVariables.chosen_names[2]} HP: {GameVariables.chosen_hp[2]} ==”) print(f”== Choose Shield Bash – {GameVariables.shield_bash}Dmg – Raging Strike {GameVariables.shield_bash}Dmg – Whirlwind Strike {GameVariables.whirlwind_slash}Dmg ==”) attack_answer = input(“Choose Atack > “) if attack_answer == “shield bash”: GameVariables.chosen_hp[2] -= 10 shield_bash_print = random.shuffle(shield_bash_response) print(shield_bash_print) print(“== WHO DO YOU CHOOSE TO ATTACK NEXT! ==”) elif attack_answer == “raging strike”: GameVariables.chosen_hp[2] -= 15 raging_strike_print = random.shuffle(raging_strike_response) print(raging_strike_print) print(“== WHO DO YOU CHOOSE TO ATTACK NEXT! ==”) elif attack_answer == “whirlwind strike”: GameVariables.chosen_hp[2] -= 5 whirlwind_strike_print = random.shuffle(whirlwind_slash_response) print(whirlwind_strike_print) print(“== WHO DO YOU CHOOSE TO ATTACK NEXT! ==”) else: print(“== PLEASE ENTER A VALID INPUT ==”) elif answer == “4”: print(f”== YOU CHOSE TO ATTACK {GameVariables.chosen_names[3]} ==”) print(f”== HOW WILL YOU ATTACK ==n Name: {GameVariables.chosen_names[3]} HP: {GameVariables.chosen_hp[3]} ==”) print(f”== Choose Shield Bash – {GameVariables.shield_bash}Dmg – Raging Strike {GameVariables.shield_bash}Dmg – Whirlwind Strike {GameVariables.whirlwind_slash}Dmg ==”) attack_answer = input(“Choose Atack > “) if attack_answer == “shield bash”: GameVariables.chosen_hp[3] -= 10 shield_bash_print = random.shuffle(shield_bash_response) print(shield_bash_print) print(“== WHO DO YOU CHOOSE TO ATTACK NEXT! ==”) elif attack_answer == “raging strike”: GameVariables.chosen_hp[3] -= 15 raging_strike_print = random.shuffle(raging_strike_response) print(raging_strike_print) print(“== WHO DO YOU CHOOSE TO ATTACK NEXT! ==”) elif attack_answer == “whirlwind strike”: GameVariables.chosen_hp[3] -= 5 whirlwind_strike_print = random.shuffle(whirlwind_slash_response) print(whirlwind_strike_print) print(“== WHO DO YOU CHOOSE TO ATTACK NEXT! ==”) else: print(“== PLEASE ENTER A VALID INPUT ==”) else: print(“== PLEASE TYPE A VALID INPUT 🙂 ==”) if not all(x == 0 for x in GameVariables.chosen_hp): kill_section3() elif GameVariables.Warrior <= 0: show_charcter_Death() —————————————————————————– submitted by /u/Amazing_Pattern_3382 [link] [comments] 

----------------------------------------------------------------------------- this is the output :) == 3 ENEMIES HAS SPAWNED! == == NAME: PLAGUE SPITTER HP: 33 == == NAME: BLOOD REAVER HP: 30 == == NAME: FROST WRAITH HP: 30 == == STARTING ROUND == == WHO DO YOU WANT TO ATTACK == == 4 ENEMIES HAS SPAWNED! == == NAME: FROST WRAITH HP: 32 == == NAME: BLOOD REAVER HP: 24 == == NAME: VOID STALKER HP: 25 == == NAME: PLAGUE SPITTER HP: 26 == == STARTING ROUND == == WHO DO YOU WANT TO ATTACK == DEBUG: Entered EnemyMenu == NAME: FROST WRAITH HEALTH: 32 == == NAME: BLOOD REAVER HEALTH: 24 == == NAME: VOID STALKER HEALTH: 25 == == NAME: PLAGUE SPITTER HEALTH: 26 == Choose Enemy > ----------------------------------------------------------------------------- this is the EnemyMenu() that is causing spawer to print twice: def EnemyMenu(): from GameClasses import GameVariables for i, p in zip(GameVariables.chosen_names, GameVariables.chosen_hp): print (f"== NAME: {i} HEALTH: {p} ==") ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- This is the main bit of the code that i am working on right now :D i am only calling the spawner and enemy attack to run but whenever i do run the code spawner runs twiec but only when i put EnemyMenu() into the enemy attack function. def Spawner(self): import random, time global GameVariables print (f"== {GameVariables.enemy_count} ENEMIES HAS SPAWNED! ==") for _ in range(GameVariables.enemy_count): self.name = random.choice(GameVariables.name_list) GameVariables.name_list.remove(self.name) GameVariables.chosen_names.append(self.name) self.health = random.randint(20, 40) creationtext = f"== NAME: {self.name} HP: {self.health} ==" GameVariables.chosen_hp.append(self.health) print(creationtext) GameVariables.enemycreation.append(creationtext) def EnemyAttack(self): from Gamelists import shield_bash_response ,raging_strike_response, whirlwind_slash_response import random from GameFunctions import kill_section3, show_charcter_Death, EnemyMenu while True: print("== STARTING ROUND ==") print("== WHO DO YOU WANT TO ATTACK ==") EnemyMenu() answer = input("Choose Enemy > ").lower() if answer == "1": print(f"== YOU CHOSE TO ATTACK {GameVariables.chosen_names[0]} ==") print(f"== HOW WILL YOU ATTACK ==n Name: {GameVariables.chosen_names[0]} HP: {GameVariables.chosen_hp[0]} ==") print(f"== Choose Shield Bash - {GameVariables.shield_bash}Dmg - Raging Strike {GameVariables.shield_bash}Dmg - Whirlwind Strike {GameVariables.whirlwind_slash}Dmg ==") attack_answer = input("Choose Atack > ") if attack_answer == "shield bash": GameVariables.chosen_hp[0] -= 10 shield_bash_print = random.shuffle(shield_bash_response) print(shield_bash_print) print("== WHO DO YOU CHOOSE TO ATTACK NEXT! ==") elif attack_answer == "raging strike": GameVariables.chosen_hp[0] -= 15 raging_strike_print = random.shuffle(raging_strike_response) print(raging_strike_print) print("== WHO DO YOU CHOOSE TO ATTACK NEXT! ==") elif attack_answer == "whirlwind strike": GameVariables.chosen_hp[0] -= 5 whirlwind_strike_print = random.shuffle(whirlwind_slash_response) print(whirlwind_strike_print) print("== WHO DO YOU CHOOSE TO ATTACK NEXT! ==") else: print("== PLEASE ENTER A VALID INPUT ==") elif answer == "2": print(f"== YOU CHOSE TO ATTACK {GameVariables.chosen_names[1]} ==") print(f"== HOW WILL YOU ATTACK ==n Name: {GameVariables.chosen_names[1]} HP: {GameVariables.chosen_hp[1]} ==") print(f"== Choose Shield Bash - {GameVariables.shield_bash}Dmg - Raging Strike {GameVariables.shield_bash}Dmg - Whirlwind Strike {GameVariables.whirlwind_slash}Dmg ==") attack_answer = input("Choose Atack > ") if attack_answer == "shield bash": GameVariables.chosen_hp[1] -= 10 shield_bash_print = random.shuffle(shield_bash_response) print(shield_bash_print) print("== WHO DO YOU CHOOSE TO ATTACK NEXT! ==") elif attack_answer == "raging strike": GameVariables.chosen_hp[1] -= 15 raging_strike_print = random.shuffle(raging_strike_response) print(raging_strike_print) print("== WHO DO YOU CHOOSE TO ATTACK NEXT! ==") elif attack_answer == "whirlwind strike": GameVariables.chosen_hp[1] -= 5 whirlwind_strike_print = random.shuffle(whirlwind_slash_response) print(whirlwind_strike_print) print("== WHO DO YOU CHOOSE TO ATTACK NEXT! ==") else: print("== PLEASE ENTER A VALID INPUT ==") elif answer == "3": print(f"== YOU CHOSE TO ATTACK {GameVariables.chosen_names[2]} ==") print(f"== HOW WILL YOU ATTACK ==n Name: {GameVariables.chosen_names[2]} HP: {GameVariables.chosen_hp[2]} ==") print(f"== Choose Shield Bash - {GameVariables.shield_bash}Dmg - Raging Strike {GameVariables.shield_bash}Dmg - Whirlwind Strike {GameVariables.whirlwind_slash}Dmg ==") attack_answer = input("Choose Atack > ") if attack_answer == "shield bash": GameVariables.chosen_hp[2] -= 10 shield_bash_print = random.shuffle(shield_bash_response) print(shield_bash_print) print("== WHO DO YOU CHOOSE TO ATTACK NEXT! ==") elif attack_answer == "raging strike": GameVariables.chosen_hp[2] -= 15 raging_strike_print = random.shuffle(raging_strike_response) print(raging_strike_print) print("== WHO DO YOU CHOOSE TO ATTACK NEXT! ==") elif attack_answer == "whirlwind strike": GameVariables.chosen_hp[2] -= 5 whirlwind_strike_print = random.shuffle(whirlwind_slash_response) print(whirlwind_strike_print) print("== WHO DO YOU CHOOSE TO ATTACK NEXT! ==") else: print("== PLEASE ENTER A VALID INPUT ==") elif answer == "4": print(f"== YOU CHOSE TO ATTACK {GameVariables.chosen_names[3]} ==") print(f"== HOW WILL YOU ATTACK ==n Name: {GameVariables.chosen_names[3]} HP: {GameVariables.chosen_hp[3]} ==") print(f"== Choose Shield Bash - {GameVariables.shield_bash}Dmg - Raging Strike {GameVariables.shield_bash}Dmg - Whirlwind Strike {GameVariables.whirlwind_slash}Dmg ==") attack_answer = input("Choose Atack > ") if attack_answer == "shield bash": GameVariables.chosen_hp[3] -= 10 shield_bash_print = random.shuffle(shield_bash_response) print(shield_bash_print) print("== WHO DO YOU CHOOSE TO ATTACK NEXT! ==") elif attack_answer == "raging strike": GameVariables.chosen_hp[3] -= 15 raging_strike_print = random.shuffle(raging_strike_response) print(raging_strike_print) print("== WHO DO YOU CHOOSE TO ATTACK NEXT! ==") elif attack_answer == "whirlwind strike": GameVariables.chosen_hp[3] -= 5 whirlwind_strike_print = random.shuffle(whirlwind_slash_response) print(whirlwind_strike_print) print("== WHO DO YOU CHOOSE TO ATTACK NEXT! ==") else: print("== PLEASE ENTER A VALID INPUT ==") else: print("== PLEASE TYPE A VALID INPUT :) ==") if not all(x == 0 for x in GameVariables.chosen_hp): kill_section3() elif GameVariables.Warrior <= 0: show_charcter_Death() ----------------------------------------------------------------------------- 

submitted by /u/Amazing_Pattern_3382
[link] [comments]  —————————————————————————– this is the output 🙂 == 3 ENEMIES HAS SPAWNED! == == NAME: PLAGUE SPITTER HP: 33 == == NAME: BLOOD REAVER HP: 30 == == NAME: FROST WRAITH HP: 30 == == STARTING ROUND == == WHO DO YOU WANT TO ATTACK == == 4 ENEMIES HAS SPAWNED! == == NAME: FROST WRAITH HP: 32 == == NAME: BLOOD REAVER HP: 24 == == NAME: VOID STALKER HP: 25 == == NAME: PLAGUE SPITTER HP: 26 == == STARTING ROUND == == WHO DO YOU WANT TO ATTACK == DEBUG: Entered EnemyMenu == NAME: FROST WRAITH HEALTH: 32 == == NAME: BLOOD REAVER HEALTH: 24 == == NAME: VOID STALKER HEALTH: 25 == == NAME: PLAGUE SPITTER HEALTH: 26 == Choose Enemy > —————————————————————————– this is the EnemyMenu() that is causing spawer to print twice: def EnemyMenu(): from GameClasses import GameVariables for i, p in zip(GameVariables.chosen_names, GameVariables.chosen_hp): print (f”== NAME: {i} HEALTH: {p} ==”) —————————————————————————– —————————————————————————– This is the main bit of the code that i am working on right now 😀 i am only calling the spawner and enemy attack to run but whenever i do run the code spawner runs twiec but only when i put EnemyMenu() into the enemy attack function. def Spawner(self): import random, time global GameVariables print (f”== {GameVariables.enemy_count} ENEMIES HAS SPAWNED! ==”) for _ in range(GameVariables.enemy_count): self.name = random.choice(GameVariables.name_list) GameVariables.name_list.remove(self.name) GameVariables.chosen_names.append(self.name) self.health = random.randint(20, 40) creationtext = f”== NAME: {self.name} HP: {self.health} ==” GameVariables.chosen_hp.append(self.health) print(creationtext) GameVariables.enemycreation.append(creationtext) def EnemyAttack(self): from Gamelists import shield_bash_response ,raging_strike_response, whirlwind_slash_response import random from GameFunctions import kill_section3, show_charcter_Death, EnemyMenu while True: print(“== STARTING ROUND ==”) print(“== WHO DO YOU WANT TO ATTACK ==”) EnemyMenu() answer = input(“Choose Enemy > “).lower() if answer == “1”: print(f”== YOU CHOSE TO ATTACK {GameVariables.chosen_names[0]} ==”) print(f”== HOW WILL YOU ATTACK ==n Name: {GameVariables.chosen_names[0]} HP: {GameVariables.chosen_hp[0]} ==”) print(f”== Choose Shield Bash – {GameVariables.shield_bash}Dmg – Raging Strike {GameVariables.shield_bash}Dmg – Whirlwind Strike {GameVariables.whirlwind_slash}Dmg ==”) attack_answer = input(“Choose Atack > “) if attack_answer == “shield bash”: GameVariables.chosen_hp[0] -= 10 shield_bash_print = random.shuffle(shield_bash_response) print(shield_bash_print) print(“== WHO DO YOU CHOOSE TO ATTACK NEXT! ==”) elif attack_answer == “raging strike”: GameVariables.chosen_hp[0] -= 15 raging_strike_print = random.shuffle(raging_strike_response) print(raging_strike_print) print(“== WHO DO YOU CHOOSE TO ATTACK NEXT! ==”) elif attack_answer == “whirlwind strike”: GameVariables.chosen_hp[0] -= 5 whirlwind_strike_print = random.shuffle(whirlwind_slash_response) print(whirlwind_strike_print) print(“== WHO DO YOU CHOOSE TO ATTACK NEXT! ==”) else: print(“== PLEASE ENTER A VALID INPUT ==”) elif answer == “2”: print(f”== YOU CHOSE TO ATTACK {GameVariables.chosen_names[1]} ==”) print(f”== HOW WILL YOU ATTACK ==n Name: {GameVariables.chosen_names[1]} HP: {GameVariables.chosen_hp[1]} ==”) print(f”== Choose Shield Bash – {GameVariables.shield_bash}Dmg – Raging Strike {GameVariables.shield_bash}Dmg – Whirlwind Strike {GameVariables.whirlwind_slash}Dmg ==”) attack_answer = input(“Choose Atack > “) if attack_answer == “shield bash”: GameVariables.chosen_hp[1] -= 10 shield_bash_print = random.shuffle(shield_bash_response) print(shield_bash_print) print(“== WHO DO YOU CHOOSE TO ATTACK NEXT! ==”) elif attack_answer == “raging strike”: GameVariables.chosen_hp[1] -= 15 raging_strike_print = random.shuffle(raging_strike_response) print(raging_strike_print) print(“== WHO DO YOU CHOOSE TO ATTACK NEXT! ==”) elif attack_answer == “whirlwind strike”: GameVariables.chosen_hp[1] -= 5 whirlwind_strike_print = random.shuffle(whirlwind_slash_response) print(whirlwind_strike_print) print(“== WHO DO YOU CHOOSE TO ATTACK NEXT! ==”) else: print(“== PLEASE ENTER A VALID INPUT ==”) elif answer == “3”: print(f”== YOU CHOSE TO ATTACK {GameVariables.chosen_names[2]} ==”) print(f”== HOW WILL YOU ATTACK ==n Name: {GameVariables.chosen_names[2]} HP: {GameVariables.chosen_hp[2]} ==”) print(f”== Choose Shield Bash – {GameVariables.shield_bash}Dmg – Raging Strike {GameVariables.shield_bash}Dmg – Whirlwind Strike {GameVariables.whirlwind_slash}Dmg ==”) attack_answer = input(“Choose Atack > “) if attack_answer == “shield bash”: GameVariables.chosen_hp[2] -= 10 shield_bash_print = random.shuffle(shield_bash_response) print(shield_bash_print) print(“== WHO DO YOU CHOOSE TO ATTACK NEXT! ==”) elif attack_answer == “raging strike”: GameVariables.chosen_hp[2] -= 15 raging_strike_print = random.shuffle(raging_strike_response) print(raging_strike_print) print(“== WHO DO YOU CHOOSE TO ATTACK NEXT! ==”) elif attack_answer == “whirlwind strike”: GameVariables.chosen_hp[2] -= 5 whirlwind_strike_print = random.shuffle(whirlwind_slash_response) print(whirlwind_strike_print) print(“== WHO DO YOU CHOOSE TO ATTACK NEXT! ==”) else: print(“== PLEASE ENTER A VALID INPUT ==”) elif answer == “4”: print(f”== YOU CHOSE TO ATTACK {GameVariables.chosen_names[3]} ==”) print(f”== HOW WILL YOU ATTACK ==n Name: {GameVariables.chosen_names[3]} HP: {GameVariables.chosen_hp[3]} ==”) print(f”== Choose Shield Bash – {GameVariables.shield_bash}Dmg – Raging Strike {GameVariables.shield_bash}Dmg – Whirlwind Strike {GameVariables.whirlwind_slash}Dmg ==”) attack_answer = input(“Choose Atack > “) if attack_answer == “shield bash”: GameVariables.chosen_hp[3] -= 10 shield_bash_print = random.shuffle(shield_bash_response) print(shield_bash_print) print(“== WHO DO YOU CHOOSE TO ATTACK NEXT! ==”) elif attack_answer == “raging strike”: GameVariables.chosen_hp[3] -= 15 raging_strike_print = random.shuffle(raging_strike_response) print(raging_strike_print) print(“== WHO DO YOU CHOOSE TO ATTACK NEXT! ==”) elif attack_answer == “whirlwind strike”: GameVariables.chosen_hp[3] -= 5 whirlwind_strike_print = random.shuffle(whirlwind_slash_response) print(whirlwind_strike_print) print(“== WHO DO YOU CHOOSE TO ATTACK NEXT! ==”) else: print(“== PLEASE ENTER A VALID INPUT ==”) else: print(“== PLEASE TYPE A VALID INPUT 🙂 ==”) if not all(x == 0 for x in GameVariables.chosen_hp): kill_section3() elif GameVariables.Warrior <= 0: show_charcter_Death() —————————————————————————– submitted by /u/Amazing_Pattern_3382 [link] [comments]

Read more

Problems installing pyarrow in a virtual environment /u/Intentionalrobot Python Education

Problems installing pyarrow in a virtual environment /u/Intentionalrobot Python Education

Context: I’m a data analyst and I usually work in only one environment that’s mainly Jupyter Notebooks. I don’t know anything about software best practices or development, github, and I have a tenuous grasp on coding in general.

My Goal: I recently built a simple AI Agent in python that connects my companies’ BigQuery database to an LLM and then outputs that AI response back into BigQuery.

I need to find a way to deploy this to google cloud so that my co-workers can interact with it. I decided I am going to use Streamlit, which is supposedly the easiest way to stand up a front end for a little Python app.

The Problem: I got a simple “hello world” streamlit page up, but when I try to recreate the environment to build my AI Agent in the new environment, the installation of key packages doesn’t work. Pyarrow is the main one I’m having trouble with right now.

I read online that I should create a virtual environment for deploying my app to the cloud. I’m not sure if this is strictly necessary, but that’s what I’ve been trying to do because I’m just following the steps. Plus, I couldn’t run streamlit from my jupyter notebooks.

What i’ve done: I created the virtual environment using python3 -m venv .venv, which works fine, but when I try to install the packages I need (like pyarrow, langchain, pandas, etc.), I keep running into errors. I expected that I would just create the environment, activate it, and then run pip install pyarrow, pip install langchain, and pip install pandas. However, instead of it installing smoothly, I started getting errors with pyarrow and ended up having to install things like cmake, apache-arrow, and more. But, it’s frustrating because none of these installations of cmake or apache-arrow are solving the problem with pyarrow.

Snippet of the Errors:

Collecting pyarrow

Using cached pyarrow-18.1.0.tar.gz (1.1 MB)

Installing build dependencies … done

Getting requirements to build wheel … done

Preparing metadata (pyproject.toml) … done

Building wheels for collected packages: pyarrow

Building wheel for pyarrow (pyproject.toml) … error

error: subprocess-exited-with-error

× Building wheel for pyarrow (pyproject.toml) did not run successfully.

│ exit code: 1

╰─> [832 lines of output]

— Configuring incomplete, errors occurred!

error: command ‘/usr/local/bin/cmake’ failed with exit code 1

[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.

ERROR: Failed building wheel for pyarrow

Failed to build pyarrow

ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (pyarrow)

________________________________________________

I’ve been trying to troubleshoot online, but nothing is really working.

Any help would be greatly appreciated. If you could point me toward the key concepts I need to understand in order to diagnose the issue, that would be really helpful. If you have any specific advice, I would love that.

submitted by /u/Intentionalrobot
[link] [comments]

​r/learnpython Context: I’m a data analyst and I usually work in only one environment that’s mainly Jupyter Notebooks. I don’t know anything about software best practices or development, github, and I have a tenuous grasp on coding in general. My Goal: I recently built a simple AI Agent in python that connects my companies’ BigQuery database to an LLM and then outputs that AI response back into BigQuery. I need to find a way to deploy this to google cloud so that my co-workers can interact with it. I decided I am going to use Streamlit, which is supposedly the easiest way to stand up a front end for a little Python app. The Problem: I got a simple “hello world” streamlit page up, but when I try to recreate the environment to build my AI Agent in the new environment, the installation of key packages doesn’t work. Pyarrow is the main one I’m having trouble with right now. I read online that I should create a virtual environment for deploying my app to the cloud. I’m not sure if this is strictly necessary, but that’s what I’ve been trying to do because I’m just following the steps. Plus, I couldn’t run streamlit from my jupyter notebooks. What i’ve done: I created the virtual environment using python3 -m venv .venv, which works fine, but when I try to install the packages I need (like pyarrow, langchain, pandas, etc.), I keep running into errors. I expected that I would just create the environment, activate it, and then run pip install pyarrow, pip install langchain, and pip install pandas. However, instead of it installing smoothly, I started getting errors with pyarrow and ended up having to install things like cmake, apache-arrow, and more. But, it’s frustrating because none of these installations of cmake or apache-arrow are solving the problem with pyarrow. Snippet of the Errors: Collecting pyarrow Using cached pyarrow-18.1.0.tar.gz (1.1 MB) Installing build dependencies … done Getting requirements to build wheel … done Preparing metadata (pyproject.toml) … done Building wheels for collected packages: pyarrow Building wheel for pyarrow (pyproject.toml) … error error: subprocess-exited-with-error × Building wheel for pyarrow (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [832 lines of output] — Configuring incomplete, errors occurred! error: command ‘/usr/local/bin/cmake’ failed with exit code 1 [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for pyarrow Failed to build pyarrow ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (pyarrow) ________________________________________________ I’ve been trying to troubleshoot online, but nothing is really working. Any help would be greatly appreciated. If you could point me toward the key concepts I need to understand in order to diagnose the issue, that would be really helpful. If you have any specific advice, I would love that. submitted by /u/Intentionalrobot [link] [comments] 

Context: I’m a data analyst and I usually work in only one environment that’s mainly Jupyter Notebooks. I don’t know anything about software best practices or development, github, and I have a tenuous grasp on coding in general.

My Goal: I recently built a simple AI Agent in python that connects my companies’ BigQuery database to an LLM and then outputs that AI response back into BigQuery.

I need to find a way to deploy this to google cloud so that my co-workers can interact with it. I decided I am going to use Streamlit, which is supposedly the easiest way to stand up a front end for a little Python app.

The Problem: I got a simple “hello world” streamlit page up, but when I try to recreate the environment to build my AI Agent in the new environment, the installation of key packages doesn’t work. Pyarrow is the main one I’m having trouble with right now.

I read online that I should create a virtual environment for deploying my app to the cloud. I’m not sure if this is strictly necessary, but that’s what I’ve been trying to do because I’m just following the steps. Plus, I couldn’t run streamlit from my jupyter notebooks.

What i’ve done: I created the virtual environment using python3 -m venv .venv, which works fine, but when I try to install the packages I need (like pyarrow, langchain, pandas, etc.), I keep running into errors. I expected that I would just create the environment, activate it, and then run pip install pyarrow, pip install langchain, and pip install pandas. However, instead of it installing smoothly, I started getting errors with pyarrow and ended up having to install things like cmake, apache-arrow, and more. But, it’s frustrating because none of these installations of cmake or apache-arrow are solving the problem with pyarrow.

Snippet of the Errors:

Collecting pyarrow

Using cached pyarrow-18.1.0.tar.gz (1.1 MB)

Installing build dependencies … done

Getting requirements to build wheel … done

Preparing metadata (pyproject.toml) … done

Building wheels for collected packages: pyarrow

Building wheel for pyarrow (pyproject.toml) … error

error: subprocess-exited-with-error

× Building wheel for pyarrow (pyproject.toml) did not run successfully.

│ exit code: 1

╰─> [832 lines of output]

— Configuring incomplete, errors occurred!

error: command ‘/usr/local/bin/cmake’ failed with exit code 1

[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.

ERROR: Failed building wheel for pyarrow

Failed to build pyarrow

ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (pyarrow)

________________________________________________

I’ve been trying to troubleshoot online, but nothing is really working.

Any help would be greatly appreciated. If you could point me toward the key concepts I need to understand in order to diagnose the issue, that would be really helpful. If you have any specific advice, I would love that.

submitted by /u/Intentionalrobot
[link] [comments]  Context: I’m a data analyst and I usually work in only one environment that’s mainly Jupyter Notebooks. I don’t know anything about software best practices or development, github, and I have a tenuous grasp on coding in general. My Goal: I recently built a simple AI Agent in python that connects my companies’ BigQuery database to an LLM and then outputs that AI response back into BigQuery. I need to find a way to deploy this to google cloud so that my co-workers can interact with it. I decided I am going to use Streamlit, which is supposedly the easiest way to stand up a front end for a little Python app. The Problem: I got a simple “hello world” streamlit page up, but when I try to recreate the environment to build my AI Agent in the new environment, the installation of key packages doesn’t work. Pyarrow is the main one I’m having trouble with right now. I read online that I should create a virtual environment for deploying my app to the cloud. I’m not sure if this is strictly necessary, but that’s what I’ve been trying to do because I’m just following the steps. Plus, I couldn’t run streamlit from my jupyter notebooks. What i’ve done: I created the virtual environment using python3 -m venv .venv, which works fine, but when I try to install the packages I need (like pyarrow, langchain, pandas, etc.), I keep running into errors. I expected that I would just create the environment, activate it, and then run pip install pyarrow, pip install langchain, and pip install pandas. However, instead of it installing smoothly, I started getting errors with pyarrow and ended up having to install things like cmake, apache-arrow, and more. But, it’s frustrating because none of these installations of cmake or apache-arrow are solving the problem with pyarrow. Snippet of the Errors: Collecting pyarrow Using cached pyarrow-18.1.0.tar.gz (1.1 MB) Installing build dependencies … done Getting requirements to build wheel … done Preparing metadata (pyproject.toml) … done Building wheels for collected packages: pyarrow Building wheel for pyarrow (pyproject.toml) … error error: subprocess-exited-with-error × Building wheel for pyarrow (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [832 lines of output] — Configuring incomplete, errors occurred! error: command ‘/usr/local/bin/cmake’ failed with exit code 1 [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for pyarrow Failed to build pyarrow ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (pyarrow) ________________________________________________ I’ve been trying to troubleshoot online, but nothing is really working. Any help would be greatly appreciated. If you could point me toward the key concepts I need to understand in order to diagnose the issue, that would be really helpful. If you have any specific advice, I would love that. submitted by /u/Intentionalrobot [link] [comments]

Read more

When doing “From X import Y”, how does python “find” variable Y? /u/ZombieSurvivor365 Python Education

When doing “From X import Y”, how does python “find” variable Y? /u/ZombieSurvivor365 Python Education

Does python iterate line-by-line to find variable Y? If variable Y is on line 500 and the previous 499 lines is just one big function, does it skip past the function? Or does it look through each 500 lines until it finds variable Y? Or does each .py file have an index system where it does a “goto” for each variable Y? So, if I have a 50,000-line file, and I’m importing a function on line 44,000, does it just skip past all the BS to line 44,000?

submitted by /u/ZombieSurvivor365
[link] [comments]

​r/learnpython Does python iterate line-by-line to find variable Y? If variable Y is on line 500 and the previous 499 lines is just one big function, does it skip past the function? Or does it look through each 500 lines until it finds variable Y? Or does each .py file have an index system where it does a “goto” for each variable Y? So, if I have a 50,000-line file, and I’m importing a function on line 44,000, does it just skip past all the BS to line 44,000? submitted by /u/ZombieSurvivor365 [link] [comments] 

Does python iterate line-by-line to find variable Y? If variable Y is on line 500 and the previous 499 lines is just one big function, does it skip past the function? Or does it look through each 500 lines until it finds variable Y? Or does each .py file have an index system where it does a “goto” for each variable Y? So, if I have a 50,000-line file, and I’m importing a function on line 44,000, does it just skip past all the BS to line 44,000?

submitted by /u/ZombieSurvivor365
[link] [comments]  Does python iterate line-by-line to find variable Y? If variable Y is on line 500 and the previous 499 lines is just one big function, does it skip past the function? Or does it look through each 500 lines until it finds variable Y? Or does each .py file have an index system where it does a “goto” for each variable Y? So, if I have a 50,000-line file, and I’m importing a function on line 44,000, does it just skip past all the BS to line 44,000? submitted by /u/ZombieSurvivor365 [link] [comments]

Read more