Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can't seem to install it on Windows, getting error: FileNotFoundError: [WinError 3] The system cannot find the path specified: 'build' #1404

Open
jt0dd opened this issue Dec 11, 2021 · 12 comments

Comments

@jt0dd
Copy link

jt0dd commented Dec 11, 2021

From what I can tell it's looking for something in the directory "build" but that's not a standard directory. I'm confused on how to proceed. I tried this both on my bare metal Windows 11 machine and a Windows 10 VM. I've installed things like GCC with MinGW and added the bin to PATH. What's going wrong here? I've seen mention of IDA / Windows support in readme.md so I'm pretty sure it's not exclusively a *nix tool.

PS C:\Users\jonat> python3 -m pip install miasm
Collecting miasm
  Downloading miasm-0.1.3.tar.gz (554 kB)
     |████████████████████████████████| 554 kB 2.2 MB/s
  Preparing metadata (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\jonat\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\jonat\\AppData\\Local\\Temp\\pip-install-caz1p30p\\miasm_8310d01b47764a7bacbdaf01f6d6e702\\setup.py'"'"'; __file__='"'"'C:\\Users\\jonat\\AppData\\Local\\Temp\\pip-install-caz1p30p\\miasm_8310d01b47764a7bacbdaf01f6d6e702\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\jonat\AppData\Local\Temp\pip-pip-egg-info-ibw_wrr1'
       cwd: C:\Users\jonat\AppData\Local\Temp\pip-install-caz1p30p\miasm_8310d01b47764a7bacbdaf01f6d6e702\
  Complete output (19 lines):
  building
  build with 'all'
  running egg_info
  creating C:\Users\jonat\AppData\Local\Temp\pip-pip-egg-info-ibw_wrr1\miasm.egg-info
  writing C:\Users\jonat\AppData\Local\Temp\pip-pip-egg-info-ibw_wrr1\miasm.egg-info\PKG-INFO
  writing dependency_links to C:\Users\jonat\AppData\Local\Temp\pip-pip-egg-info-ibw_wrr1\miasm.egg-info\dependency_links.txt
  writing top-level names to C:\Users\jonat\AppData\Local\Temp\pip-pip-egg-info-ibw_wrr1\miasm.egg-info\top_level.txt
  writing manifest file 'C:\Users\jonat\AppData\Local\Temp\pip-pip-egg-info-ibw_wrr1\miasm.egg-info\SOURCES.txt'
  reading manifest file 'C:\Users\jonat\AppData\Local\Temp\pip-pip-egg-info-ibw_wrr1\miasm.egg-info\SOURCES.txt'
  writing manifest file 'C:\Users\jonat\AppData\Local\Temp\pip-pip-egg-info-ibw_wrr1\miasm.egg-info\SOURCES.txt'
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:\Users\jonat\AppData\Local\Temp\pip-install-caz1p30p\miasm_8310d01b47764a7bacbdaf01f6d6e702\setup.py", line 288, in <module>
      buil_all()
    File "C:\Users\jonat\AppData\Local\Temp\pip-install-caz1p30p\miasm_8310d01b47764a7bacbdaf01f6d6e702\setup.py", line 241, in buil_all
      for dirname in os.listdir(build_base):
  FileNotFoundError: [WinError 3] The system cannot find the path specified: 'build'
  build all
  build
  ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/a2/d6/207063f6e95a54aafe9c53488c32bb03352d27e909333093af5c097bbb36/miasm-0.1.3.tar.gz#sha256=9c1263862d373949e1b03899532a0f762c10f2388b450d8d7c89d503df1c5d9a (from https://pypi.org/simple/miasm/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Downloading miasm-0.1.2.tar.gz (552 kB)
     |████████████████████████████████| 552 kB ...
  Preparing metadata (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\jonat\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\jonat\\AppData\\Local\\Temp\\pip-install-caz1p30p\\miasm_4a7747d689f047bead229e03d08427d4\\setup.py'"'"'; __file__='"'"'C:\\Users\\jonat\\AppData\\Local\\Temp\\pip-install-caz1p30p\\miasm_4a7747d689f047bead229e03d08427d4\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\jonat\AppData\Local\Temp\pip-pip-egg-info-vf3586yu'
       cwd: C:\Users\jonat\AppData\Local\Temp\pip-install-caz1p30p\miasm_4a7747d689f047bead229e03d08427d4\
  Complete output (5 lines):
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:\Users\jonat\AppData\Local\Temp\pip-install-caz1p30p\miasm_4a7747d689f047bead229e03d08427d4\setup.py", line 236, in <module>
      with io.open(os.path.join(os.path.abspath(os.path.dirname('__file__')),
  FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\jonat\\AppData\\Local\\Temp\\pip-install-caz1p30p\\miasm_4a7747d689f047bead229e03d08427d4\\README.md'
  ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/94/1d/18e95e00f5fa29b461d94ecadca1ed21ff6a9bc31df4de5e24f51e9d2273/miasm-0.1.2.tar.gz#sha256=107145aa953d2a07e8696b2af25e0f84d3c67ffcb8860fefed6b747552bb0b1d (from https://pypi.org/simple/miasm/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement miasm (from versions: 0.1.2, 0.1.3)
ERROR: No matching distribution found for miasm
@jt0dd jt0dd changed the title I can't seem to install it on Windows, getting errors I can't seem to install it on Windows, getting error: FileNotFoundError: [WinError 3] The system cannot find the path specified: 'build' Dec 11, 2021
@serpilliere
Copy link
Contributor

Hi @jt0dd
Yes, we run it on windows, you can see this to the regression tests executed on travis for example:
https://ci.appveyor.com/project/cea-sec/miasm/builds/41795794

Maybe the pip package is broken for windows.
As it will take time to fix this, maybe you can install it using the same way as travis (git clone, python setup install)

@PavelKotov1
Copy link

"maybe you can install it using the same way as travis (git clone, python setup install)"

Cher Serpillere, could you s'il vous plaît describe this in more details (like step by step?), because i still cannot get it to work...
je suis bête comme mes pieds?
Merci bien!

@serpilliere
Copy link
Contributor

Hi @PavelKotov1 !
No @PavelKotov1 : the reality is that I am "bête comme mes pieds".
The fact is that I don't use and have never installer Miasm on a Windows box.
I personally only test it against ubuntu / debian / archlinux / centos.

Miasm runs on windows because a contributor added the install/execution of Miasm on windows in appveyor and every regression tests / examples run on it.

So, how does it work on windows?
I don't have a clue.

The simple answer maybe: if you manage to get the same windows configuration as appveyor, then you will be able to install / run it on a windows box.

De rien!

@PavelKotov1
Copy link

miasm works perfectly on ubuntu (the only drawback is vm and memory consumpotion), but i guess that for my learning purposes it is quite sufficient.
I simply cannot afford spending time on all that research just for the sake of pleasure of having it on Window. Life is unfortunately so short...
But mille grazie for such a wonderful tool! I learn so much reading your code! miasm is a jewell!

@serpilliere
Copy link
Contributor

I would say that some code parts are more "rotten jewell".
But thank you anyway @PavelKotov1

Maybe one day some windows contributor will give steps to install it on windows.

@epuni
Copy link

epuni commented Jun 2, 2022

Installing on windows works for me:

  1. install any modern visual studio >= 2017 (i have the full version but probably just build tools are enough).
  2. open a cmd with the vs tools for your arch in path like vcvars64.bat
  3. pull and cd to the repo and do python setup.py build
  4. If it worked do python setup.py install and you should be ready to go

Would be cool if pip could do this on its own but i don't know enouh python shenanigans to make a pr for it.

Hacky tip: You can build on your dev machine and then copy site-packages/miasm/ over to your VMs so you don't have to install visual studio everywhere

@serpilliere
Copy link
Contributor

Oh! Thank you for the hint @epuni !

@sla-te
Copy link

sla-te commented Oct 9, 2022

Does not work for us, we get a variety of different build errors, can the maintainer not provide a proper wheel, like most modern packages do?

@mrexodia
Copy link
Contributor

mrexodia commented Oct 9, 2022

Would help if you posted your error log so people can help you…

@sla-te
Copy link

sla-te commented Oct 10, 2022

I understand your response, but I am not willing to debug this, its going way to deep.. I have taken a look at travis as well, the last successful build on windows was 4 months ago, see https://ci.appveyor.com/project/cea-sec/miasm (python 2 ?!)
That all being said you cannot install this package on any Windows machine without a deep dive..

@serpilliere
Copy link
Contributor

Hi @sla-te
It seems that we have a point in common: we don't like wasting time on windows installer.
As I already stated, the run are executed on linux AND windows: the tests results are linked in the README, and as you can see they are passing.
https://github.com/cea-sec/miasm/actions/workflows/tests.yml?branch=master
If you look closer at the link you gave, you will see that the failing tests you are talking about are a branch of another person (testing the rust miasm version by the way) in which he has removed the python2 support.

I spend time maintaining Miasm, and I am not really interested in spending too much time on windows installation, that's why I don't do it.

But if anyone wants to do so, feel free to do a PR!

@mrexodia
Copy link
Contributor

Honestly I wouldn't mind helping with the Windows part. I didn't run into any issues myself when running python setup.py build and then python setup.py install from a Visual Studio 2019 command prompt. So if you could just provide the log @sla-te that would be really helpful to see if this issue can't be solved for everyone...

mrexodia added a commit to mrexodia/miasm that referenced this issue Oct 14, 2022
This still requires you have Visual Studio and LLVM installed, but might prevent some issues like cea-sec#1404
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants