BinPackage icon indicating copy to clipboard operation
BinPackage copied to clipboard

Unable to install package

Open hlynurstef opened this issue 3 years ago • 3 comments

I ran the following command from a clean venv folder:

pip install islenska

And got the following error:

(I've removed the actual paths and replaced them with [redacted])

Collecting islenska
  Using cached islenska-0.4.3.tar.gz (42.3 MB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [48 lines of output]
      WARNING: The wheel package is not available.
        error: subprocess-exited-with-error

        × python setup.py bdist_wheel did not run successfully.
        │ exit code: 1
        ╰─> [6 lines of output]
            usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
               or: setup.py --help [cmd1 cmd2 ...]
               or: setup.py --help-commands
               or: setup.py cmd --help

            error: invalid command 'bdist_wheel'
            [end of output]

        note: This error originates from a subprocess, and is likely not a problem with pip.
        ERROR: Failed building wheel for cffi
      ERROR: Failed to build one or more wheels
      Traceback (most recent call last):
        File "[redacted]/venv/lib/python3.8/site-packages/setuptools/installer.py", line 128, in fetch_build_egg
          subprocess.check_call(cmd)
        File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/subprocess.py", line 364, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['[redacted]/venv/bin/python3', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/var/folders/7b/fx44d2qx41bbjn50j4mbmvc00000gn/T/tmpa8ojaoyu', '--quiet', 'cffi>=1.13.0']' returned non-zero exit status 1.

      The above exception was the direct cause of the following exception:

      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/7b/fx44d2qx41bbjn50j4mbmvc00000gn/T/pip-install-40yfuz14/islenska_08a564660857412f9d970585e1cdd450/setup.py", line 61, in <module>
          setup(
        File "[redacted]/venv/lib/python3.8/site-packages/setuptools/__init__.py", line 164, in setup
          _install_setup_requires(attrs)
        File "[redacted]/venv/lib/python3.8/site-packages/setuptools/__init__.py", line 159, in _install_setup_requires
          dist.fetch_build_eggs(dist.setup_requires)
        File "[redacted]/venv/lib/python3.8/site-packages/setuptools/dist.py", line 699, in fetch_build_eggs
          resolved_dists = pkg_resources.working_set.resolve(
        File "[redacted]/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 779, in resolve
          dist = best[req.key] = env.best_match(
        File "[redacted]/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1064, in best_match
          return self.obtain(req, installer)
        File "[redacted]/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1076, in obtain
          return installer(requirement)
        File "[redacted]/venv/lib/python3.8/site-packages/setuptools/dist.py", line 758, in fetch_build_egg
          return fetch_build_egg(self, req)
        File "[redacted]/venv/lib/python3.8/site-packages/setuptools/installer.py", line 130, in fetch_build_egg
          raise DistutilsError(str(e)) from e
      distutils.errors.DistutilsError: Command '['[redacted]/venv/bin/python3', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/var/folders/7b/fx44d2qx41bbjn50j4mbmvc00000gn/T/tmpa8ojaoyu', '--quiet', 'cffi>=1.13.0']' returned non-zero exit status 1.
      [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.

Running on MacBook Pro, M1 Pro, macOS Monterey version 12.2.1 python version: 3.8 pip version: 22.2.2

hlynurstef avatar Oct 10 '22 01:10 hlynurstef

If I install wheel first:

pip install wheel

I seem to be able to install the package but I still get some errors:

Collecting islenska
  Using cached islenska-0.4.3.tar.gz (42.3 MB)
  Preparing metadata (setup.py) ... done
Collecting cffi>=1.13.0
  Using cached cffi-1.15.1.tar.gz (508 kB)
  Preparing metadata (setup.py) ... done
Collecting typing_extensions
  Using cached typing_extensions-4.4.0-py3-none-any.whl (26 kB)
Collecting pycparser
  Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Building wheels for collected packages: islenska, cffi
  Building wheel for islenska (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [28 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/7b/fx44d2qx41bbjn50j4mbmvc00000gn/T/pip-install-hczv1su3/islenska_4fe2b3487f2e46c992ece3263ac56c45/setup.py", line 61, in <module>
          setup(
        File "[redacted]/venv/lib/python3.8/site-packages/setuptools/__init__.py", line 164, in setup
          _install_setup_requires(attrs)
        File "[redacted]/venv/lib/python3.8/site-packages/setuptools/__init__.py", line 159, in _install_setup_requires
          dist.fetch_build_eggs(dist.setup_requires)
        File "[redacted]/venv/lib/python3.8/site-packages/setuptools/dist.py", line 699, in fetch_build_eggs
          resolved_dists = pkg_resources.working_set.resolve(
        File "[redacted]/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 779, in resolve
          dist = best[req.key] = env.best_match(
        File "[redacted]/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1064, in best_match
          return self.obtain(req, installer)
        File "[redacted]/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1076, in obtain
          return installer(requirement)
        File "[redacted]/venv/lib/python3.8/site-packages/setuptools/dist.py", line 758, in fetch_build_egg
          return fetch_build_egg(self, req)
        File "[redacted]/venv/lib/python3.8/site-packages/setuptools/installer.py", line 133, in fetch_build_egg
          wheel.install_as_egg(dist_location)
        File "[redacted]/venv/lib/python3.8/site-packages/setuptools/wheel.py", line 99, in install_as_egg
          self._install_as_egg(destination_eggdir, zf)
        File "[redacted]/venv/lib/python3.8/site-packages/setuptools/wheel.py", line 107, in _install_as_egg
          self._convert_metadata(zf, destination_eggdir, dist_info, egg_info)
        File "[redacted]/venv/lib/python3.8/site-packages/setuptools/wheel.py", line 128, in _convert_metadata
          os.mkdir(destination_eggdir)
      FileExistsError: [Errno 17] File exists: '/private/var/folders/7b/fx44d2qx41bbjn50j4mbmvc00000gn/T/pip-install-hczv1su3/islenska_4fe2b3487f2e46c992ece3263ac56c45/.eggs/cffi-1.15.1-py3.8-macosx-10.14-arm64.egg'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for islenska
  Running setup.py clean for islenska
  error: subprocess-exited-with-error

  × python setup.py clean did not run successfully.
  │ exit code: 1
  ╰─> [28 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/7b/fx44d2qx41bbjn50j4mbmvc00000gn/T/pip-install-hczv1su3/islenska_4fe2b3487f2e46c992ece3263ac56c45/setup.py", line 61, in <module>
          setup(
        File "[redacted]/venv/lib/python3.8/site-packages/setuptools/__init__.py", line 164, in setup
          _install_setup_requires(attrs)
        File "[redacted]/venv/lib/python3.8/site-packages/setuptools/__init__.py", line 159, in _install_setup_requires
          dist.fetch_build_eggs(dist.setup_requires)
        File "[redacted]/venv/lib/python3.8/site-packages/setuptools/dist.py", line 699, in fetch_build_eggs
          resolved_dists = pkg_resources.working_set.resolve(
        File "[redacted]/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 779, in resolve
          dist = best[req.key] = env.best_match(
        File "[redacted]/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1064, in best_match
          return self.obtain(req, installer)
        File "[redacted]/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1076, in obtain
          return installer(requirement)
        File "[redacted]/venv/lib/python3.8/site-packages/setuptools/dist.py", line 758, in fetch_build_egg
          return fetch_build_egg(self, req)
        File "[redacted]/venv/lib/python3.8/site-packages/setuptools/installer.py", line 133, in fetch_build_egg
          wheel.install_as_egg(dist_location)
        File "[redacted]/venv/lib/python3.8/site-packages/setuptools/wheel.py", line 99, in install_as_egg
          self._install_as_egg(destination_eggdir, zf)
        File "[redacted]/venv/lib/python3.8/site-packages/setuptools/wheel.py", line 107, in _install_as_egg
          self._convert_metadata(zf, destination_eggdir, dist_info, egg_info)
        File "[redacted]/venv/lib/python3.8/site-packages/setuptools/wheel.py", line 128, in _convert_metadata
          os.mkdir(destination_eggdir)
      FileExistsError: [Errno 17] File exists: '/private/var/folders/7b/fx44d2qx41bbjn50j4mbmvc00000gn/T/pip-install-hczv1su3/islenska_4fe2b3487f2e46c992ece3263ac56c45/.eggs/cffi-1.15.1-py3.8-macosx-10.14-arm64.egg'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed cleaning build dir for islenska
  Building wheel for cffi (setup.py) ... done
  Created wheel for cffi: filename=cffi-1.15.1-cp38-cp38-macosx_10_14_arm64.whl size=260954 sha256=e4aaf045a9208bb17cd98996bfa1a8b3bbf97020a894855ccd4d28b3e0b3865f
  Stored in directory: /Users/hlynur/Library/Caches/pip/wheels/4f/6c/1c/87e97bb9c55afbf66881d37eed21c108b012c29105af6be450
Successfully built cffi
Failed to build islenska
Installing collected packages: typing_extensions, pycparser, cffi, islenska
  Running setup.py install for islenska ... done
  DEPRECATION: islenska was installed using the legacy 'setup.py install' method, because a wheel could not be built for it. A possible replacement is to fix the wheel build issue reported above. Discussion can be found at https://github.com/pypa/pip/issues/8368
Successfully installed cffi-1.15.1 islenska-0.4.3 pycparser-2.21 typing_extensions-4.4.0

hlynurstef avatar Oct 10 '22 01:10 hlynurstef

There seems to be a script trying to create a folder that already exists causing the failure

os.mkdir(destination_eggdir)
FileExistsError: [Errno 17] File exists: '/private/var/folders/7b/fx44d2qx41bbjn50j4mbmvc00000gn/T/pip-install-hczv1su3/islenska_4fe2b3487f2e46c992ece3263ac56c45/.eggs/cffi-1.15.1-py3.8-macosx-10.14-arm64.egg'

Seems related to the fact that I'm running on a mac with an Apple silicon chip (arm64)

hlynurstef avatar Oct 10 '22 01:10 hlynurstef

The first error I got seemed to be related to the fact that the package wheel was not found.

The README could be improved to make it clearer that you need to have it installed as a prerequisite dependency. I did notice after the fact that there is some text included about it in the "Implementation" section but no mention of it in the "Installation and setup" section which makes it easy to overlook when installing. The Implementation section also only includes instructions for Linux to install the dependency, could be improved with instructions for Mac and Windows as well.

hlynurstef avatar Oct 10 '22 01:10 hlynurstef

Could you try to install the latest version (0.4.5) and let me know how it goes? We are now providing macos_arm64 wheels via PyPI.

sveinbjornt avatar Dec 13 '22 20:12 sveinbjornt