#๐Ÿ”’ Help with ubuntu terminal (installing pip and PIL)

351 messages ยท Page 1 of 1 (latest)

north peakBOT
#

@rich delta

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

mellow eagle
#

What is the main issue the script is having?

stone condor
#

I'm pretty sure pip comes default, what happens when you just type pip and hit enter?

rich delta
#

what do you mean?

stone condor
#

Try python3 -m pip

#

It may just not be in your path

rich delta
#

says: "/usr/bin/python3: No module named pip"

#

is this because im using this from wsl?

#

like i went into powershell and typed wsl

#

bc of some course i needed it for

stone condor
#

One of these methods should work for you

rich delta
#

did i do this right?:

#

is something wrong with my PC?

stone condor
#

python3 is the name for the interpreter you're looking for

#

Not python

rich delta
#

hmm okay

stone condor
#

python3 -m ensurepip --upgrade

rich delta
#

?????

#

is it because of wsl

stone condor
#

Very strange

rich delta
#

yes i know

#

nothign works on it

stone condor
#

The other method may work

rich delta
#

i tried every single one.

stone condor
#

python3 get-pip.py

rich delta
#

nope.

#

smthg like "cant open file"

#

what do i do???

stone condor
rich delta
#

no

#

i dont think so or remember so

#

how to do that

#

and what about PIL?

stone condor
#

You need to download it from the link on that page I sent earlier

#

PIL will be installed by pip

#

pip install pillow iirc

rich delta
#

๐Ÿ˜ญ

#

should we bring others into this

#

we need backup

#

my PC is too dumb

stone condor
#

You now need to get the path to that file

#

Shift right click the file in your Explorer and hit copy as path

#

Then do python3 <ctrl+v to paste the path>

rich delta
#

i cpied as path,

#

now i go into terminal and write...???

#

oh i underwstand

#

tried withought quotes

dusk dust
#

That'd be because wsl wants unix style paths

#

rather than windows style paths

stone condor
#

Yeah that's a wsl issue

rich delta
#

so i cant do my course directly because of wsl?

dusk dust
#

python3 /mnt/c/Users/olgaw/Downloads/pip.pyz

#

That's probably the command you want

rich delta
#

ahh it worked

dusk dust
#

yep

rich delta
#

thx

stone condor
#

W

rich delta
#

but will this interfere with the rest of my course?

#

like installing stuff

dusk dust
#

idk man what is your course?

rich delta
#

and writing ubuntu programs

#

um lemme show u

stone condor
#

Wsl has limitations related to networking

rich delta
#

Using Python to Interact with the Operating System

#

thats its name

stone condor
#

As long as you're not playing with sockets on wsl1 or network interfaces on wsl2 you're good

dusk dust
#

probably should be fine

rich delta
#

okay thank u so much

#

u gusy r W

dusk dust
#

You could always do a VM with an ubuntu install

rich delta
#

for wasting ur time with my dumb a**

dusk dust
#

or just an Ubuntu USB

rich delta
#

is there a linkon internet

dusk dust
#

that's relatively complicated

#

so dw about it ig

rich delta
#

alr thx so much

#

r u guys liek actual software engineers?

#

liek with a job?

dusk dust
#

I am

#

He's a cybersecurity guy

rich delta
#

'0'

#

who, the waterfall guy?

dusk dust
#

yeah

rich delta
#

oh

#

its my dream job tho

#

how did u get to it?

#

was it hard?

dusk dust
#

I just knew a guy

rich delta
#

hoh

dusk dust
#

He probably has better answers for you than "nepotism"

#

@stone condor

rich delta
#

oh

#

i dont have to worry about that yet

#

im only 13 ig

dusk dust
#

real

rich delta
#

but im just facing a lot of problems with coding and my stupe PC

stone condor
dusk dust
stone condor
#

Ikik

dusk dust
#

just the fact that I knew a guy who basically hired me because I knew him

#

but anyways

#

you probably have a better example for this kid

stone condor
#

The real networking

dusk dust
#

or like answer I mean

stone condor
#

Go to college ๐Ÿ‘

rich delta
#

um how to install PIL again?

#

pip install pillow aint working

stone condor
#

!pypi pillow

north peakBOT
stone condor
#

python3 -m pip install pillow

rich delta
#

no module named pip

#

it said

dusk dust
#

ain't no way

stone condor
#

What thr heck

dusk dust
#

alright we're gonna try pyenv

#

type curl

#

lemme know if that's installed

rich delta
#

it said:

#

curl: try 'curl --help' or 'curl --manual' for more information

dusk dust
#

okay good

#

run this

#

curl -fsSL https://pyenv.run | bash

rich delta
#

ok it worked

dusk dust
#

cool

rich delta
#

says i have to restart my shell thp

dusk dust
#

now try this

#
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init - bash)"' >> ~/.bashrc
rich delta
#

do i just x out>

dusk dust
#

not yet

#

run those first ^^

rich delta
#

