2

I'm trying to install the importlib package using pip3, but I'm getting an error that says "Can not execute setup.py since setuptools is not available in the build environment." How can I fix this error and successfully install the importlib package?

mrichardsonr1@penguin:~$ pip3 install importlib
Defaulting to user installation because normal site-packages is not writeable
Collecting importlib
  Using cached importlib-1.0.4.zip (7.1 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.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

I have uninstalled pip, setuptools, updated everything reinstalled everything, nothing works. I am running this on Linux x86_64 container on ChromeOS. I am using the latest version of setuptools which is what I was told could be causing this.

mrichardsonr1@penguin:~$ pip3 install setuptools
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: setuptools in ./.local/lib/python3.9/site-packages (65.6.3)

As far as I know everything else is up to date. No clue why I am getting this error, and it's not just when installing this package I had the same issue trying to install the ping package.

1

2 Answers 2

1

https://pypi.org/project/importlib/

Installation package importlib is only for Python 2.7, you cannot install it with pip3.

In Python 3 importlib became a package from the standard library: https://docs.python.org/3/library/importlib.html . You don't need to install it separately; once you've installed Python3 and the standard library the package is available for import. To check from the command line:

$ python3 -c "import importlib"
Sign up to request clarification or add additional context in comments.

7 Comments

This seems to have worked, but I am still having issues running Cura with the --no-sandbox tag mrichardsonr1./cura.AppImage --no-sandbox PyInstaller/loader/pyimod02_importers.py:499: DeprecationWarning: the imp module is deprecated in favour of importlib and slated for removal in Python 3.12; see the module's documentation for alternative uses It just says that and then nothing happens. I would like to say that what you said seems to have done "something" because no errors occured but it didnt give output: mrichardsonr1@penguin:~$ python3 -c "import importlib" mrichardsonr1@penguin:~$
@OrbitalMartian 1. python3 -c "import importlib" is not supposed to produce output; it show there is no error/exception; to have some debugging output you can do ` python3 -c "import importlib; print(importlib)"` 2. "DeprecationWarning: the imp module is deprecated…" is just a warning; though my advice is to fix the application (if it's your code) or report it to the authors (if it isn't).
@OrbitalMartian That's a completely different question, it must be asked separately. But first try search.
@OrbitalMartian I don't see it's related to the question. Please create a new question and show the entire traceback, formatted. For full error message try pip install -vvv ping
Thanks for the headstart. I'm sure I'll figure out whats wrong soon!
|
0

This worked for me:

upgraded pip

python.exe -m pip install --upgrade pip

installed importlib

pip install importlib==1.0.4

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.