Giter VIP home page Giter VIP logo

Comments (13)

thedogrex avatar thedogrex commented on August 17, 2024 16

I think it is x86 / x64 compability error.

I've used python 3.9.0 and these steps worked for me
(with py-evm project on python https://github.com/ethereum/py-evm):

  1. Download pyethash 0.1.27:
    https://pypi.org/project/pyethash/0.1.27/#files
    and unpack archive in lib folder in your project. I've unpacked at /virtualenv/Lib/site-packages/pyethash-0.1.27 folder

  2. Download ethash from git:
    https://github.com/ethereum/ethash

  3. Copy all files form ethash folder to /virtualenv/Lib/site-packages/pyethash-0.1.27

  4. Change /pyethash-0.1.27/src/libethash/mmap.h add this code to the end of file:

#pragma comment(lib, "Shell32.lib")
  1. Change pyethash-0.1.27\src\python\core.c file - replace #include <alloca.h> by the code:
#if defined(_WIN32) || defined(WIN32)
#include <malloc.h>
#else
#include <alloca.h>
#endif
  1. Zip /virtualenv/Lib/site-packages/pyethash-0.1.27 folder and remove that folder (zip archive will stay).

  2. Run pip install for new created zip /virtualenv/Lib/site-packages/pyethash-0.1.27.zip

  3. It can conflict with versions: ethash have 0.1.23 version instead of 0.1.27, i just changed my requerements to 0.1.23 and it worked for me. You can try to copy not all files (from ethhash to pyethhash), just files one by one that breaks the compilation.

from ethash.

Nov1kov avatar Nov1kov commented on August 17, 2024 5

An even simpler option is to use a prepared fork with all of the above changes:

pip install https://codeload.github.com/Nov1kov/ethash/zip/refs/heads/master

from ethash.

rayeaster avatar rayeaster commented on August 17, 2024 3

I think it is x86 / x64 compability error.

I've used python 3.9.0 and these steps worked for me (with py-evm project on python https://github.com/ethereum/py-evm):

  1. Download pyethash 0.1.27:
    https://pypi.org/project/pyethash/0.1.27/#files
    and unpack archive in lib folder in your project. I've unpacked at /virtualenv/Lib/site-packages/pyethash-0.1.27 folder
  2. Download ethash from git:
    https://github.com/ethereum/ethash
  3. Copy all files form ethash folder to /virtualenv/Lib/site-packages/pyethash-0.1.27
  4. Change /pyethash-0.1.27/src/libethash/mmap.h add this code to the end of file:
#pragma comment(lib, "Shell32.lib")
  1. Change pyethash-0.1.27\src\python\core.c file - replace #include <alloca.h> by the code:
#if defined(_WIN32) || defined(WIN32)
#include <malloc.h>
#else
#include <alloca.h>
#endif
  1. Zip /virtualenv/Lib/site-packages/pyethash-0.1.27 folder and remove that folder (zip archive will stay).
  2. Run pip install for new created zip /virtualenv/Lib/site-packages/pyethash-0.1.27.zip
  3. It can conflict with versions: ethash have 0.1.23 version instead of 0.1.27, i just changed my requerements to 0.1.23 and it worked for me. You can try to copy not all files (from ethhash to pyethhash), just files one by one that breaks the compilation.

for step 8, you could simply modify version to 0.1.27 in the setup.py file within the pyethash-0.1.27 folder

....
setup(
    name='pyethash',
    author="Matthew Wampler-Doty",
    author_email="[email protected]",
    license='GPL',
    version='0.1.27',
    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],
)

from ethash.

kpoman avatar kpoman commented on August 17, 2024 2

I think it is x86 / x64 compability error.
I've used python 3.9.0 and these steps worked for me (with py-evm project on python https://github.com/ethereum/py-evm):

  1. Download pyethash 0.1.27:
    https://pypi.org/project/pyethash/0.1.27/#files
    and unpack archive in lib folder in your project. I've unpacked at /virtualenv/Lib/site-packages/pyethash-0.1.27 folder
  2. Download ethash from git:
    https://github.com/ethereum/ethash
  3. Copy all files form ethash folder to /virtualenv/Lib/site-packages/pyethash-0.1.27
  4. Change /pyethash-0.1.27/src/libethash/mmap.h add this code to the end of file:
#pragma comment(lib, "Shell32.lib")
  1. Change pyethash-0.1.27\src\python\core.c file - replace #include <alloca.h> by the code:
