Weird subprocess.run behaviour /u/Entraxipy Python Education

Weird subprocess.run behaviour /u/Entraxipy Python Education

So I’m making a small test project to learn python better and for some reason, when I run it, it prints the command out, and then it seems like subprocess.run freezes as nothing else happens. When I copy the command and paste it in command prompt however, the command works perfectly fine. When an error is raised, the subprocess.run returns a non-zero return code and my program continues as normal. What is happening?

command is typically structured as a multiline list of valid terminal commands.

import os import subprocess import gptinterface as ChatGPT import time initial_prompt = r""" ommited for clarity """ workfolder = r"C:UsersRoberPycharmProjectsAI_coderworkplace" command = ChatGPT.send_msg(initial_prompt) while True: command = command.strip("`").strip() print(">>> "+repr(command)+"") if command == "help": command = ChatGPT.send_msg(initial_prompt) continue start = time.time() result = subprocess.run(str(command), cwd=workfolder, shell=True, capture_output=True, env=os.environ, text=True, timeout=5) end = time.time() print("finished command") if result.returncode == 0: time_taken = (end-start)*1000 print(result.stdout) command = ChatGPT.send_msg(f"Success:n{result.stdout}nnTook {time_taken:.1f} msnSend 'help' if you want a reminder of your target.") else: print(result.stderr) command = ChatGPT.send_msg("Error:n"+result.stderr+"nSend 'help' if you want a reminder of your target.") 

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

