crytic / solc-select

Manage and switch between Solidity compiler versions
GNU Affero General Public License v3.0
758 stars 103 forks source link

pip3 install solc-select #69

Open taylorgag opened 3 years ago

taylorgag commented 3 years ago

Sorry to bother you, while I am using the command 'pip3 install solc-select', it runs fast. Does this mean that all versions have been installed? But when I use the command solc-selct install ,its output:(the environment is the Linux server,and what I am using the version of solc-select is 0.2.1) Available versions to install: Traceback (most recent call last): File "/home/rb/anaconda3/lib/python3.8/urllib/request.py", line 1350, in do_open h.request(req.get_method(), req.selector, req.data, headers, File "/home/rb/anaconda3/lib/python3.8/http/client.py", line 1255, in request self._send_request(method, url, body, headers, encode_chunked) File "/home/rb/anaconda3/lib/python3.8/http/client.py", line 1301, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/home/rb/anaconda3/lib/python3.8/http/client.py", line 1250, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/home/rb/anaconda3/lib/python3.8/http/client.py", line 1010, in _send_output self.send(msg) File "/home/rb/anaconda3/lib/python3.8/http/client.py", line 950, in send self.connect() File "/home/rb/anaconda3/lib/python3.8/http/client.py", line 1417, in connect super().connect() File "/home/rb/anaconda3/lib/python3.8/http/client.py", line 921, in connect self.sock = self._create_connection( File "/home/rb/anaconda3/lib/python3.8/socket.py", line 808, in create_connection raise err File "/home/rb/anaconda3/lib/python3.8/socket.py", line 796, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/rb/anaconda3/bin/solc-select", line 8, in sys.exit(solc_select()) File "/home/rb/anaconda3/lib/python3.8/site-packages/solc_select/main.py", line 48, in solc_select for version in get_installable_versions(): File "/home/rb/anaconda3/lib/python3.8/site-packages/solc_select/solc_select.py", line 105, in get_installable_versions installable = list(set(get_available_versions()) - set(installed_versions())) File "/home/rb/anaconda3/lib/python3.8/site-packages/solc_select/solc_select.py", line 115, in get_available_versions available_releases.update(get_additional_linux_versions()) File "/home/rb/anaconda3/lib/python3.8/site-packages/solc_select/solc_select.py", line 123, in get_additional_linux_versions github_json = urllib.request.urlopen(url).read() File "/home/rb/anaconda3/lib/python3.8/urllib/request.py", line 222, in urlopen return opener.open(url, data, timeout) File "/home/rb/anaconda3/lib/python3.8/urllib/request.py", line 525, in open response = self._open(req, data) File "/home/rb/anaconda3/lib/python3.8/urllib/request.py", line 542, in _open result = self._call_chain(self.handle_open, protocol, protocol + File "/home/rb/anaconda3/lib/python3.8/urllib/request.py", line 502, in _call_chain result = func(*args) File "/home/rb/anaconda3/lib/python3.8/urllib/request.py", line 1393, in https_open return self.do_open(http.client.HTTPSConnection, req, File "/home/rb/anaconda3/lib/python3.8/urllib/request.py", line 1353, in do_open raise URLError(err) urllib.error.URLError: <urlopen error [Errno 111] Connection refused>

taylorgag commented 3 years ago

sorry , I have another question. When I use the following 2 commands to install solc-select , git clone https://github.com/crytic/solc-select.git ./solc-select/scripts/install.sh Why i don't have scripts folder in solc-select? Is it the reason for the version update of solc-select?

MrWiffer commented 3 years ago

These two issues you mentioned also exist on my local Ubuntu20.04, but the command "solc-select install " indeed works on my Ubuntu vm on inspur server.

0xicingdeath commented 3 years ago

Hey @taylorgag @MrWiffer, thanks for reporting this. We are still investigating the cause of this Connection refused issue – which seems to be affecting mainly Linux installations. Thanks for the info regarding specific Ubuntu versions, this helps with reproducing, as I'm still unable to do so consistently.

Does this mean that all versions have been installed?

Running pip3 install solc-select will install the tool, but not all of the Solidity versions. This is the purpose of running solc-select install all or solc-select install <a specific version>. Do you get the same error when you run solc-select versions?

Why i don't have scripts folder in solc-select? Is it the reason for the version update of solc-select?

The scripts/ folder is a part of our old solc-select version, using Docker. solc-select has been rewritten with Python. The correct way to install this up-to-date version is to run pip3 install solc-select.

taylorgag commented 3 years ago

Hey @taylorgag @MrWiffer, thanks for reporting this. We are still investigating the cause of this Connection refused issue – which seems to be affecting mainly Linux installations. Thanks for the info regarding specific Ubuntu versions, this helps with reproducing, as I'm still unable to do so consistently.

Does this mean that all versions have been installed?

Running pip3 install solc-select will install the tool, but not all of the Solidity versions. This is the purpose of running solc-select install all or solc-select install <a specific version>. Do you get the same error when you run solc-select versions?

Why i don't have scripts folder in solc-select? Is it the reason for the version update of solc-select?

The scripts/ folder is a part of our old solc-select version, using Docker. solc-select has been rewritten with Python. The correct way to install this up-to-date version is to run pip3 install solc-select.

The following are all happening in the Linux environment: First,I use the following command to install solc,

positional arguments: {install,use,versions} Allows users to install and quickly switch between Solidity compiler versions install list and install available solc versions use change the version of global solc compiler versions prints out all installed solc versions

optional arguments: -h, --help show this help message and exit Fourth, I use solc-select versions, its outputs are No solc version set. Run solc-select use VERSION or set SOLC_VERSION environment variable. Fifth, I use solc-select install 0.6.0, its outputs are Traceback (most recent call last): File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/urllib/request.py", line 1318, in do_open encode_chunked=req.has_header('Transfer-encoding')) File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/http/client.py", line 1239, in request self._send_request(method, url, body, headers, encode_chunked) File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/http/client.py", line 1285, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/http/client.py", line 1234, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/http/client.py", line 1026, in _send_output self.send(msg) File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/http/client.py", line 964, in send self.connect() File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/http/client.py", line 1392, in connect super().connect() File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/http/client.py", line 936, in connect (self.host,self.port), self.timeout, self.source_address) File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/socket.py", line 724, in create_connection raise err File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/socket.py", line 713, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/rb/anaconda3/envs/tensorflow-gpu/bin/solc-select", line 8, in sys.exit(solc_select()) File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/site-packages/solc_select/main.py", line 51, in solc_select install_artifacts(args.get(INSTALL_VERSIONS)) File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/site-packages/solc_select/solc_select.py", line 45, in install_artifacts releases = get_available_versions() File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/site-packages/solc_select/solc_select.py", line 115, in get_available_versions available_releases.update(get_additional_linux_versions()) File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/site-packages/solc_select/solc_select.py", line 123, in get_additional_linux_versions github_json = urllib.request.urlopen(url).read() File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/urllib/request.py", line 223, in urlopen return opener.open(url, data, timeout) File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/urllib/request.py", line 526, in open response = self._open(req, data) File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/urllib/request.py", line 544, in _open '_open', req) File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/urllib/request.py", line 504, in _call_chain result = func(*args) File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/urllib/request.py", line 1361, in https_open context=self._context, check_hostname=self._check_hostname) File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/urllib/request.py", line 1320, in do_open raise URLError(err) urllib.error.URLError: <urlopen error [Errno 111] Connection refused>