#if defined(_WIN32) || defined(WIN32)
#include <malloc.h>
#else
#include <alloca.h>
#endif
  1. Zip /virtualenv/Lib/site-packages/pyethash-0.1.27 folder and remove that folder (zip archive will stay).
  2. Run pip install for new created zip /virtualenv/Lib/site-packages/pyethash-0.1.27.zip
  3. It can conflict with versions: ethash have 0.1.23 version instead of 0.1.27, i just changed my requerements to 0.1.23 and it worked for me. You can try to copy not all files (from ethhash to pyethhash), just files one by one that breaks the compilation.

for step 8, you could simply modify version to 0.1.27 in the setup.py file within the pyethash-0.1.27 folder

....
setup(
    name='pyethash',
    author="Matthew Wampler-Doty",
    author_email="[email protected]",
    license='GPL',
    version='0.1.27',
    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],
)

Worked fine. Simpler entering the folder and executing python setup.py install ...

from ethash.

Dilshan1997 avatar Dilshan1997 commented on August 17, 2024

Yeah, I also got that error message..plz someone help to fix this problem.

from ethash.

delphee avatar delphee commented on August 17, 2024

Me too. Anyone have any luck yet?

from ethash.

RNateWorkman avatar RNateWorkman commented on August 17, 2024

I'm having the same problem and hoping someone can help. I'm not that great at exceptions, but believe that the issue has something to do with that when the package installer gets to the "io_win32.c" file it fails because it looks for the file in the root directory "Program Files (x86)" and not x64.

Hopefully somebody can help clean that explanation up.

from ethash.

imtypist avatar imtypist commented on August 17, 2024

Works for me, too. (python 3.9.7, win11)
Thanks for solutions!

from ethash.

abarbatei avatar abarbatei commented on August 17, 2024

For people coming here after years and suffering. I used Python 3.11 and made the .egg 522abb85a345d4751b43418fd4bc36ee15e6d6c0311ddd8f7f0b7d64cb8681f6 *pyethash-0.1.27-py3.11-win-amd64.egg
https://www.virustotal.com/gui/file/522abb85a345d4751b43418fd4bc36ee15e6d6c0311ddd8f7f0b7d64cb8681f6
pyethash-0.1.27-py3.11-win-amd64.egg.zip
(can't upload .egg directly, check the sha256 hash of the .egg file not the zip for confirmation)
Still don't know why anybody didn't upload it somewhere up until now

from ethash.

caomingpei avatar caomingpei commented on August 17, 2024

Thanks a lot, worked for me (python 3.10, win11)

from ethash.

maritogaleano avatar maritogaleano commented on August 17, 2024

For people coming here after years and suffering. I used Python 3.11 and made the .egg 522abb85a345d4751b43418fd4bc36ee15e6d6c0311ddd8f7f0b7d64cb8681f6 *pyethash-0.1.27-py3.11-win-amd64.egg https://www.virustotal.com/gui/file/522abb85a345d4751b43418fd4bc36ee15e6d6c0311ddd8f7f0b7d64cb8681f6 pyethash-0.1.27-py3.11-win-amd64.egg.zip (can't upload .egg directly, check the sha256 hash of the .egg file not the zip for confirmation) Still don't know why anybody didn't upload it somewhere up until now

I am having the same problem I have Python 3.10.
and Windows 11, how do I install the file with the egg extension?

from ethash.

andrewcharlwood avatar andrewcharlwood commented on August 17, 2024

For people coming here after years and suffering. I used Python 3.11 and made the .egg 522abb85a345d4751b43418fd4bc36ee15e6d6c0311ddd8f7f0b7d64cb8681f6 *pyethash-0.1.27-py3.11-win-amd64.egg https://www.virustotal.com/gui/file/522abb85a345d4751b43418fd4bc36ee15e6d6c0311ddd8f7f0b7d64cb8681f6 pyethash-0.1.27-py3.11-win-amd64.egg.zip (can't upload .egg directly, check the sha256 hash of the .egg file not the zip for confirmation) Still don't know why anybody didn't upload it somewhere up until now

I am having the same problem I have Python 3.10. and Windows 11, how do I install the file with the egg extension?

Not sure if this will work with windows 11 - but this is py 3.10 built on windows 10 - it's the zip file as per @thedogrex's instructions, so you can start at step 7

https://www.virustotal.com/gui/file/b774c679e808251785b870b38c19bbee3edebca94396efb6083edfb66e4d7dd8?nocache=1

pyethash-0.1.27.zip

from ethash.

DevWand avatar DevWand commented on August 17, 2024

Uma opção ainda mais simples é usar um garfo preparado com todas as alterações acima:

pip install https://codeload.github.com/Nov1kov/ethash/zip/refs/heads/master

Thanks, perfect

from ethash.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.