LUCIT-Systems-and-Development / unicorn-binance-websocket-api

A Python SDK by LUCIT to use the Binance Websocket API`s (com+testnet, com-margin+testnet, com-isolated_margin+testnet, com-futures+testnet, com-coin_futures, us, tr, dex/chain+testnet) in a simple, fast, flexible, robust and fully-featured way.
https://unicorn-binance-websocket-api.docs.lucit.tech/
Other
692 stars 164 forks source link

"TypeError: 'type' object is not subscriptable" Error while importing unicorn_binance_websocket_api #311

Closed vinay1407 closed 1 year ago

vinay1407 commented 1 year ago

Version of this library.


from unicorn_binance_websocket_api import BinanceWebSocketApiManager
  File "/home/botchedbot/miniconda3/lib/python3.8/site-packages/unicorn_binance_websocket_api/__init__.py", line 3, in <module>
    from unicorn_binance_websocket_api.manager import BinanceWebSocketApiManager
  File "/home/botchedbot/miniconda3/lib/python3.8/site-packages/unicorn_binance_websocket_api/manager.py", line 41, in <module>
    from unicorn_binance_websocket_api.connection_settings import CEX_EXCHANGES, DEX_EXCHANGES, CONNECTION_SETTINGS
  File "/home/botchedbot/miniconda3/lib/python3.8/site-packages/unicorn_binance_websocket_api/connection_settings.py", line 44, in <module>
    CONNECTION_SETTINGS: dict[str, Tuple[MAX_SUBSCRIPTIONS_PER_STREAM, RESTFUL_BASE_URI, RESTFUL_PATH_USERDATA, WEBSOCKET_BASE_URI]] = {
TypeError: 'type' object is not subscriptable

python 3.8, unicorn_binance_websocket_api 1.43.2

Solution to Issue cannot be found in the documentation or other Issues and also occurs in the latest version of this library.

Hardware?

Local server/workstation

Operating System?

Linux

Python version?

Python3.8

Installed packages

# packages in environment at /home/botchedbot/miniconda3:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main
_openmp_mutex             5.1                       1_gnu
aniso8601                 9.0.1              pyhd8ed1ab_0    conda-forge
appdirs                   1.4.4              pyhd3eb1b0_0
atk-1.0                   2.36.0               ha1a6a79_0
attrs                     22.2.0                   pypi_0    pypi
blas                      1.0                         mkl
boltons                   23.0.0             pyhd8ed1ab_0    conda-forge
boost-cpp                 1.73.0              h7f8727e_12
bottleneck                1.3.5            py38h7deecbd_0
brotli                    1.0.9                h5eee18b_7
brotli-bin                1.0.9                h5eee18b_7
brotlipy                  0.7.0           py38h27cfd23_1003
bzip2                     1.0.8                h7b6447c_0
c-ares                    1.19.0               h5eee18b_0
ca-certificates           2023.01.10           h06a4308_0
cairo                     1.16.0               hb05425b_4
catboost                  1.0.6            py38h06a4308_1
certifi                   2022.12.7        py38h06a4308_0
cffi                      1.15.1           py38h5eee18b_3
charset-normalizer        2.0.4              pyhd3eb1b0_0
cheroot                   9.0.0              pyhd8ed1ab_0    conda-forge
click                     8.1.3           unix_pyhd8ed1ab_2    conda-forge
colorama                  0.4.6              pyhd8ed1ab_0    conda-forge
conda                     23.3.0           py38h06a4308_0
conda-content-trust       0.1.3            py38h06a4308_0
conda-package-handling    2.0.2            py38h06a4308_0
conda-package-streaming   0.7.0            py38h06a4308_0
contourpy                 1.0.5            py38hdb19cb5_0
cryptography              38.0.4           py38h9ce1e76_0
cycler                    0.11.0             pyhd3eb1b0_0
expat                     2.4.9                h6a678d5_0
flask                     1.1.2              pyh9f0ad1d_0    conda-forge
flask-restful             0.3.9              pyhd8ed1ab_0    conda-forge
font-ttf-dejavu-sans-mono 2.37                 hd3eb1b0_0
font-ttf-inconsolata      2.001                hcb22688_0
font-ttf-source-code-pro  2.030                hd3eb1b0_0
font-ttf-ubuntu           0.83                 h8b1ccd4_0
fontconfig                2.14.1               h4c34cd2_2
fonts-anaconda            1                    h8fa9717_0
fonts-conda-ecosystem     1                    hd3eb1b0_0
fonttools                 4.25.0             pyhd3eb1b0_0
freetype                  2.12.1               h4a9f257_0
fribidi                   1.0.10               h7b6447c_0
gdk-pixbuf                2.42.10              h5eee18b_0
giflib                    5.2.1                h5eee18b_3
glib                      2.69.1               he621ea3_2
gobject-introspection     1.72.0           py38hbb6d50b_2
google-api-core           2.11.0                   pypi_0    pypi
google-auth               2.17.0                   pypi_0    pypi
google-cloud-compute      1.11.0                   pypi_0    pypi
google-cloud-core         2.3.2                    pypi_0    pypi
google-cloud-storage      2.7.0                    pypi_0    pypi
google-resumable-media    2.4.1                    pypi_0    pypi
googleapis-common-protos  1.59.0                   pypi_0    pypi
graphite2                 1.3.14               h295c915_1
graphviz                  2.50.0               h1b29801_1
gtk2                      2.24.33              h73c1081_2
gts                       0.7.6                hb67d8dd_3
harfbuzz                  4.3.0                hf52aaf7_1
icu                       58.2                 he6710b0_3
idna                      3.4              py38h06a4308_0
importlib_resources       5.2.0              pyhd3eb1b0_1
intel-openmp              2021.4.0          h06a4308_3561
itsdangerous              2.1.2              pyhd8ed1ab_0    conda-forge
jaraco.functools          3.6.0              pyhd8ed1ab_0    conda-forge
jinja2                    2.11.3             pyhd8ed1ab_2    conda-forge
jpeg                      9e                   h5eee18b_1
kiwisolver                1.4.4            py38h6a678d5_0
krb5                      1.19.4               h568e23c_0
lcms2                     2.12                 h3be6417_0
ld_impl_linux-64          2.38                 h1181459_1
lerc                      3.0                  h295c915_0
libboost                  1.73.0              h28710b8_12
libbrotlicommon           1.0.9                h5eee18b_7
libbrotlidec              1.0.9                h5eee18b_7
libbrotlienc              1.0.9                h5eee18b_7
libcurl                   7.88.1               h91b91d3_0
libdeflate                1.17                 h5eee18b_0
libedit                   3.1.20221030         h5eee18b_0
libev                     4.33                 h7f8727e_1
libffi                    3.4.2                h6a678d5_6
libgcc-ng                 11.2.0               h1234567_1
libgd                     2.3.3                h6a678d5_2
libgfortran-ng            11.2.0               h00389a5_1
libgfortran5              11.2.0               h1234567_1
libgomp                   11.2.0               h1234567_1
libiconv                  1.16                 h7f8727e_2
libnghttp2                1.46.0               hce63b2e_0
libpng                    1.6.39               h5eee18b_0
librsvg                   2.54.4               h36cc946_3
libssh2                   1.10.0               h8f2d780_0
libstdcxx-ng              11.2.0               h1234567_1
libtiff                   4.5.0                h6a678d5_2
libtool                   2.4.6             h6a678d5_1009
libuuid                   1.41.5               h5eee18b_0
libwebp                   1.2.4                h11a3e52_1
libwebp-base              1.2.4                h5eee18b_1
libxcb                    1.15                 h7f8727e_0
libxml2                   2.10.3               hcbfbd50_0
lz4-c                     1.9.4                h6a678d5_0
markupsafe                1.1.1            py38h497a2fe_3    conda-forge
matplotlib-base           3.7.1            py38h417a72b_1
mkl                       2021.4.0           h06a4308_640
mkl-service               2.4.0            py38h7f8727e_0
mkl_fft                   1.3.1            py38hd3c417c_0
mkl_random                1.2.2            py38h51133e4_0
more-itertools            9.1.0              pyhd8ed1ab_0    conda-forge
munkres                   1.1.4                      py_0
ncurses                   6.4                  h6a678d5_0
ninja                     1.10.2               h06a4308_5
ninja-base                1.10.2               hd09550d_5
nspr                      4.33                 h295c915_0
nss                       3.74                 h0370c37_0
numexpr                   2.8.4            py38he184ba9_0
numpy                     1.23.5           py38h14f4228_0
numpy-base                1.23.5           py38h31eccc5_0
openjpeg                  2.4.0                h3ad879b_0
openssl                   1.1.1t               h7f8727e_0
packaging                 23.0               pyhd8ed1ab_0    conda-forge
pandas                    1.4.4            py38h6a678d5_0
pango                     1.50.7               h05da053_0
pcre                      8.45                 h295c915_0
pillow                    9.4.0            py38h6a678d5_0
pip                       22.3.1           py38h06a4308_0
pixman                    0.40.0               h7f8727e_1
plotly                    5.9.0            py38h06a4308_0
pluggy                    1.0.0            py38h06a4308_1
pooch                     1.4.0              pyhd3eb1b0_0
poppler                   22.12.0              h381b16e_0
poppler-data              0.4.11               h06a4308_1
proto-plus                1.22.2                   pypi_0    pypi
protobuf                  4.22.1                   pypi_0    pypi
psutil                    5.9.0            py38h5eee18b_0
pyasn1                    0.4.8                    pypi_0    pypi
pyasn1-modules            0.2.8                    pypi_0    pypi
pycosat                   0.6.4            py38h5eee18b_0
pycparser                 2.21               pyhd3eb1b0_0
pyopenssl                 22.0.0             pyhd3eb1b0_0
pyparsing                 3.0.9            py38h06a4308_0
pysocks                   1.7.1            py38h06a4308_0
python                    3.8.16               h7a1cb2a_2
python-dateutil           2.8.2              pyhd8ed1ab_0    conda-forge
python-graphviz           0.20.1           py38h06a4308_0
python_abi                3.8                      2_cp38    conda-forge
pytz                      2023.2             pyhd8ed1ab_0    conda-forge
readline                  8.2                  h5eee18b_0
requests                  2.28.1           py38h06a4308_0
ruamel.yaml               0.17.21          py38h5eee18b_0
ruamel.yaml.clib          0.2.6            py38h5eee18b_1
scipy                     1.10.0           py38h14f4228_1
setuptools                65.6.3           py38h06a4308_0
six                       1.16.0             pyhd3eb1b0_1
sqlite                    3.40.1               h5082296_0
tenacity                  8.0.1            py38h06a4308_1
tk                        8.6.12               h1ccaba5_0
toolz                     0.12.0           py38h06a4308_0
tqdm                      4.64.1           py38h06a4308_0
ujson                     1.35            py38hadf7658_1003    conda-forge
unicorn-binance-websocket-api 1.43.2             pyhd8ed1ab_1    conda-forge
unicorn-fy                0.12.2             pyhd8ed1ab_0    conda-forge
urllib3                   1.26.14          py38h06a4308_0
websocket-client          1.5.1              pyhd8ed1ab_0    conda-forge
websockets                9.1                      pypi_0    pypi
werkzeug                  2.1.2              pyhd8ed1ab_1    conda-forge
wheel                     0.37.1             pyhd3eb1b0_0
xz                        5.2.10               h5eee18b_1
zipp                      3.11.0           py38h06a4308_0
zlib                      1.2.13               h5eee18b_0
zstandard                 0.18.0           py38h5eee18b_0
zstd                      1.5.4                hc292b87_0

Logging output

No response

Processing method?

stream_buffer

Used endpoint?

concerns all

Issue

I installed unicorn_binance_websocket_api without any errors but not able to import the library.

oliver-zehentleitner commented 1 year ago

I think i found the reason, I will prepare a new package within the next hour.

oliver-zehentleitner commented 1 year ago

Please update to: https://github.com/LUCIT-Systems-and-Development/unicorn-binance-websocket-api/releases/tag/1.43.3

oliver-zehentleitner commented 1 year ago

I close this, feel free to reopen if needed!