taylorgag commented 3 years ago

Hey @taylorgag @MrWiffer, thanks for reporting this. We are still investigating the cause of this Connection refused issue – which seems to be affecting mainly Linux installations. Thanks for the info regarding specific Ubuntu versions, this helps with reproducing, as I'm still unable to do so consistently.

Does this mean that all versions have been installed?

Running pip3 install solc-select will install the tool, but not all of the Solidity versions. This is the purpose of running solc-select install all or solc-select install <a specific version>. Do you get the same error when you run solc-select versions?

Why i don't have scripts folder in solc-select? Is it the reason for the version update of solc-select?

The scripts/ folder is a part of our old solc-select version, using Docker. solc-select has been rewritten with Python. The correct way to install this up-to-date version is to run pip3 install solc-select.

The following are all happening in the Linux environment: First,I use the following command to install solc,

  • sudo add-apt-repository ppa:ethereum/ethereum
  • sudo apt-get update
  • sudo apt-get install solc when I use solc --version, its outputs are solc, the solidity compiler commandline interface Version: 0.8.6+commit.11564f7e.Linux.g++ Second, I use pip3 install solc-select, its outputs are Collecting solc-select Using cached solc_select-0.2.1-py3-none-any.whl (16 kB) Installing collected packages: solc-select Successfully installed solc-select-0.2.1 Third, I use solc-select --h, its output are usage: solc-select [-h] {install,use,versions} ...

