hzjken / crypto-arbitrage-framework

A cryptocurrency arbitrage framework implemented with ccxt and cplex. It can be used to monitor multiple exchanges, find a multi-lateral arbitrage path which maximizes rate of return, calculate the optimal trading amount for each pair in the path given flexible constraints, and execute trades with multi-threading implemenation.
552 stars 172 forks source link

attempted relative import with no known parent package #6

Open shlx17 opened 4 years ago

shlx17 commented 4 years ago

Hi there Thank you for this wonderful work. I was recently trying to install the script. Unfortunately, I stumbled upon a terminal error message, that looks as given below.

It would be great if someone could give me a hint how to solve this issue.

shlx@ubntqnap64:~/Dokumente/crypto-arbitrage-framework-master/crypto$ python3 main.py

Traceback (most recent call last):
  File "main.py", line 2, in <module>
    from path_optimizer import PathOptimizer
  File "/home/shlx/Dokumente/crypto-arbitrage-framework-master/crypto/path_optimizer.py", line 4, in <module>
    from .info import fiat, trading_fee, tokens
ImportError: attempted relative import with no known parent package
murchelon commented 4 years ago

Im also getting an similar errror, related to import:

from crypto.exchanges import exchanges

The line above fails with the following error:

F:\GITREP\crypto-arbitrage-framework>C:/Python38/python.exe f:/GITREP/crypto-arbitrage-framework/crypto/main.py Traceback (most recent call last): File "f:/GITREP/crypto-arbitrage-framework/crypto/main.py", line 1, in from crypto.exchanges import exchanges ModuleNotFoundError: No module named 'crypto'

Oh ! and WHAT A GREAT PIECE OF WORK ! Its amazing code.. thanks a lot !

pepper-live commented 3 years ago

@murchelon Did you manage to get past this error? I found that you need to create a subdirectory named "crypto" and copy all the code except for main.py and then it works.