KevinFasusi / supplychainpy

Supplychainpy is a Python library for supply chain analysis, modelling and simulation. The library assists a workflow that is reliant on Excel and VBA.
http://www.supplychainpy.org/
BSD 3-Clause "New" or "Revised" License
283 stars 99 forks source link

Jupyter compatibility #47

Closed KonZoX closed 7 years ago

KonZoX commented 7 years ago

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?

KevinFasusi commented 7 years ago

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