nothing happened

dusk dust
#

good

#

now do

rich delta
#

also is that a form of PHP

dusk dust
#

source ~/.bashrc

dusk dust
rich delta
#

but it has echo

#

ok nothing happened

dusk dust
#

yeah that's bash syntax

#

good

#

one sec lemme google the build dependencies of python

rich delta
#

k

dusk dust
#

try uh

#

sudo apt-get build-dep python3

rich delta
#

mhm

#

Reading package lists... Done
E: You must put some 'deb-src' URIs in your sources.list

#

what now

dusk dust
#

ah okay

#

one min

#

that didn't work

#

but that's okay

rich delta
#

they made this difficult just bc life hates me

dusk dust
#

nah it's just some extra stuffs

#

we can try without it

rich delta
#

ive been at this for a total of 5 hrs by now

dusk dust
#

try pyenv install 3.11.5

rich delta
#

around 6 ppl already been hlpong me

dusk dust
#

if that doesn't work lemme know

rich delta
#

BUILD FAILED (Ubuntu 24.04 using python-build 20180424)

Inspect or clean up the working tree at /tmp/python-build.20250211201203.1082
Results logged to /tmp/python-build.20250211201203.1082.log

Last 10 log lines:
checking for pkg-config... no
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking MACHDEP... "linux"
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in /tmp/python-build.20250211201203.1082/Python-3.11.5': configure: error: no acceptable C compiler found in $PATH See config.log' for more details

#

um result

dusk dust
#

okay cool

#

type gcc

rich delta
#

Command 'gcc' not found, but can be installed with:
sudo apt install gcc

dusk dust
#

okay

#

yeah install that

rich delta
#

