#๐Ÿ”’ pip does not work on ubuntu VM

87 messages ยท Page 1 of 1 (latest)

dense hedgeBOT
#

@nimble rover

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.

calm pilot
#

try with --user

#

or create a virtualenv

#

can you be any less specific than "doesn't work"

#

how about pasting the output

#

whatever works

#

put --user before whatever you're trying to install

#

and you probably wanted -r requirements.txt

#

ok, a virtualenv it is then

#

I think on ubuntu you'll need python3-venv or similar package installed first

#

it will probably tell you if you try python3 -m venv virtualenv

#

then activate it: source virtualenv/bin/activate

#

then pip install -r requirements.txt

humble flicker
#

my guess: your requirements specify a very old version of something

#

can you paste that file?

#

---> as text, not a screenshot <---

calm pilot
#

this importerror is from pip though

humble flicker
#

what version of Ubuntu?

calm pilot
#

distutils wasn't removed from Python until 3.13 though, so I wonder what's going on

#

or was it already removed in 3.12

#

oh right, it was

humble flicker
#

I've reproduced the problem

#

I shall now commence scratching my head

calm pilot
humble flicker
#

well I can get past the problem, but it then fails with another problem. In the active virtualenv, I did pip install setuptools, and then retried pip install -r requirements.txt; now it dies with some other error

calm pilot
#

can you verify the pip version with pip --version ?

simple gate
#

Possibly you don't have python3-venv

calm pilot
#

@nimble rover ok, try again now please

#

with installing the requirements

#

wtf...

#

just to be sure can you pastebin it, yes?

simple gate
#

Can you show the command you ran and the full output, not just the stack trace

calm pilot
#

maybe an old setuptools is the issue here

#

pip freeze | grep setuptools - what does this give you?

#

where is that setuptools coming from then I wonder

simple gate
#

No in the paste

calm pilot
#

?

simple gate
calm pilot
#

but if it was it should be visible in pip freeze

#

and the virtualenv would be isolated from the system

simple gate
#

It's coming from pip-build-env-v4sfctll

calm pilot
#

and what is that

simple gate
#

So some package is asking for an old setuptools?

calm pilot
#

that was my theory too

#

@nimble rover could you try starting to install the requirements from your list one by one?

#

so we can pinpoint the culprit

simple gate
#

We need the full input and output from your terminal session

calm pilot
#

wait, some requirements did install? I don't think you ever mentioned that

#

I was under the impression that nothing worked

simple gate
#

I suspect it's been censored from the terminal output

#

Please post the full uncensored input and output

calm pilot
#

no, only the traceback was in the pastebin

simple gate
#

Please select all the terminal session, from the prompt that you ran to the next prompt asking for another command and paste that

calm pilot
#

distutils is not installable, and not on your requirements list either

#

why?

#

where is it trying to install distutils?

#

I only see an import failure

dense hedgeBOT
#
Pasting large amounts of code

If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

calm pilot
#

that version of numpy was released in april 2023

#

could be the reason it's failing

#

installing setuptools might help

#

because such an old version of numpy does not have wheels for python 3.12

#

so it has to use setuptools to build the project

#

python 3.11 was the last version with wheels for numpy 1.24.3

#

try installing setuptools, then try installing numpy again

simple gate
#

It looks like you're installing a version of numpy without wheels for your platform

calm pilot
#

yeah I said that already

simple gate
#

And that version of numpy pinned setuptools

#

Because they took a long time to migrate to the new distutils way of being

calm pilot
#

if numpy pins setuptools to a specific version then you just can't install this on python 3.12

#

you need either a newer numpy or an older Python

#

where are your requirements coming from anyway

simple gate
#

Also why are you installing async_generator it's truly ancient

calm pilot
#

I'm betting this is coming from someone else's project

simple gate
#

!rules tos

dense hedgeBOT
#

5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.

calm pilot
#

yet another project that doesn't know how to do packaging

simple gate
#

Google does not allow scraping

#

So you won't get help with it on this server

#

Also don't trust any code that has spaces in the filenames

#

The rule isn't about good or bad

#

It's about violating tos

#

You can try complaining about it in #community-meta

#

You should be up front about where the code you're trying to run is. Post the repo URL in your initial question

dense hedgeBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, 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.