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

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.

  • 1
    Just had the same issue. Apart from solc it also depends on lllc command.
    – Adam
    Sep 15 '16 at 11:12

The error is saying that you do not have a directory:


Is that the case? If yes create it and copy your contract source files into it.

  • No, the directory is there. It was created by populus init command.
    – takeshi
    Aug 5 '16 at 18:52

From the documentation for populus init:

Running $ populus init will initialize the current directory with the default project layout that populus uses.

./tests/test_examply.py ./html/index.html

Note that it initialises the current directory - i.e. from where you're running the command, meaning that populus compile should be run in the same directory, and by default will compile ./contracts/Example.sol.

  • Yes, I checked that. I'm using the right location. There is something different.
    – takeshi
    Aug 5 '16 at 18:56
  • Does Example.sol definitely exist? And you're running from the same directory as init was run from? Aug 5 '16 at 21:42
  • Sure. Please see the very first link in the question. Second line there says the problem may occur when the solc compiler is not installed. But I did install it.
    – takeshi
    Aug 6 '16 at 4:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.