"ImportError: cannot import name 'DistutilsOptionError' from 'distutils.core'" while attempting to install software from Github?

148 views Asked by At

I am trying to install a software called OpenNFT from Github using pip onto a laptop running Windows 11, but am running into an error involving the setup.py script that I can't seem to resolve.

I installed the necessary prerequisites, and properly set up and activated a virtual environment (venv) per the developers' installation instructions (which can be found here: https://opennft.readthedocs.io/en/latest/install.html).

However, when running pip install git+https://github.com/OpenNFT/OpenNFT.git , I keep getting this error message:

Collecting git+https://github.com/OpenNFT/OpenNFT.git
  Cloning https://github.com/OpenNFT/OpenNFT.git to c:\users\lshar\appdata\local\temp\pip-req-build-falefnmp
  Running command git clone --filter=blob:none --quiet https://github.com/OpenNFT/OpenNFT.git 'C:\Users\lshar\AppData\Local\Temp\pip-req-build-falefnmp'
  Resolved https://github.com/OpenNFT/OpenNFT.git to commit 30e784adf92c234eeb97efc86c6d72cf449aa9fc
  Running command git submodule update --init --recursive -q
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 36, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\lshar\AppData\Local\Temp\pip-req-build-falefnmp\setup.py", line 10, in <module>
          from distutils.core import DistutilsOptionError
      ImportError: cannot import name 'DistutilsOptionError' from 'distutils.core' (c:\users\lshar\opennft-venv\lib\site-packages\setuptools\_distutils\core.py)
      [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 am not sure why it is having trouble importing 'DistutilsOptionError' from 'distutils.core'. I haven't seen this exact ImportError message anywhere else. I have looked at other people's threads for "python setup.py egg_info did not run successfully", but none of the responses have solved my specific issue. I have already tried usual troubleshooting angles for metadata generation issues such as trying to upgrade pip, setuptools, and wheel (currently running versions 23.1.2, 68.0.0, and 0.40.0, respectively), but it did not fix the issue. I have tried exiting out of and deactivating the venv, and building / activating a new venv, but it didn't help. I don't believe it is a Python version compatibility issue either, as I am running Python 3.7.9, which has shown to be compatible with the OpenNFT software.

Here is a link to the OpenNFT Github page for context: https://github.com/opennft/OpenNFT

If this is an issue with missing / incomplete dependencies or packages, I have no idea what the problem is. Hopefully someone here can point me in the right direction. Any help would be appreciated! Thanks!

0

There are 0 answers