​r/learnpython So I’m making a small test project to learn python better and for some reason, when I run it, it prints the command out, and then it seems like subprocess.run freezes as nothing else happens. When I copy the command and paste it in command prompt however, the command works perfectly fine. When an error is raised, the subprocess.run returns a non-zero return code and my program continues as normal. What is happening? command is typically structured as a multiline list of valid terminal commands. import os import subprocess import gptinterface as ChatGPT import time initial_prompt = r””” ommited for clarity “”” workfolder = r”C:UsersRoberPycharmProjectsAI_coderworkplace” command = ChatGPT.send_msg(initial_prompt) while True: command = command.strip(“`”).strip() print(“>>> “+repr(command)+””) if command == “help”: command = ChatGPT.send_msg(initial_prompt) continue start = time.time() result = subprocess.run(str(command), cwd=workfolder, shell=True, capture_output=True, env=os.environ, text=True, timeout=5) end = time.time() print(“finished command”) if result.returncode == 0: time_taken = (end-start)*1000 print(result.stdout) command = ChatGPT.send_msg(f”Success:n{result.stdout}nnTook {time_taken:.1f} msnSend ‘help’ if you want a reminder of your target.”) else: print(result.stderr) command = ChatGPT.send_msg(“Error:n”+result.stderr+”nSend ‘help’ if you want a reminder of your target.”) submitted by /u/Entraxipy [link] [comments] 

So I’m making a small test project to learn python better and for some reason, when I run it, it prints the command out, and then it seems like subprocess.run freezes as nothing else happens. When I copy the command and paste it in command prompt however, the command works perfectly fine. When an error is raised, the subprocess.run returns a non-zero return code and my program continues as normal. What is happening?

command is typically structured as a multiline list of valid terminal commands.

import os import subprocess import gptinterface as ChatGPT import time initial_prompt = r""" ommited for clarity """ workfolder = r"C:UsersRoberPycharmProjectsAI_coderworkplace" command = ChatGPT.send_msg(initial_prompt) while True: command = command.strip("`").strip() print(">>> "+repr(command)+"") if command == "help": command = ChatGPT.send_msg(initial_prompt) continue start = time.time() result = subprocess.run(str(command), cwd=workfolder, shell=True, capture_output=True, env=os.environ, text=True, timeout=5) end = time.time() print("finished command") if result.returncode == 0: time_taken = (end-start)*1000 print(result.stdout) command = ChatGPT.send_msg(f"Success:n{result.stdout}nnTook {time_taken:.1f} msnSend 'help' if you want a reminder of your target.") else: print(result.stderr) command = ChatGPT.send_msg("Error:n"+result.stderr+"nSend 'help' if you want a reminder of your target.") 

submitted by /u/Entraxipy
[link] [comments]  So I’m making a small test project to learn python better and for some reason, when I run it, it prints the command out, and then it seems like subprocess.run freezes as nothing else happens. When I copy the command and paste it in command prompt however, the command works perfectly fine. When an error is raised, the subprocess.run returns a non-zero return code and my program continues as normal. What is happening? command is typically structured as a multiline list of valid terminal commands. import os import subprocess import gptinterface as ChatGPT import time initial_prompt = r””” ommited for clarity “”” workfolder = r”C:UsersRoberPycharmProjectsAI_coderworkplace” command = ChatGPT.send_msg(initial_prompt) while True: command = command.strip(“`”).strip() print(“>>> “+repr(command)+””) if command == “help”: command = ChatGPT.send_msg(initial_prompt) continue start = time.time() result = subprocess.run(str(command), cwd=workfolder, shell=True, capture_output=True, env=os.environ, text=True, timeout=5) end = time.time() print(“finished command”) if result.returncode == 0: time_taken = (end-start)*1000 print(result.stdout) command = ChatGPT.send_msg(f”Success:n{result.stdout}nnTook {time_taken:.1f} msnSend ‘help’ if you want a reminder of your target.”) else: print(result.stderr) command = ChatGPT.send_msg(“Error:n”+result.stderr+”nSend ‘help’ if you want a reminder of your target.”) submitted by /u/Entraxipy [link] [comments]

Read more

How to run a .py without aide /u/Impressive_Nose7329 Python Education

How to run a .py without aide /u/Impressive_Nose7329 Python Education

Example if I would wanna make a program on someone’s Conputer without them having a IDE installed is that possible or do I need them to first have a Python IDE installed for it to run maybe on the background.

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

​r/learnpython Example if I would wanna make a program on someone’s Conputer without them having a IDE installed is that possible or do I need them to first have a Python IDE installed for it to run maybe on the background. submitted by /u/Impressive_Nose7329 [link] [comments] 

Example if I would wanna make a program on someone’s Conputer without them having a IDE installed is that possible or do I need them to first have a Python IDE installed for it to run maybe on the background.

submitted by /u/Impressive_Nose7329
[link] [comments]  Example if I would wanna make a program on someone’s Conputer without them having a IDE installed is that possible or do I need them to first have a Python IDE installed for it to run maybe on the background. submitted by /u/Impressive_Nose7329 [link] [comments]

Read more

How to upload files from a local folder to Sharepoint folder daily using python and task manager maybe?? /u/EasyBox5718 Python Education

How to upload files from a local folder to Sharepoint folder daily using python and task manager maybe?? /u/EasyBox5718 Python Education

I’m looking for a way to automatically upload files daily to Sharepoint folder using python, .bat files, task manager or whatever in a specific time daily.

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

​r/learnpython I’m looking for a way to automatically upload files daily to Sharepoint folder using python, .bat files, task manager or whatever in a specific time daily. submitted by /u/EasyBox5718 [link] [comments] 

I’m looking for a way to automatically upload files daily to Sharepoint folder using python, .bat files, task manager or whatever in a specific time daily.

submitted by /u/EasyBox5718
[link] [comments]  I’m looking for a way to automatically upload files daily to Sharepoint folder using python, .bat files, task manager or whatever in a specific time daily. submitted by /u/EasyBox5718 [link] [comments]

Read more

Printing text within ASCII /u/Twigzywik Python Education

Printing text within ASCII /u/Twigzywik Python Education

Hello, I need some help on some ideas on how to go about this. I want to print a box made with | and –

The goal here is to print text within the box without disturbing its geometry, but not printing it all at the same time which would be rather easy. I want to do a type writer effect within the box. How can I go about this? Printing line by line kind of makes the end of the box, and the rest of the box not print until it finishes the print for the typewriter text.

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

​r/learnpython Hello, I need some help on some ideas on how to go about this. I want to print a box made with | and – The goal here is to print text within the box without disturbing its geometry, but not printing it all at the same time which would be rather easy. I want to do a type writer effect within the box. How can I go about this? Printing line by line kind of makes the end of the box, and the rest of the box not print until it finishes the print for the typewriter text. submitted by /u/Twigzywik [link] [comments] 

Hello, I need some help on some ideas on how to go about this. I want to print a box made with | and –

The goal here is to print text within the box without disturbing its geometry, but not printing it all at the same time which would be rather easy. I want to do a type writer effect within the box. How can I go about this? Printing line by line kind of makes the end of the box, and the rest of the box not print until it finishes the print for the typewriter text.

submitted by /u/Twigzywik
[link] [comments]  Hello, I need some help on some ideas on how to go about this. I want to print a box made with | and – The goal here is to print text within the box without disturbing its geometry, but not printing it all at the same time which would be rather easy. I want to do a type writer effect within the box. How can I go about this? Printing line by line kind of makes the end of the box, and the rest of the box not print until it finishes the print for the typewriter text. submitted by /u/Twigzywik [link] [comments]

Read more

Make a global venv in uv? Use numpy from anywhere? /u/Informal-Addendum435 Python Education

Make a global venv in uv? Use numpy from anywhere? /u/Informal-Addendum435 Python Education

I have a dream that one day I will be able to uv run python in any directory and have numpy available in the REPL.

How can I achieve that?

I would imagine uv run --venv=numpy python would be cool

submitted by /u/Informal-Addendum435
[link] [comments]

​r/learnpython I have a dream that one day I will be able to uv run python in any directory and have numpy available in the REPL. How can I achieve that? I would imagine uv run –venv=numpy python would be cool submitted by /u/Informal-Addendum435 [link] [comments] 

I have a dream that one day I will be able to uv run python in any directory and have numpy available in the REPL.

How can I achieve that?

I would imagine uv run --venv=numpy python would be cool

submitted by /u/Informal-Addendum435
[link] [comments]  I have a dream that one day I will be able to uv run python in any directory and have numpy available in the REPL. How can I achieve that? I would imagine uv run –venv=numpy python would be cool submitted by /u/Informal-Addendum435 [link] [comments]

Read more

Slider Position Resets After Song Playback and Manual Update in Music Player App (Pygame + Tkinter) /u/PFG_Gamer Python Education

Slider Position Resets After Song Playback and Manual Update in Music Player App (Pygame + Tkinter) /u/PFG_Gamer Python Education

I was making an music app player and was trying to implement a function where the user can seek forward or backward using the seekbar. Whenever I tried to click anywhere on the seekbar, my music position would change according to the value of the seekbar where I clicked. But the seekbar starts back from 0 whenever I try to skip in the song. How to fix this? The below one is my code.(Ignore the format, I am not much experienced python developer)

import io from pygame import mixer from mutagen.mp3 import MP3 # Variables current_song = "songs/middle_of_night.mp3" has_song_started = False is_song_playing = False is_slider_dragging = False # Get the current song length audio = MP3(current_song) total_duration = audio.info.length # Programming Code mixer.init() mixer.music.load(current_song) def play_song(): global has_song_started global is_song_playing mixer.music.play() has_song_started = True is_song_playing = True def pause(): global is_song_playing mixer.music.pause() is_song_playing = False def resume(): global is_song_playing mixer.music.unpause() is_song_playing = True def playback_slider_event(value): global total_duration music_pos = (float(value)/100)*total_duration music_pos = music_pos * 1000 print(f"value = {value}") print(f"music_pos = {music_pos}") # mixer.music.stop() # mixer.music.play(start=music_pos/1000) mixer.music.set_pos(music_pos/1000) # print(f"percentage = {percentage}") slider.set(value) # GUI slider = ctk.CTkSlider(home, from_=0, to=100, command=playback_slider_event, width=600) slider.pack(pady=30) # Add padding around the slider # Programming Code def set_playback_slider(): global is_slider_dragging if not is_slider_dragging: current_position = mixer.music.get_pos()/1000 percentage = (current_position/total_duration)*100 print(percentage) slider.set(percentage) app.after(1000, set_playback_slider) def slider_drag_start(event): global is_slider_dragging is_slider_dragging = True def slider_drag_end(event): global is_slider_dragging is_slider_dragging = False # Bind the slider drag events slider.bind("<ButtonPress-1>", slider_drag_start) # When slider dragging starts slider.bind("<ButtonRelease-1>", slider_drag_end) # When slider dragging ends change_play_button_command() set_playback_slider() app.mainloop() 

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

​r/learnpython I was making an music app player and was trying to implement a function where the user can seek forward or backward using the seekbar. Whenever I tried to click anywhere on the seekbar, my music position would change according to the value of the seekbar where I clicked. But the seekbar starts back from 0 whenever I try to skip in the song. How to fix this? The below one is my code.(Ignore the format, I am not much experienced python developer) import io from pygame import mixer from mutagen.mp3 import MP3 # Variables current_song = “songs/middle_of_night.mp3″ has_song_started = False is_song_playing = False is_slider_dragging = False # Get the current song length audio = MP3(current_song) total_duration = audio.info.length # Programming Code mixer.init() mixer.music.load(current_song) def play_song(): global has_song_started global is_song_playing mixer.music.play() has_song_started = True is_song_playing = True def pause(): global is_song_playing mixer.music.pause() is_song_playing = False def resume(): global is_song_playing mixer.music.unpause() is_song_playing = True def playback_slider_event(value): global total_duration music_pos = (float(value)/100)*total_duration music_pos = music_pos * 1000 print(f”value = {value}”) print(f”music_pos = {music_pos}”) # mixer.music.stop() # mixer.music.play(start=music_pos/1000) mixer.music.set_pos(music_pos/1000) # print(f”percentage = {percentage}”) slider.set(value) # GUI slider = ctk.CTkSlider(home, from_=0, to=100, command=playback_slider_event, width=600) slider.pack(pady=30) # Add padding around the slider # Programming Code def set_playback_slider(): global is_slider_dragging if not is_slider_dragging: current_position = mixer.music.get_pos()/1000 percentage = (current_position/total_duration)*100 print(percentage) slider.set(percentage) app.after(1000, set_playback_slider) def slider_drag_start(event): global is_slider_dragging is_slider_dragging = True def slider_drag_end(event): global is_slider_dragging is_slider_dragging = False # Bind the slider drag events slider.bind(“<ButtonPress-1>”, slider_drag_start) # When slider dragging starts slider.bind(“<ButtonRelease-1>”, slider_drag_end) # When slider dragging ends change_play_button_command() set_playback_slider() app.mainloop() submitted by /u/PFG_Gamer [link] [comments] 

I was making an music app player and was trying to implement a function where the user can seek forward or backward using the seekbar. Whenever I tried to click anywhere on the seekbar, my music position would change according to the value of the seekbar where I clicked. But the seekbar starts back from 0 whenever I try to skip in the song. How to fix this? The below one is my code.(Ignore the format, I am not much experienced python developer)

import io from pygame import mixer from mutagen.mp3 import MP3 # Variables current_song = "songs/middle_of_night.mp3" has_song_started = False is_song_playing = False is_slider_dragging = False # Get the current song length audio = MP3(current_song) total_duration = audio.info.length # Programming Code mixer.init() mixer.music.load(current_song) def play_song(): global has_song_started global is_song_playing mixer.music.play() has_song_started = True is_song_playing = True def pause(): global is_song_playing mixer.music.pause() is_song_playing = False def resume(): global is_song_playing mixer.music.unpause() is_song_playing = True def playback_slider_event(value): global total_duration music_pos = (float(value)/100)*total_duration music_pos = music_pos * 1000 print(f"value = {value}") print(f"music_pos = {music_pos}") # mixer.music.stop() # mixer.music.play(start=music_pos/1000) mixer.music.set_pos(music_pos/1000) # print(f"percentage = {percentage}") slider.set(value) # GUI slider = ctk.CTkSlider(home, from_=0, to=100, command=playback_slider_event, width=600) slider.pack(pady=30) # Add padding around the slider # Programming Code def set_playback_slider(): global is_slider_dragging if not is_slider_dragging: current_position = mixer.music.get_pos()/1000 percentage = (current_position/total_duration)*100 print(percentage) slider.set(percentage) app.after(1000, set_playback_slider) def slider_drag_start(event): global is_slider_dragging is_slider_dragging = True def slider_drag_end(event): global is_slider_dragging is_slider_dragging = False # Bind the slider drag events slider.bind("<ButtonPress-1>", slider_drag_start) # When slider dragging starts slider.bind("<ButtonRelease-1>", slider_drag_end) # When slider dragging ends change_play_button_command() set_playback_slider() app.mainloop() 

submitted by /u/PFG_Gamer
[link] [comments]  I was making an music app player and was trying to implement a function where the user can seek forward or backward using the seekbar. Whenever I tried to click anywhere on the seekbar, my music position would change according to the value of the seekbar where I clicked. But the seekbar starts back from 0 whenever I try to skip in the song. How to fix this? The below one is my code.(Ignore the format, I am not much experienced python developer) import io from pygame import mixer from mutagen.mp3 import MP3 # Variables current_song = “songs/middle_of_night.mp3″ has_song_started = False is_song_playing = False is_slider_dragging = False # Get the current song length audio = MP3(current_song) total_duration = audio.info.length # Programming Code mixer.init() mixer.music.load(current_song) def play_song(): global has_song_started global is_song_playing mixer.music.play() has_song_started = True is_song_playing = True def pause(): global is_song_playing mixer.music.pause() is_song_playing = False def resume(): global is_song_playing mixer.music.unpause() is_song_playing = True def playback_slider_event(value): global total_duration music_pos = (float(value)/100)*total_duration music_pos = music_pos * 1000 print(f”value = {value}”) print(f”music_pos = {music_pos}”) # mixer.music.stop() # mixer.music.play(start=music_pos/1000) mixer.music.set_pos(music_pos/1000) # print(f”percentage = {percentage}”) slider.set(value) # GUI slider = ctk.CTkSlider(home, from_=0, to=100, command=playback_slider_event, width=600) slider.pack(pady=30) # Add padding around the slider # Programming Code def set_playback_slider(): global is_slider_dragging if not is_slider_dragging: current_position = mixer.music.get_pos()/1000 percentage = (current_position/total_duration)*100 print(percentage) slider.set(percentage) app.after(1000, set_playback_slider) def slider_drag_start(event): global is_slider_dragging is_slider_dragging = True def slider_drag_end(event): global is_slider_dragging is_slider_dragging = False # Bind the slider drag events slider.bind(“<ButtonPress-1>”, slider_drag_start) # When slider dragging starts slider.bind(“<ButtonRelease-1>”, slider_drag_end) # When slider dragging ends change_play_button_command() set_playback_slider() app.mainloop() submitted by /u/PFG_Gamer [link] [comments]

Read more

Conda environment created with –prefix has issues with PYTHONHOME on linux computing cluster /u/jaaxk122 Python Education

Conda environment created with –prefix has issues with PYTHONHOME on linux computing cluster /u/jaaxk122 Python Education

I’m on my universities HPC cluster and I ran out of disk space in my home directory, so I made an environment in my scratch space using the command:

`conda env create –prefix ./comebin_env –file comebin_env.yml

pip install torch==1.12.1+cu113 –extra-index-url https://download.pytorch.org/whl/cu113`

Right after creating the environment, I activate it and my program runs successfully. When I close my shell and open it back up the next day, I can activate the environment successfully with:

`conda activate /gpfs/scratch/jvaska/COMEBIN/environments/comebin_env`

But when I try to run my program I get the error:

`Could not find platform independent libraries <prefix>

Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]`

and the program fails to run.

Additionally, when I try `python –version`, I get the same error, but it gives me the version:

`(/gpfs/scratch/jvaska/COMEBin/environments/comebin_env) [jvaska@login1 .conda]$ python –version

Could not find platform independent libraries <prefix>

Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]

Python 3.7.12`

I’ve tried setting PYTHONHOME to `/gpfs/scratch/jvaska/COMEBin/environments/comebin_env`

But when I run the program I get some other error about encodings. When trying to fix that by upgrading encodings I get this error:

`pip install –upgrade –force-reinstall –no-cache-dir encodings`

Could not find platform independent libraries <prefix>

Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]

Fatal Python error: initfsencoding: Unable to get the locale encoding

LookupError: no codec search functions registered: can’t find encoding

Current thread 0x00002aaaaaaf2ec0 (most recent call first):

Aborted (core dumped)

Here is my conda info:

`(/gpfs/scratch/jvaska/COMEBin/environments/comebin_env) [jvaska@login1 .conda]$ conda info`

` active environment : /gpfs/scratch/jvaska/COMEBin/environments/comebin_env

active env location : /gpfs/scratch/jvaska/COMEBin/environments/comebin_env

shell level : 2

user config file : /gpfs/home/jvaska/.condarc

populated config files : /gpfs/home/jvaska/.condarc

conda version : 24.5.0

conda-build version : 3.27.0

python version : 3.10.12.final.0

solver : libmamba (default)

virtual packages : __archspec=1=haswell

__conda=24.5.0=0

__glibc=2.17=0

__linux=3.10.0=0

__unix=0=0

base environment : /gpfs/software/Anaconda (read only)

conda av data dir : /gpfs/software/Anaconda/etc/conda

conda av metadata url : None

channel URLs : https://repo.anaconda.com/pkgs/main/linux-64

https://repo.anaconda.com/pkgs/main/noarch

https://repo.anaconda.com/pkgs/r/linux-64

https://repo.anaconda.com/pkgs/r/noarch

package cache : /gpfs/home/jvaska/.conda/packages

/gpfs/home/jvaska/.conda

envs directories : /gpfs/home/jvaska/.conda/envs

/gpfs/software/Anaconda/envs

platform : linux-64

user-agent : conda/24.5.0 requests/2.31.0 CPython/3.10.12 Linux/3.10.0-1160.81.1.el7.x86_64 centos/7.9.2009 glibc/2.17 solver/libmamba conda-libmamba-solver/23.11.1 libmambapy/1.5.4

UID:GID : 113236684:113236684

netrc file : None

offline mode : False`

Again, I’m on a cluster and loaded conda using module load anaconda/3.

My home conda directory is /gpfs/home/jvaska/.conda, where in environments.txt, /gpfs/scratch/jvaska/COMEBin/environments/comebin_env exists.

I’m new to conda and environments and this is my first time posting on stackoverflow, anything helps thank you!

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

​r/learnpython I’m on my universities HPC cluster and I ran out of disk space in my home directory, so I made an environment in my scratch space using the command: `conda env create –prefix ./comebin_env –file comebin_env.yml pip install torch==1.12.1+cu113 –extra-index-url https://download.pytorch.org/whl/cu113` Right after creating the environment, I activate it and my program runs successfully. When I close my shell and open it back up the next day, I can activate the environment successfully with: `conda activate /gpfs/scratch/jvaska/COMEBIN/environments/comebin_env` But when I try to run my program I get the error: `Could not find platform independent libraries <prefix> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]` and the program fails to run. Additionally, when I try `python –version`, I get the same error, but it gives me the version: `(/gpfs/scratch/jvaska/COMEBin/environments/comebin_env) [jvaska@login1 .conda]$ python –version Could not find platform independent libraries <prefix> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] Python 3.7.12` I’ve tried setting PYTHONHOME to `/gpfs/scratch/jvaska/COMEBin/environments/comebin_env` But when I run the program I get some other error about encodings. When trying to fix that by upgrading encodings I get this error: `pip install –upgrade –force-reinstall –no-cache-dir encodings` Could not find platform independent libraries <prefix> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] Fatal Python error: initfsencoding: Unable to get the locale encoding LookupError: no codec search functions registered: can’t find encoding Current thread 0x00002aaaaaaf2ec0 (most recent call first): Aborted (core dumped) Here is my conda info: `(/gpfs/scratch/jvaska/COMEBin/environments/comebin_env) [jvaska@login1 .conda]$ conda info` ` active environment : /gpfs/scratch/jvaska/COMEBin/environments/comebin_env active env location : /gpfs/scratch/jvaska/COMEBin/environments/comebin_env shell level : 2 user config file : /gpfs/home/jvaska/.condarc populated config files : /gpfs/home/jvaska/.condarc conda version : 24.5.0 conda-build version : 3.27.0 python version : 3.10.12.final.0 solver : libmamba (default) virtual packages : __archspec=1=haswell __conda=24.5.0=0 __glibc=2.17=0 __linux=3.10.0=0 __unix=0=0 base environment : /gpfs/software/Anaconda (read only) conda av data dir : /gpfs/software/Anaconda/etc/conda conda av metadata url : None channel URLs : https://repo.anaconda.com/pkgs/main/linux-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/linux-64 https://repo.anaconda.com/pkgs/r/noarch package cache : /gpfs/home/jvaska/.conda/packages /gpfs/home/jvaska/.conda envs directories : /gpfs/home/jvaska/.conda/envs /gpfs/software/Anaconda/envs platform : linux-64 user-agent : conda/24.5.0 requests/2.31.0 CPython/3.10.12 Linux/3.10.0-1160.81.1.el7.x86_64 centos/7.9.2009 glibc/2.17 solver/libmamba conda-libmamba-solver/23.11.1 libmambapy/1.5.4 UID:GID : 113236684:113236684 netrc file : None offline mode : False` Again, I’m on a cluster and loaded conda using module load anaconda/3. My home conda directory is /gpfs/home/jvaska/.conda, where in environments.txt, /gpfs/scratch/jvaska/COMEBin/environments/comebin_env exists. I’m new to conda and environments and this is my first time posting on stackoverflow, anything helps thank you! submitted by /u/jaaxk122 [link] [comments] 

