[Ethereum] populus OSError: [Errno 2] No such file or directory


When trying:

$populus compile


OSError: [Errno 2] No such file or directory


Tried to install missing dependencies as described here and installed solidity compiler as well – same result. And same result under sudo or virtualenv. populus init works as expected.

Related issue at GitHub.

Full console output:

============ Compiling ==============
> Loading contracts from: /home/petr/Projects/populus-tests/contracts
Traceback (most recent call last):
  File "/usr/local/bin/populus", line 11, in <module>
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/populus/cli/compile_cmd.py", line 46, in compile_contracts
    result = compile_and_write_contracts(project_dir, *filters, optimize=optimize)
  File "/usr/local/lib/python2.7/dist-packages/populus/compilation.py", line 161, in compile_and_write_contracts
  File "/usr/local/lib/python2.7/dist-packages/populus/compilation.py", line 94, in compile_project_contracts
  File "/usr/local/lib/python2.7/dist-packages/populus/compilation.py", line 81, in compile_source_file
  File "/usr/local/lib/python2.7/dist-packages/populus/solidity.py", line 52, in solc
  File "/usr/lib/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1343, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Best Answer

After installing some other tools (like EthereumJS testrpc) the problem was solved by itself. I guess it was solc compiler which wasn't installed properly on my computer.

Used to build solidity compiler from source but then installed it as a npm package, which was much easier.

So, if you have the same problem. Try checking if solc command works.

Related Topic