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

Support Python 3.11 #160

Closed
oberstet opened this issue May 19, 2022 · 1 comment · Fixed by #212
Closed

Support Python 3.11 #160

oberstet opened this issue May 19, 2022 · 1 comment · Fixed by #212

Comments

@oberstet
Copy link

What was wrong?

Doesn't install on Python 3.11 from master branch

Code that produced the error

pip install .

Full error output

(cpy311b1_1) (base) oberstet@intel-nuci7:~/scm/crossbario/eth-account$ pip install .
Processing /home/oberstet/scm/crossbario/eth-account
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting eth-keys<0.5,>=0.4.0
  Using cached eth_keys-0.4.0-py3-none-any.whl (21 kB)
Collecting bitarray<1.3.0,>=1.2.1
  Using cached bitarray-1.2.2.tar.gz (48 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: hexbytes<1,>=0.1.0 in /home/oberstet/cpy311b1_1/lib/python3.11/site-packages (from eth-account==0.6.1) (0.2.2)
Requirement already satisfied: eth-utils<3,>=2.0.0 in /home/oberstet/cpy311b1_1/lib/python3.11/site-packages (from eth-account==0.6.1) (2.0.0)
Collecting eth-keyfile<0.7.0,>=0.6.0
  Using cached eth_keyfile-0.6.0-py3-none-any.whl (6.6 kB)
Requirement already satisfied: eth-abi<4,>=3.0.0 in /home/oberstet/cpy311b1_1/lib/python3.11/site-packages (from eth-account==0.6.1) (3.0.0)
Collecting eth-rlp<1,>=0.3.0
  Using cached eth_rlp-0.3.0-py3-none-any.whl (5.0 kB)
Collecting rlp<4,>=1.0.0
  Using cached rlp-3.0.0-py2.py3-none-any.whl (20 kB)
Requirement already satisfied: eth-typing<4.0.0,>=3.0.0 in /home/oberstet/cpy311b1_1/lib/python3.11/site-packages (from eth-abi<4,>=3.0.0->eth-account==0.6.1) (3.1.0)
Requirement already satisfied: parsimonious<0.9.0,>=0.8.0 in /home/oberstet/cpy311b1_1/lib/python3.11/site-packages (from eth-abi<4,>=3.0.0->eth-account==0.6.1) (0.8.1)
Requirement already satisfied: pycryptodome<4,>=3.6.6 in /home/oberstet/cpy311b1_1/lib/python3.11/site-packages (from eth-keyfile<0.7.0,>=0.6.0->eth-account==0.6.1) (3.14.1)
Requirement already satisfied: eth-hash<0.4.0,>=0.3.1 in /home/oberstet/cpy311b1_1/lib/python3.11/site-packages (from eth-utils<3,>=2.0.0->eth-account==0.6.1) (0.3.2)
Requirement already satisfied: cytoolz<1.0.0,>=0.10.1 in /home/oberstet/cpy311b1_1/lib/python3.11/site-packages (from eth-utils<3,>=2.0.0->eth-account==0.6.1) (0.11.2)
Requirement already satisfied: toolz>=0.8.0 in /home/oberstet/cpy311b1_1/lib/python3.11/site-packages (from cytoolz<1.0.0,>=0.10.1->eth-utils<3,>=2.0.0->eth-account==0.6.1) (0.11.2)
Requirement already satisfied: six>=1.9.0 in /home/oberstet/cpy311b1_1/lib/python3.11/site-packages (from parsimonious<0.9.0,>=0.8.0->eth-abi<4,>=3.0.0->eth-account==0.6.1) (1.16.0)
Building wheels for collected packages: eth-account, bitarray
  Building wheel for eth-account (pyproject.toml) ... done
  Created wheel for eth-account: filename=eth_account-0.6.1-py3-none-any.whl size=103555 sha256=39dcb982e910105a1331e434fc16fbcf0ca87a664fa20af26cceb7877eb78299
  Stored in directory: /home/oberstet/.cache/pip/wheels/e3/67/b2/f6d2b1992ec550947fb06293545e4a6f8d9ff653e001bb68bf
  Building wheel for bitarray (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [58 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.11
      creating build/lib.linux-x86_64-3.11/bitarray
      copying bitarray/__init__.py -> build/lib.linux-x86_64-3.11/bitarray
      copying bitarray/test_util.py -> build/lib.linux-x86_64-3.11/bitarray
      copying bitarray/util.py -> build/lib.linux-x86_64-3.11/bitarray
      copying bitarray/test_bitarray.py -> build/lib.linux-x86_64-3.11/bitarray
      running build_ext
      building 'bitarray._bitarray' extension
      creating build/temp.linux-x86_64-3.11
      creating build/temp.linux-x86_64-3.11/bitarray
      gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/home/oberstet/cpy311b1_1/include -I/home/oberstet/cpy311b1/include/python3.11 -c bitarray/_bitarray.c -o build/temp.linux-x86_64-3.11/bitarray/_bitarray.o
      bitarray/_bitarray.c: In function ‘resize’:
      bitarray/_bitarray.c:126:23: error: lvalue required as left operand of assignment
        126 |         Py_SIZE(self) = newsize;
            |                       ^
      bitarray/_bitarray.c:151:19: error: lvalue required as left operand of assignment
        151 |     Py_SIZE(self) = newsize;
            |                   ^
      bitarray/_bitarray.c: In function ‘newbitarrayobject’:
      bitarray/_bitarray.c:172:18: error: lvalue required as left operand of assignment
        172 |     Py_SIZE(obj) = nbytes;
            |                  ^
      bitarray/_bitarray.c: In function ‘bitarray_fromfile’:
      bitarray/_bitarray.c:1429:5: warning: ‘PyEval_CallObjectWithKeywords’ is deprecated [-Wdeprecated-declarations]
       1429 |     result = PyEval_CallObject(reader, rargs);
            |     ^~~~~~
      In file included from /home/oberstet/cpy311b1/include/python3.11/Python.h:95,
                       from bitarray/_bitarray.c:12:
      /home/oberstet/cpy311b1/include/python3.11/ceval.h:27:43: note: declared here
         27 | Py_DEPRECATED(3.9) PyAPI_FUNC(PyObject *) PyEval_CallObjectWithKeywords(
            |                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      bitarray/_bitarray.c: In function ‘bitarray_tofile’:
      bitarray/_bitarray.c:1568:5: warning: ‘PyEval_CallObjectWithKeywords’ is deprecated [-Wdeprecated-declarations]
       1568 |     result = PyEval_CallObject(writer, args);
            |     ^~~~~~
      In file included from /home/oberstet/cpy311b1/include/python3.11/Python.h:95,
                       from bitarray/_bitarray.c:12:
      /home/oberstet/cpy311b1/include/python3.11/ceval.h:27:43: note: declared here
         27 | Py_DEPRECATED(3.9) PyAPI_FUNC(PyObject *) PyEval_CallObjectWithKeywords(
            |                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      bitarray/_bitarray.c: In function ‘PyInit__bitarray’:
      bitarray/_bitarray.c:3273:28: error: lvalue required as left operand of assignment
       3273 |     Py_TYPE(&Bitarraytype) = &PyType_Type;
            |                            ^
      bitarray/_bitarray.c:3274:31: error: lvalue required as left operand of assignment
       3274 |     Py_TYPE(&SearchIter_Type) = &PyType_Type;
            |                               ^
      bitarray/_bitarray.c:3275:31: error: lvalue required as left operand of assignment
       3275 |     Py_TYPE(&DecodeIter_Type) = &PyType_Type;
            |                               ^
      bitarray/_bitarray.c:3276:33: error: lvalue required as left operand of assignment
       3276 |     Py_TYPE(&BitarrayIter_Type) = &PyType_Type;
            |                                 ^
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for bitarray
  Running setup.py clean for bitarray
Successfully built eth-account
Failed to build bitarray
Installing collected packages: bitarray, rlp, eth-keys, eth-rlp, eth-keyfile, eth-account
  Attempting uninstall: bitarray
    Found existing installation: bitarray 2.6.0
    Uninstalling bitarray-2.6.0:
      Successfully uninstalled bitarray-2.6.0
  Running setup.py install for bitarray ... error
  error: subprocess-exited-with-error
  
  × Running setup.py install for bitarray did not run successfully.
  │ exit code: 1
  ╰─> [58 lines of output]
      running install
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.11
      creating build/lib.linux-x86_64-3.11/bitarray
      copying bitarray/__init__.py -> build/lib.linux-x86_64-3.11/bitarray
      copying bitarray/test_util.py -> build/lib.linux-x86_64-3.11/bitarray
      copying bitarray/util.py -> build/lib.linux-x86_64-3.11/bitarray
      copying bitarray/test_bitarray.py -> build/lib.linux-x86_64-3.11/bitarray
      running build_ext
      building 'bitarray._bitarray' extension
      creating build/temp.linux-x86_64-3.11
      creating build/temp.linux-x86_64-3.11/bitarray
      gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/home/oberstet/cpy311b1_1/include -I/home/oberstet/cpy311b1/include/python3.11 -c bitarray/_bitarray.c -o build/temp.linux-x86_64-3.11/bitarray/_bitarray.o
      bitarray/_bitarray.c: In function ‘resize’:
      bitarray/_bitarray.c:126:23: error: lvalue required as left operand of assignment
        126 |         Py_SIZE(self) = newsize;
            |                       ^
      bitarray/_bitarray.c:151:19: error: lvalue required as left operand of assignment
        151 |     Py_SIZE(self) = newsize;
            |                   ^
      bitarray/_bitarray.c: In function ‘newbitarrayobject’:
      bitarray/_bitarray.c:172:18: error: lvalue required as left operand of assignment
        172 |     Py_SIZE(obj) = nbytes;
            |                  ^
      bitarray/_bitarray.c: In function ‘bitarray_fromfile’:
      bitarray/_bitarray.c:1429:5: warning: ‘PyEval_CallObjectWithKeywords’ is deprecated [-Wdeprecated-declarations]
       1429 |     result = PyEval_CallObject(reader, rargs);
            |     ^~~~~~
      In file included from /home/oberstet/cpy311b1/include/python3.11/Python.h:95,
                       from bitarray/_bitarray.c:12:
      /home/oberstet/cpy311b1/include/python3.11/ceval.h:27:43: note: declared here
         27 | Py_DEPRECATED(3.9) PyAPI_FUNC(PyObject *) PyEval_CallObjectWithKeywords(
            |                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      bitarray/_bitarray.c: In function ‘bitarray_tofile’:
      bitarray/_bitarray.c:1568:5: warning: ‘PyEval_CallObjectWithKeywords’ is deprecated [-Wdeprecated-declarations]
       1568 |     result = PyEval_CallObject(writer, args);
            |     ^~~~~~
      In file included from /home/oberstet/cpy311b1/include/python3.11/Python.h:95,
                       from bitarray/_bitarray.c:12:
      /home/oberstet/cpy311b1/include/python3.11/ceval.h:27:43: note: declared here
         27 | Py_DEPRECATED(3.9) PyAPI_FUNC(PyObject *) PyEval_CallObjectWithKeywords(
            |                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      bitarray/_bitarray.c: In function ‘PyInit__bitarray’:
      bitarray/_bitarray.c:3273:28: error: lvalue required as left operand of assignment
       3273 |     Py_TYPE(&Bitarraytype) = &PyType_Type;
            |                            ^
      bitarray/_bitarray.c:3274:31: error: lvalue required as left operand of assignment
       3274 |     Py_TYPE(&SearchIter_Type) = &PyType_Type;
            |                               ^
      bitarray/_bitarray.c:3275:31: error: lvalue required as left operand of assignment
       3275 |     Py_TYPE(&DecodeIter_Type) = &PyType_Type;
            |                               ^
      bitarray/_bitarray.c:3276:33: error: lvalue required as left operand of assignment
       3276 |     Py_TYPE(&BitarrayIter_Type) = &PyType_Type;
            |                                 ^
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  WARNING: No metadata found in /home/oberstet/cpy311b1_1/lib/python3.11/site-packages
  Rolling back uninstall of bitarray
  Moving to /home/oberstet/cpy311b1_1/lib/python3.11/site-packages/bitarray-2.6.0.dist-info/
   from /home/oberstet/cpy311b1_1/lib/python3.11/site-packages/~itarray-2.6.0.dist-info
  Moving to /home/oberstet/cpy311b1_1/lib/python3.11/site-packages/bitarray/
   from /home/oberstet/cpy311b1_1/lib/python3.11/site-packages/~itarray
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> bitarray

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
WARNING: You are using pip version 22.0.4; however, version 22.1 is available.
You should consider upgrading via the '/home/oberstet/cpy311b1_1/bin/python3 -m pip install --upgrade pip' command.

Environment

Python 3.11.0b1 on Linux

How can it be fixed?

Adjust version dependency limits:

(cpy311b1_1) (base) oberstet@intel-nuci7:~/scm/crossbario/eth-account$ git diff
diff --git a/setup.py b/setup.py
index 96f333e..7955bfb 100644
--- a/setup.py
+++ b/setup.py
@@ -61,7 +61,7 @@ setup(
         "hdaccount/wordlist/*.txt",
     ]},
     install_requires=[
-        "bitarray>=1.2.1,<1.3.0",
+        "bitarray>=2.6.0,<3",
         "eth-abi>=3.0.0,<4",
         "eth-keyfile>=0.6.0,<0.7.0",
         "eth-keys>=0.4.0,<0.5",
@jfb
Copy link

jfb commented Oct 25, 2022

test code python version: 3.11.0

from eth_account import Account

failed

Traceback (most recent call last):
  File "E:\repo\py11\test.py", line 3, in <module>
    from eth_account import Account
  File "E:\repo\py11\.venv\Lib\site-packages\eth_account\__init__.py", line 1, in <module>
    from eth_account.account import (
  File "E:\repo\py11\.venv\Lib\site-packages\eth_account\account.py", line 71, in <module>
    from eth_account.messages import (
  File "E:\repo\py11\.venv\Lib\site-packages\eth_account\messages.py", line 25, in <module>
    from eth_account._utils.structured_data.hashing import (
  File "E:\repo\py11\.venv\Lib\site-packages\eth_account\_utils\structured_data\hashing.py", line 9, in <module>
    from eth_abi import (
  File "E:\repo\py11\.venv\Lib\site-packages\eth_abi\__init__.py", line 3, in <module>
    from eth_abi.abi import (  # NOQA
  File "E:\repo\py11\.venv\Lib\site-packages\eth_abi\abi.py", line 1, in <module>
    from eth_abi.codec import (
  File "E:\repo\py11\.venv\Lib\site-packages\eth_abi\codec.py", line 16, in <module>
    from eth_abi.decoding import (
  File "E:\repo\py11\.venv\Lib\site-packages\eth_abi\decoding.py", line 14, in <module>
    from eth_abi.base import (
  File "E:\repo\py11\.venv\Lib\site-packages\eth_abi\base.py", line 7, in <module>
    from .grammar import (
  File "E:\repo\py11\.venv\Lib\site-packages\eth_abi\grammar.py", line 4, in <module>
    import parsimonious
  File "E:\repo\py11\.venv\Lib\site-packages\parsimonious\__init__.py", line 9, in <module>
    from parsimonious.grammar import Grammar, TokenGrammar
  File "E:\repo\py11\.venv\Lib\site-packages\parsimonious\grammar.py", line 14, in <module>
    from parsimonious.expressions import (Literal, Regex, Sequence, OneOf,
  File "E:\repo\py11\.venv\Lib\site-packages\parsimonious\expressions.py", line 9, in <module>
    from inspect import getargspec
ImportError: cannot import name 'getargspec' from 'inspect' (D:\py\311\Lib\inspect.py)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants