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
683 stars 164 forks source link

No module named 'unicorn_binance_websocket_api.unicorn_binance_websocket_api_exceptions' #85

Closed magnito2 closed 3 years ago

magnito2 commented 4 years ago

Check this or we will delete your issue. (fill in the checkbox with an X like so: [x])

Select one:

Environment

Operating System? (include version)

Python Version Requirement

Exact Python Version?

Python3 version 3.8.0a4

Pip Version?

pip 20.1.1

Dependencies

Run pip list > pip_list.txt and upload the file.

UNICORN Binance WebSocket API Version?

Did you upgrade to the latest release version with `pip install unicorn-binance-websocket-api --upgrade`?

Please control what version you are using with this script and post the output: https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api/blob/master/tools/get_used_module_version.py

(venv2) C:\projects\binancetoy>python test.py
Traceback (most recent call last):
  File "test.py", line 36, in <module>
    from unicorn_binance_websocket_api.unicorn_binance_websocket_api_manager import BinanceWebSocketApiManager
  File "C:\projects\binancetoy\venv2\Scripts\unicorn_binance_websocket_api.py", line 36, in <module>
    from unicorn_binance_websocket_api.unicorn_binance_websocket_api_exceptions import *
ModuleNotFoundError: No module named 'unicorn_binance_websocket_api.unicorn_binance_websocket_api_exceptions'; 'unicorn_binance_websocket_api' is not a package

Description of your issue

Similar to Issue #79, which is currently closed.  

The module runs fine in anaconda, but throws the error when run in a virtual environment created by virtualenv. 

pip_list.txt

oliver-zehentleitner commented 4 years ago

Hello! Does anyone know a solution for that? Best regards, Oliver

oliver-zehentleitner commented 4 years ago

https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api/issues/79

oliver-zehentleitner commented 4 years ago

Is this file https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api/blob/master/unicorn_binance_websocket_api.py in the virtual env existent?

If yes, could you please move the row with

from unicorn_binance_websocket_api.unicorn_binance_websocket_api_exceptions import *

to the bottom of the file?

If you call the lib again, what is the error msg? Still "...exceptions" or is it then "...connections" or does it maybe solve the problem?

uggel commented 4 years ago

I just moved that row one step and then it complained about: No module named 'unicorn_binance_websocket_api.unicorn_binance_websocket_api_connection'; 'unicorn_binance_websocket_api' is not a package

Now... looking into my venv/bin-folder I see that it contains unicorn_binance_websocket_api. I'm no expert but I think that is wrong. The bin folder should contain python scripts.

unicorn_binance_websocket_api is supposed to be used as a module, but it's not a module since there is no init.py in the bin-folder (and there should'nt be either).

The reason it works for some, is that they have set their the bin-folder of their virtual environment in the PATH.

The right way to do this, I believe, is to move the imports into the init.py file. I'll make a PR.

oliver-zehentleitner commented 4 years ago

Can you please test the 1.16.6 release and tell me if this issue is fixed?

Thank you!

uggel commented 4 years ago

Yes it is, but now we have to do the same thing to unicorn_fy

oliver-zehentleitner commented 4 years ago

Thanks! Do you want to create a PR for unicorn_fy? You solved the problem for others, this way you are added to the contributors list of unicorn_fy too!

Soralis commented 3 years ago

I got the same Problem on a raspberry 3 b+, when i try to autostart it after a reboot. Works fine in thonny tho.

i already have the newest version and run Buster

oliver-zehentleitner commented 3 years ago

The initial issue is solved with the update. So your issue is a new one!

Please open a new issue and provide the requested answers and help us to reproduce your issue with details of your system.