positional arguments: {install,use,versions} Allows users to install and quickly switch between Solidity compiler versions install list and install available solc versions use change the version of global solc compiler versions prints out all installed solc versions

optional arguments: -h, --help show this help message and exit Fourth, I use solc-select versions, its outputs are No solc version set. Run solc-select use VERSION or set SOLC_VERSION environment variable. Fifth, I use solc-select install 0.6.0, its outputs are Traceback (most recent call last): File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/urllib/request.py", line 1318, in do_open encode_chunked=req.has_header('Transfer-encoding')) File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/http/client.py", line 1239, in request self._send_request(method, url, body, headers, encode_chunked) File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/http/client.py", line 1285, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/http/client.py", line 1234, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/http/client.py", line 1026, in _send_output self.send(msg) File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/http/client.py", line 964, in send self.connect() File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/http/client.py", line 1392, in connect super().connect() File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/http/client.py", line 936, in connect (self.host,self.port), self.timeout, self.source_address) File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/socket.py", line 724, in create_connection raise err File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/socket.py", line 713, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/rb/anaconda3/envs/tensorflow-gpu/bin/solc-select", line 8, in sys.exit(solc_select()) File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/site-packages/solc_select/main.py", line 51, in solc_select install_artifacts(args.get(INSTALL_VERSIONS)) File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/site-packages/solc_select/solc_select.py", line 45, in install_artifacts releases = get_available_versions() File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/site-packages/solc_select/solc_select.py", line 115, in get_available_versions available_releases.update(get_additional_linux_versions()) File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/site-packages/solc_select/solc_select.py", line 123, in get_additional_linux_versions github_json = urllib.request.urlopen(url).read() File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/urllib/request.py", line 223, in urlopen return opener.open(url, data, timeout) File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/urllib/request.py", line 526, in open response = self._open(req, data) File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/urllib/request.py", line 544, in _open '_open', req) File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/urllib/request.py", line 504, in _call_chain result = func(*args) File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/urllib/request.py", line 1361, in https_open context=self._context, check_hostname=self._check_hostname) File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/urllib/request.py", line 1320, in do_open raise URLError(err) urllib.error.URLError: <urlopen error [Errno 111] Connection refused>

Sixth, when I use solc-select install, its outputs are Available versions to install: Traceback (most recent call last): File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/urllib/request.py", line 1318, in do_open encode_chunked=req.has_header('Transfer-encoding')) File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/http/client.py", line 1239, in request self._send_request(method, url, body, headers, encode_chunked) File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/http/client.py", line 1285, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/http/client.py", line 1234, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/http/client.py", line 1026, in _send_output self.send(msg) File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/http/client.py", line 964, in send self.connect() File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/http/client.py", line 1392, in connect super().connect() File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/http/client.py", line 936, in connect (self.host,self.port), self.timeout, self.source_address) File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/socket.py", line 724, in create_connection raise err File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/socket.py", line 713, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/rb/anaconda3/envs/tensorflow-gpu/bin/solc-select", line 8, in sys.exit(solc_select()) File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/site-packages/solc_select/main.py", line 48, in solc_select for version in get_installable_versions(): File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/site-packages/solc_select/solc_select.py", line 105, in get_installable_versions installable = list(set(get_available_versions()) - set(installed_versions())) File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/site-packages/solc_select/solc_select.py", line 115, in get_available_versions available_releases.update(get_additional_linux_versions()) File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/site-packages/solc_select/solc_select.py", line 123, in get_additional_linux_versions github_json = urllib.request.urlopen(url).read() File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/urllib/request.py", line 223, in urlopen return opener.open(url, data, timeout) File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/urllib/request.py", line 526, in open response = self._open(req, data) File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/urllib/request.py", line 544, in _open '_open', req) File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/urllib/request.py", line 504, in _call_chain result = func(*args) File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/urllib/request.py", line 1361, in https_open context=self._context, check_hostname=self._check_hostname) File "/home/rb/anaconda3/envs/tensorflow-gpu/lib/python3.6/urllib/request.py", line 1320, in do_open raise URLError(err) urllib.error.URLError: <urlopen error [Errno 111] Connection refused>

