英文:
Why can't solcx find or use the compiler already installed?
问题
I have installed solcx and installed the solidity compiler via the respective methods
pip install py-solc-x
sudo add-apt-repository ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install solc
However visual studio can not find my solidity compiler
When I run solc --version
within my normal terminal I get
solc, the solidity compiler commandline interface Version: 0.8.18+commit.87f61d96.Linux.g++
However when I run
compiled_contract = compile_files([{"path": filename, "content": contract_source_code}])
The error message I get is
which: no solc in (/home/{USER}/Desktop/Ethernaut/venv/bin:/home/{USER}/.nvm/versions/node/v19.3.0/bin:/app/bin:/app/bin:/app/bin:/usr/bin:/home/{USER}/.var/app/com.visualstudio.code/data/node_modules/bin:/home/{USER}/.foundry/bin)
Even though when I run which solc it outputs the following (normal desktop terminal):
/usr/bin/solc
When I run solc within the Visual Studio terminal, it says the following:
bash: solc: command not found
I thought it was a permission issue and I changed the owner of the solc binary within usr/bin
, however that still did not resolve the issue.
英文:
I have installed solcx and installed the solidity compiler via the respective methods
pip install py-solc-x
sudo add-apt-repository ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install solc
However visual studio can not find my solidity compiler
When I run solc --version
within my normal terminal I get
solc, the solidity compiler commandline interface
Version: 0.8.18+commit.87f61d96.Linux.g++
However when i run
compiled_contract = compile_files([{"path": filename, "content": contract_source_code}])
The error message i get is
which: no solc in (/home/{USER}/Desktop/Ethernaut/venv/bin:/home/{USER}/.nvm/versions/node/v19.3.0/bin:/app/bin:/app/bin:/app/bin:/usr/bin:/home/{USER}/.var/app/com.visualstudio.code/data/node_modules/bin:/home/{USER}/.foundry/bin)
Even though when I run which solc it outputs the following (normal desktop terminal):
/usr/bin/solc
When I run solc within visual studio terminal it says the following:
bash: solc: command not found
I thought it was a permission issue and I changed the owner of the solc binary within usr/bin
however that still not resolved the issue
答案1
得分: 0
似乎存在关于使用Flatpak安装VS Code的问题。已使用不同的软件包管理器重新安装。
英文:
Seems to be an issue regarding flatpak install of vs code. Reinstalled using a different packet manager.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论