KevinFasusi/supplychainpy

Jupyter compatibility

KonZoX opened this issue · 1 comments

On trying to import a block 'analyse' from 'supplychainpy.model_inventory ' an error occurs:

' File "C:\Users\User\Anaconda2\lib\site-packages\supplychainpy-0.0.4-py2.7-win-amd64.egg\supplychainpy\model_inventory.py", line 54
def analyse(currency: str, z_value: Decimal = 1.28, reorder_cost: Decimal = 10, interval_length: int = 12,
^
SyntaxError: invalid syntax'

The code is not typical for Python
How could this problem be fixed?

Hi HelloWorldManiac,

From the error message it looks like your are using Python 2.7. Is that correct? The library works with python >=3.5. Since it looks like you are using Anaconda on Windows, please create a new environment. You can use powershell to run the following (substituting <name-env> for a name of your choice) :

PS C:\> conda create -n <name-env> python=3.5

Activate this new environment:

PS C:\> activate <name-env>

PS C:\> pip install supplychainpy

Jupyter may already be installed, if not then:

PS C:\> pip install jupyter

Now launch the Jupyter Notebook again and see if you get the same error message.

If you are using the reporting feature you will also need to install textblob:

PS C:\> pip install textblob

PS C:\> pyton -m textblob.download_corpora