E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/g/glibc/libc-dev-bin_2.39-0ubuntu8.3_amd64.deb 404 Not Found [IP: 185.125.190.82 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/g/glibc/libc-devtools_2.39-0ubuntu8.3_amd64.deb 404 Not Found [IP: 185.125.190.82 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/l/linux/linux-libc-dev_6.8.0-51.52_amd64.deb 404 Not Found [IP: 185.125.190.82 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/g/glibc/libc6-dev_2.39-0ubuntu8.3_amd64.deb 404 Not Found [IP: 185.125.190.82 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

dusk dust
#

erm

#

try sudo apt update

rich delta
#

did i just give u my IP adress??

#

oh my

#

it worked

dusk dust
#

that's the ip of a datacenter in the UK

#

so probably not

#

now try the gcc install

#

actually

#

it's probably better to try to upgrade first

#

sudo apt upgrade -y

#

and then

#

sudo apt install gcc

rich delta
#

oh wierd things happening

#

um im still alive

dusk dust
#

not weird things

#

that's upgrading your ubuntu system

#

just updating packages

rich delta
#

it worked!!

dusk dust
#

cool

rich delta
#

was my apt really just outdated???

dusk dust
#

maybe

rich delta
dusk dust
#

there's a chance

#

lol don't expect me to be all smiles or something

#

๐Ÿ˜ญ

rich delta
#

oh ok im srry

dusk dust
#

I'm just trying to help you install python + pip

#

try pyenv install 3.11.5

rich delta
#

and then all the rest follows??

dusk dust
#

if it breaks again lmk

#

it probably will

dusk dust
rich delta
#

its installing python.11.5

#

but i alr have 12.7

dusk dust
#

yeah

#

that's fine

rich delta
#

ohk

#

wow ur smart

#

i wwant to be as knowledgable as u when I grow up

dusk dust
#

I have 3 python versions installed

rich delta
#

Installing Python-3.11.5...

BUILD FAILED (Ubuntu 24.04 using python-build 20180424)

Inspect or clean up the working tree at /tmp/python-build.20250211201636.5229
Results logged to /tmp/python-build.20250211201636.5229.log

Last 10 log lines:
config.status: creating pyconfig.h
configure: creating Modules/Setup.local
configure: creating Makefile
configure: WARNING: pkg-config is missing. Some dependencies may not be detected correctly.
configure:

If you want a release build with all stable optimizations active (PGO, etc),
please run ./configure --enable-optimizations

/home/yoni/.pyenv/plugins/python-build/bin/python-build: line 847: make: command not found

dusk dust
#

having multiple isn't a strange thing

#

okay so it's missing the build dependencies

rich delta
#

arrr

dusk dust
#

which means

#

im gonna write some commands

rich delta
#

nice

#

bro if it wasnt for this chat id alr be crying in my room

dusk dust
#
sudo echo "deb-src http://archive.ubuntu.com/ubuntu/ jammy main" >> /etc/apt/sources.list
#

try that

rich delta
#

thank goodness proffesionals r helping me

dusk dust
#

then

#

sudo apt-get update

rich delta
#

yoni@TheBigBoy:/mnt/c/Users/olgaw$ sudo echo "deb-src http://archive.ubuntu.com/ubuntu/ jammy main" >> /etc/apt/sources.list
-bash: /etc/apt/sources.list: Permission denied
yoni@TheBigBoy:/mnt/c/Users/olgaw$

dusk dust
#

fair enough

#

then uh ig you have to add it manually

#

deb-src http://archive.ubuntu.com/ubuntu/ jammy main

rich delta
#

oohno

dusk dust
#

put that at the end of the file

#

/etc/apt/sources.list

rich delta
#

wdym

dusk dust
#

you can use nano if yk how with sudo nano /etc/apt/sources.list

#

and just adding it at the end of the file and saving the file

rich delta
#

um

#

me no understand

#

i have monke brain

dusk dust
#

do sudo nano /etc/apt/sources.list

#

then go to the bottom of the file

#

and put this line in

#

deb-src http://archive.ubuntu.com/ubuntu/ jammy main

#

and to save and exit

#

do

#

control + x, then y, then enter

rich delta
dusk dust
#

yep

#

that's right

rich delta
#

now i put that thing at the bottom?

#

k

dusk dust
#

yes

#

this is arguably not the best way to do things but this is how I know how to do stuff

rich delta
#

and i do ctrl + s

dusk dust
#

yeah

#

that should save

#

then control + x to exit

rich delta
#

ok i did it

#

oh nice

dusk dust
#

just to make sure you should check the file again

#

by doing the nano command

rich delta
#

yeah its there

dusk dust
#

if the text is still there then just

#

exit with control x

#

once that's done

#

do

#

sudo apt-get update

#

then you can install build dependencies

#

with

rich delta
#

IT WORKED

dusk dust
#

sudo apt-get build-dep python3

rich delta
#

YOUNG BASS

dusk dust
#

sudo apt-get install pkg-config

#

those 2 commands

#

and it did say

#

if you want to build with all optional modules

#

you probably do

#

run this

rich delta
#

for the first one:

#

Reading package lists... Done
Picking 'python3-defaults' as source package instead of 'python3'
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
builddeps:python3-defaults : Depends: python3.10:any (>= 3.10.4-1~) but it is not installable
E: Unable to correct problems, you have held broken packages.

dusk dust
#
      libbz2-dev libffi-dev libgdbm-dev libgdbm-compat-dev liblzma-dev \
      libncurses5-dev libreadline6-dev libsqlite3-dev libssl-dev \
      lzma lzma-dev tk-dev uuid-dev zlib1g-dev libmpdec-dev```
dusk dust
#

idk

#

it thinks your packages are broken

#

and weird

#

but just ignore it ig

rich delta
#

ok second one worked

#

now to do big paragraph

dusk dust
#

okay

rich delta
#

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'libncurses-dev' instead of 'libncurses5-dev'
Note, selecting 'libreadline-dev' instead of 'libreadline6-dev'
E: Unable to locate package libmpdec-dev

#

um error?

dusk dust
#

this is fine

#

did it install the rest?

rich delta
#

thats all it wrote

dusk dust
#

remove the last thing from the line then

#
      libbz2-dev libffi-dev libgdbm-dev libgdbm-compat-dev liblzma-dev \
      libncurses5-dev libreadline6-dev libsqlite3-dev libssl-dev \
      lzma lzma-dev tk-dev uuid-dev zlib1g-dev```
#

so that instead

rich delta
#

lots of big message going in ma monke brain

dusk dust
#

that's fine

rich delta
#

i think it worked

dusk dust
#

okay cool

#

now try

#

pyenv install 3.11.5

rich delta
#

its working....

dusk dust
#

yep

#

should think for a bit

rich delta
#

its loading...

#

thank u for wasting ur time on me

dusk dust
#

because I didn't have you do the version that floods your terminal with text

#

lol

rich delta
#

um im very thankful

#

thx ig

dusk dust
#

no problem

rich delta
#

i cant rlly reward u

dusk dust
#

did it install?

rich delta
#

cuz im poor af

#

yup it worked

dusk dust
#

okay try

#

pyenv shell 3.11.5

#

and then do

#

pip install pillow

rich delta
#

IT BE WORKING

dusk dust
#

just make sure you swap to that shell before running any code

rich delta
dusk dust
#

with pyenv shell 3.11.5

#

nice

#

should be all fixed then

rich delta
#

should i run the pip install?

dusk dust
#

if you want to

rich delta
#

wow

#

after 6-7hrs

#

ITS FINALLY FIXED

#

thank u so much]

dusk dust
#

I like pyenv because it allows for easy management of multiple python versions

rich delta
#

if it breaks im only taking ur advice from now on

dusk dust
#

but yeah you're welcome

#

lol

rich delta
#

ima go watch yt now

#

im exaughsted

#

oh no

dusk dust
#

have fun

#

you should close this help thing

rich delta
#

wait i still have to do math ๐Ÿ˜ญ

dusk dust
#

if your stuff is all good

rich delta
#

ok thx by

north peakBOT
#
Python help channel closed using Discord native close action

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.