skip to Main Content

I’m trying to install a package using setup.py for a project. When I run the command python setup.py install, I receive a deprecation warning about using setup.py directly. Despite this, the installation proceeds but fails with a fatal error.

The error suggests that the file assert.h could not be found and that the Microsoft Visual Studio build tools are failing during the compilation.

setup.py file

import os
from distutils.core import setup, Extension
sources = [
    'src/python/core.c',`enter code here`
    'src/libethash/io.c',
    'src/libethash/internal.c',
    'src/libethash/sha3.c']
if os.name == 'nt':
    sources += [
        'src/libethash/util_win32.c',
        'src/libethash/io_win32.c',
        'src/libethash/mmap_win32.c',
    ]
else:
    sources += [
        'src/libethash/io_posix.c'
    ]
depends = [
    'src/libethash/ethash.h',
    'src/libethash/compiler.h',
    'src/libethash/data_sizes.h',
    'src/libethash/endian.h',
    'src/libethash/ethash.h',
    'src/libethash/io.h',
    'src/libethash/fnv.h',`enter code here`
    'src/libethash/internal.h',
    'src/libethash/sha3.h',
    'src/libethash/util.h',
]
pyethash = Extension('pyethash',
                     sources=sources,
                     depends=depends,
                     extra_compile_args=["-Isrc/", "-std=gnu99", "-Wall"])

setup(
    name='pyethash',
    author="Matthew Wampler-Doty",
    author_email="[email protected]",
    license='GPL',
    version='0.1.23',
    url='https://github.com/ethereum/ethash',
    download_url='https://github.com/ethereum/ethash/tarball/v23',
    description=('Python wrappers for ethash, the ethereum proof of work'
                 'hashing function'),
    ext_modules=[pyethash],
)

Error :

(py_venv) C:UsersVijay.VC-VIJAYPATILvc_projectinhouse_projectsethash-master>python setup.py install
C:UsersVijay.VC-VIJAYPATILanaconda3envspy_venvlibsite-packagessetuptools_distutilscmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` directly.
        Instead, use pypa/build, pypa/installer or other
        standards-based tools.

        See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
        ********************************************************************************

!!
  self.initialize_options()
C:UsersVijay.VC-VIJAYPATILanaconda3envspy_venvlibsite-packagessetuptools_distutilscmd.py:66: EasyInstallDeprecationWarning: easy_install command is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` and ``easy_install``.
        Instead, use pypa/build, pypa/installer or other
        standards-based tools.

        See https://github.com/pypa/setuptools/issues/917 for details.
        ********************************************************************************

!!
  self.initialize_options()
warning: no files found matching 'srclibethashutil.c'
cl : Command line warning D9002 : ignoring unknown option '-std=gnu99'
internal.c
src/libethash/internal.c(23): fatal error C1083: Cannot open include file: 'assert.h': No such file or directory
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.41.34120\bin\HostX86\x64\cl.exe' failed with exit code 2

2

Answers


  1. Python ethereum package is no longer maintained.

    No Python project should use or need it for more than half a decade now. If some project uses it, then it is up to the maintainers of this project to get rid of it.

    The real problem is why do you think you need this package in the first place.

    Login or Signup to reply.
  2. @Mikko Ohtamaa we are using optional ethereum for sign transaction as we are other way also using web3 but for project setup its required as we are using optional method using ethereum sign transaction methods

    #from ethereum.transactions import Transaction
    #from ethereum.utils import encode_hex

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search