I’m on my universities HPC cluster and I ran out of disk space in my home directory, so I made an environment in my scratch space using the command:

`conda env create –prefix ./comebin_env –file comebin_env.yml

pip install torch==1.12.1+cu113 –extra-index-url https://download.pytorch.org/whl/cu113`

Right after creating the environment, I activate it and my program runs successfully. When I close my shell and open it back up the next day, I can activate the environment successfully with:

`conda activate /gpfs/scratch/jvaska/COMEBIN/environments/comebin_env`

But when I try to run my program I get the error:

`Could not find platform independent libraries <prefix>

Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]`

and the program fails to run.

Additionally, when I try `python –version`, I get the same error, but it gives me the version:

`(/gpfs/scratch/jvaska/COMEBin/environments/comebin_env) [jvaska@login1 .conda]$ python –version

Could not find platform independent libraries <prefix>

Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]

Python 3.7.12`

I’ve tried setting PYTHONHOME to `/gpfs/scratch/jvaska/COMEBin/environments/comebin_env`

But when I run the program I get some other error about encodings. When trying to fix that by upgrading encodings I get this error:

`pip install –upgrade –force-reinstall –no-cache-dir encodings`

Could not find platform independent libraries <prefix>

Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]

Fatal Python error: initfsencoding: Unable to get the locale encoding