0xicingdeath commented 3 years ago

Hey @taylorgag, thanks for providing this. I've been investigating these error messages, and it suggests it may be a bug introduced in our 0.2.1 release. Can you try downgrading to 0.2.0 and let me know if this helps (if you do not need solc-versions less than 0.4.9)?

pip3 uninstall solc-select 
pip3 install solc-select==0.2.0
solc-select install 
taylorgag commented 3 years ago

Hey @taylorgag, thanks for providing this. I've been investigating these error messages, and it suggests it may be a bug introduced in our 0.2.1 release. Can you try downgrading to 0.2.0 and let me know if this helps (if you do not need solc-versions less than 0.4.9)?

pip3 uninstall solc-select 
pip3 install solc-select==0.2.0
solc-select install 

Actually, when I use the following command pip3 uninstall solc-select pip3 install solc-select==0.2.0 solc-select install its outputs are: Defaulting to user installation because normal site-packages is not writeable WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f4bdd458dd8>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /simple/solc-select/ WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f4bdd458b38>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /simple/solc-select/ WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f4bdd462320>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/solc-select/ Collecting solc-select==0.2.0 WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f4bdcd63198>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /packages/5f/f7/cd065cf25eb8d3d84754554a0d8c3223ab7a1bd64c0c85c5f7aecb366d38/solc_select-0.2.0-py3-none-any.whl WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f4bdcd63390>, 'Connection to files.pythonhosted.org timed out. (connect timeout=15)')': /packages/5f/f7/cd065cf25eb8d3d84754554a0d8c3223ab7a1bd64c0c85c5f7aecb366d38/solc_select-0.2.0-py3-none-any.whl WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f4bdcd63518>, 'Connection to files.pythonhosted.org timed out. (connect timeout=15)')': /packages/5f/f7/cd065cf25eb8d3d84754554a0d8c3223ab7a1bd64c0c85c5f7aecb366d38/solc_select-0.2.0-py3-none-any.whl WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f4bdcd636a0>, 'Connection to files.pythonhosted.org timed out. (connect timeout=15)')': /packages/5f/f7/cd065cf25eb8d3d84754554a0d8c3223ab7a1bd64c0c85c5f7aecb366d38/solc_select-0.2.0-py3-none-any.whl WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f4bdcd63828>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /packages/5f/f7/cd065cf25eb8d3d84754554a0d8c3223ab7a1bd64c0c85c5f7aecb366d38/solc_select-0.2.0-py3-none-any.whl ERROR: Could not install packages due to an OSError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/5f/f7/cd065cf25eb8d3d84754554a0d8c3223ab7a1bd64c0c85c5f7aecb366d38/solc_select-0.2.0-py3-none-any.whl (Caused by NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f4bdcd639b0>: Failed to establish a new connection: [Errno 101] Network is unreachable',))

so I change the command and use the following command and it works. python3 -m pip install solc-select==0.2.0 when I use the command solc-select install its output is : Available versions to install: 0.4.10 0.4.11 0.4.12 0.4.13 0.4.14 0.4.15 0.4.16 0.4.17 0.4.18 0.4.19 0.4.20 0.4.21 0.4.22 0.4.23 0.4.24 0.4.25 0.4.26 0.5.0 0.5.1 0.5.10 0.5.11 0.5.12 0.5.13 0.5.14 0.5.15 0.5.16 0.5.17 0.5.2 0.5.3 0.5.4 0.5.5 0.5.6 0.5.7 0.5.8 0.5.9 0.6.0 0.6.1 0.6.10 0.6.11 0.6.12 0.6.2 0.6.3 0.6.4 0.6.5 0.6.6 0.6.7 0.6.8 0.6.9 0.7.0 0.7.1 0.7.2 0.7.3 0.7.4 0.7.5 0.7.6 0.8.0 0.8.1 0.8.2 0.8.3 0.8.4 0.8.5 0.8.6 0.8.7