r/pythonhelp • • Apr 19 '22

Python package problems

I guys, i try to run some script from github on my PC on w11 ( i know linux is better) and i think i do the right installation with the right packages but i still have an error to built 'setup.py' if you have any idea it will be greatfull.

here is a copy of the error : Can not execute 'setup.py' since setuptools is not available in the built environnement.

I try pip install -U setuptools , and pip install openupgradelib but the same error apears. Thanks for the help

version : Python 3.10.4

2 Upvotes

9 comments sorted by

View all comments

0

u/socal_nerdtastic Apr 19 '22

i know linux is better

No it's not. It's different, and some people like it better (including me), but it's not definitively better in any way. It's just a matter of what you like.

Unless of course the script you are trying to install is specifically written for Linux. Which is what it sounds like in this case.

What package exactly are you trying to install? What command exactly are you using?

1

u/alexenderthegrand Apr 20 '22

Yes you right i prefer linux but neef w11 to work and don't have ressources yet to run a proprer virtual machine.

I dont think it's specifically for linux .

I want to install fews package i need to run the script i want to :

I use : py -m pip install -r requirements.txt

where requirements.txt it's the list of packages

Everything run well until i reach the package pathlib here is a copy of my shell :

"Collecting pathlib

Using cached pathlib-1.0.1.tar.gz (49 kB)

Preparing metadata (setup.py) ... error

error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.

│ exit code: 1

╰─> [1 lines of output]

ERROR: Can not execute `setup.py` since setuptools is not available in the build environment.

[end of output]

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

error: metadata-generation-failed

× Encountered error while generating package metadata.

╰─> See above for output."

thanks for your help appreciate.

1

u/socal_nerdtastic Apr 20 '22 edited Apr 20 '22

That must be a very old module you are trying to install, pathlib has been included in python for many years now. Just remove that line from requirements.txt.

The error is because pip is trying to install the backport package https://pypi.org/project/pathlib/
but in reality you want your program to use the built-in module https://docs.python.org/3/library/pathlib.html

1

u/alexenderthegrand Apr 20 '22

okay thanks for your help i will forget this error and try ti run my scripts