LookupError: no codec search functions registered: can’t find encoding

Current thread 0x00002aaaaaaf2ec0 (most recent call first):

Aborted (core dumped)

Here is my conda info:

`(/gpfs/scratch/jvaska/COMEBin/environments/comebin_env) [jvaska@login1 .conda]$ conda info`

` active environment : /gpfs/scratch/jvaska/COMEBin/environments/comebin_env

active env location : /gpfs/scratch/jvaska/COMEBin/environments/comebin_env

shell level : 2

user config file : /gpfs/home/jvaska/.condarc

populated config files : /gpfs/home/jvaska/.condarc

conda version : 24.5.0

conda-build version : 3.27.0

python version : 3.10.12.final.0

solver : libmamba (default)

virtual packages : __archspec=1=haswell

__conda=24.5.0=0

__glibc=2.17=0

__linux=3.10.0=0

__unix=0=0

base environment : /gpfs/software/Anaconda (read only)

conda av data dir : /gpfs/software/Anaconda/etc/conda

conda av metadata url : None

channel URLs : https://repo.anaconda.com/pkgs/main/linux-64

https://repo.anaconda.com/pkgs/main/noarch

https://repo.anaconda.com/pkgs/r/linux-64

https://repo.anaconda.com/pkgs/r/noarch

package cache : /gpfs/home/jvaska/.conda/packages

/gpfs/home/jvaska/.conda

envs directories : /gpfs/home/jvaska/.conda/envs

/gpfs/software/Anaconda/envs

platform : linux-64

user-agent : conda/24.5.0 requests/2.31.0 CPython/3.10.12 Linux/3.10.0-1160.81.1.el7.x86_64 centos/7.9.2009 glibc/2.17 solver/libmamba conda-libmamba-solver/23.11.1 libmambapy/1.5.4

UID:GID : 113236684:113236684

netrc file : None

offline mode : False`

