pip install error

November 11, 2023, 11:23

coshi75

yes

k9t33n

do I have to put my python code in the venv?

k9t33n

because it's installed but it's still saying the module does not exist and stuff

coshi75

a ok

k9t33n

btw thanks you so much for helping me, after a couple hours im finally getting somewhere

k9t33n

say the path to my python file is media/kameron/Agag-E2P0/projects/, how would i put the venv in that file?

k9t33n

<@1073697879832674344>?

coshi75

whea

coshi75

?

k9t33n

wait what are you asking?

k9t33n

<@1057521181470752768> do you know?

k9t33n

I just realy want to get this sorted by the end of the weakened so I can finally finish this project

imthebean

i think what i did to resolve this was redownloading piOS onto the sdcard

k9t33n

I promised myself I will get it sorted by tomorrow and I'm starting to get worried I won't meet that

imthebean

backwards law it brother

k9t33n

but I feel so close with venv

imthebean

wait so gimme some context rq

k9t33n

because it's working the pip install, I just need to put it in the same file as the code

k9t33n

im so sorry <@152978092174999553> 😭

imthebean

it’s ok 😎 i was very confused but appreciate the random mention! good luck jimmy 🫡

imthebean

worst case scenario, backup ur files onto usb or sum & reinstall piOS, i think she should potentially work off the bat

k9t33n

but yes, I just want to try out venv first because I feel so close

imthebean

LMAO yeah funny how the universe works like that, what a Jimmy

imthebean

i believe in u, keep it pushing jonathan

k9t33n

wait why are you calling me Jimmy and Jonathan?

k9t33n

ok i give up

k9t33n

how would I go back to the old version?

k9t33n

where I don't have to use venv <@808278006614196262>

k9t33n

because you are the one who suggested it

k9t33n

you suggested to go back to the old os

k9t33n

how would I do that? can I use a command? or do I have to reflash the SD card

k9t33n

or if I can get rid of the venv stuff without going back to the old os then that

k9t33n

ok I tried the venv one which does pip install correctly, but it seems like it's not in the same file as my python file

k9t33n

I tried putting the venv in the same path as the python but that didn't work

k9t33n

and what will the break system packages one do?

k9t33n

I will try that when I get home

k9t33n

like it's not in the same folder

null

I have no idea about these venv. You just have to install the OS.

k9t33n

if I give up with the stuff miablo said, would I use "legacy os" in the imager?

k9t33n

or something else?

null

If it is the OS it was running on before, yes. Otherwise you'll have to see what other OSes it might run on.

k9t33n

ok

k9t33n

yes that's how I've used it

miabl0

k9t33n

but either way whatever it does when I activate the venv I can pip install stuff but when I use python python files it acts like I've just done nothing

miabl0

what does python put out when you run your script?

k9t33n

when i make the venv I try it makes a file in the file manager and I tried to put the python file in this but that didn't work

miabl0

where are you running your python file from? this is how to use a venv:
bash
source ~/venv/bin/activate
python yourscript.py
you first activate your venv using the source command, you should see the name (venv) in your terminal before the path and all that. Now, you run your python script from that terminal.

k9t33n

I will try that

miabl0

were you running it from the file manager?

k9t33n

also what will
pip install --break-system-packages spherov2
do?

k9t33n

thanks for all the help btw

miabl0

it will install the package spherov2, as a pip package. the reason why it asks you to specify "break system packages" is because this installs this python package with something other than apt. Most mayor linux distros are trying to move away from a need for pip, many of the python packages are now available in the package manager (for raspberryOs thats apt). This is generally the case since it makes maintenance a lot easier. Sysadmins only need to run apt-get update && apt-get upgrade, instead of also having to update packages via pip. Programs may rely on the fact that python libraries are at a specific version, so if you were to install something newer or older via pip, it could potentially break your system. But for this package, that's probably not the case, since spherov2 is not all that relevant to your system running.

k9t33n

so if i want to install a package that doesn't do anything to the os too much I can just use break packages to be simple?

k9t33n

ok give me the command now

k9t33n

like for venv stuff I forgot it

k9t33n

actually ill just scroll up

miabl0

just open your terminal, change the directory to whatever path you have your python script in, and run it using the commands i showed you earlier

miabl0

ye

miabl0

good luck

miabl0

lol

k9t33n

thanks

k9t33n

I'll have to do it in maybe 45 mins something popped up

k9t33n

is there a way to see what my files called using ssh if I know where the file is?

k9t33n

I forgot what I named the python file

k9t33n

ok I found it

k9t33n

but I get this error -bash: /home/kameron/venv/bin/activate: No such file or directory

null

Indicates that the directory activate or the file activate does not exist in the directory /home/kameron/venv/bin. Why don't you make a ls /home/kameron/venv/bin And see what it shows you

k9t33n

ok will do

k9t33n

I get the same thing

k9t33n

oh I think I know why

k9t33n

the python script is on an external usb stick, would that make a difference?

k9t33n

no that's not it, I moved it over to the correct file on the micro SD card and it didn't make a difference

null

Which directories exist at all? ls /home/ ls /home/kameron/ ls /home/kameron/venv/ Which directories/files does it need?

k9t33n

what do you mean?

k9t33n

the python file exists in home/kameron, I also tried to put it in /home/Kameron/venv and home/Kameron/venv/bin

k9t33n

I'm trying the break packages one

k9t33n

nope that doesn't work

k9t33n

nevermind it's working

k9t33n

<@967682983966437416> thank you so much!