Again, I’m on a cluster and loaded conda using module load anaconda/3.

My home conda directory is /gpfs/home/jvaska/.conda, where in environments.txt, /gpfs/scratch/jvaska/COMEBin/environments/comebin_env exists.

I’m new to conda and environments and this is my first time posting on stackoverflow, anything helps thank you!

submitted by /u/jaaxk122
[link] [comments]  I’m on my universities HPC cluster and I ran out of disk space in my home directory, so I made an environment in my scratch space using the command: `conda env create –prefix ./comebin_env –file comebin_env.yml pip install torch==1.12.1+cu113 –extra-index-url https://download.pytorch.org/whl/cu113` Right after creating the environment, I activate it and my program runs successfully. When I close my shell and open it back up the next day, I can activate the environment successfully with: `conda activate /gpfs/scratch/jvaska/COMEBIN/environments/comebin_env` But when I try to run my program I get the error: `Could not find platform independent libraries <prefix> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]` and the program fails to run. Additionally, when I try `python –version`, I get the same error, but it gives me the version: `(/gpfs/scratch/jvaska/COMEBin/environments/comebin_env) [jvaska@login1 .conda]$ python –version Could not find platform independent libraries <prefix> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] Python 3.7.12` I’ve tried setting PYTHONHOME to `/gpfs/scratch/jvaska/COMEBin/environments/comebin_env` But when I run the program I get some other error about encodings. When trying to fix that by upgrading encodings I get this error: `pip install –upgrade –force-reinstall –no-cache-dir encodings` Could not find platform independent libraries <prefix> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] Fatal Python error: initfsencoding: Unable to get the locale encoding LookupError: no codec search functions registered: can’t find encoding Current thread 0x00002aaaaaaf2ec0 (most recent call first): Aborted (core dumped) Here is my conda info: `(/gpfs/scratch/jvaska/COMEBin/environments/comebin_env) [jvaska@login1 .conda]$ conda info` ` active environment : /gpfs/scratch/jvaska/COMEBin/environments/comebin_env active env location : /gpfs/scratch/jvaska/COMEBin/environments/comebin_env shell level : 2 user config file : /gpfs/home/jvaska/.condarc populated config files : /gpfs/home/jvaska/.condarc conda version : 24.5.0 conda-build version : 3.27.0 python version : 3.10.12.final.0 solver : libmamba (default) virtual packages : __archspec=1=haswell __conda=24.5.0=0 __glibc=2.17=0 __linux=3.10.0=0 __unix=0=0 base environment : /gpfs/software/Anaconda (read only) conda av data dir : /gpfs/software/Anaconda/etc/conda conda av metadata url : None channel URLs : https://repo.anaconda.com/pkgs/main/linux-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/linux-64 https://repo.anaconda.com/pkgs/r/noarch package cache : /gpfs/home/jvaska/.conda/packages /gpfs/home/jvaska/.conda envs directories : /gpfs/home/jvaska/.conda/envs /gpfs/software/Anaconda/envs platform : linux-64 user-agent : conda/24.5.0 requests/2.31.0 CPython/3.10.12 Linux/3.10.0-1160.81.1.el7.x86_64 centos/7.9.2009 glibc/2.17 solver/libmamba conda-libmamba-solver/23.11.1 libmambapy/1.5.4 UID:GID : 113236684:113236684 netrc file : None offline mode : False` Again, I’m on a cluster and loaded conda using module load anaconda/3. My home conda directory is /gpfs/home/jvaska/.conda, where in environments.txt, /gpfs/scratch/jvaska/COMEBin/environments/comebin_env exists. I’m new to conda and environments and this is my first time posting on stackoverflow, anything helps thank you! submitted by /u/jaaxk122 [link] [comments]

Read more

3×3 rubiks cube python solver with no libraries but math /u/Specific-Second-9505 Python Education

3×3 rubiks cube python solver with no libraries but math /u/Specific-Second-9505 Python Education

i want a python code that can solve a 3×3 rubiks cube and you enter your 3×3 cube combination so the code solves it. i want to use no libraries/modules, only math, and i want it to use onli one file. is that possible?

submitted by /u/Specific-Second-9505
[link] [comments]

​r/learnpython i want a python code that can solve a 3×3 rubiks cube and you enter your 3×3 cube combination so the code solves it. i want to use no libraries/modules, only math, and i want it to use onli one file. is that possible? submitted by /u/Specific-Second-9505 [link] [comments] 

i want a python code that can solve a 3×3 rubiks cube and you enter your 3×3 cube combination so the code solves it. i want to use no libraries/modules, only math, and i want it to use onli one file. is that possible?

submitted by /u/Specific-Second-9505
[link] [comments]  i want a python code that can solve a 3×3 rubiks cube and you enter your 3×3 cube combination so the code solves it. i want to use no libraries/modules, only math, and i want it to use onli one file. is that possible? submitted by /u/Specific-Second-9505 [link] [comments]

Read more