PyCh is a Python package based on SimPy for discrete-event simulation. It is a tool developed for the course "Analysis of production systems" (4DC10). PyCh is a port of Chi3.
- Tutorials chapter 1 - 10 contain the tutorial on how to use PyCh
- Offline_PyCh_tutorial2022 contains the tutorial in PDF format (for reference)
- Assignment.ipynb contains the jupyter notebook for the course assignment.
- LectureNotesExamples.ipynb - contains the jupyter notebook of all models used in the lecture notes
- LectureSlidesExamples.ipynb - contains the jupyter notebook of all models used in the lecture slides
- Download and install the latest version of anaconda
- https://www.anaconda.com/products/individual
- Note that you can
Skip registration
if you don't want to provide your email address.
For Windows
- Open an
Anaconda prompt (Anaconda3)
(you can type it in the windows bar below), and enter the following commands:conda create --name pychEnv
- Enter
y
(for yes)
- Enter
conda activate pychEnv
conda install git pip ipykernel
- Enter
y
(for yes)
- Enter
python -m ipykernel install --user --name pychEnv --display-name "Python (pychEnv)"
pip install git+https://github.com/Nickp1993/Pych/
- Close this window (do not continue with the "how to use" without closing!)
For macOS
-
Open a terminal and enter the following commands:
conda create --name pychEnv
- Enter
y
(for yes)
- Enter
conda activate pychEnv
conda install git pip ipykernel notebook
- Enter
y
(for yes)
- Enter
python3 -m ipykernel install --user --name pychEnv --display-name "Python (pychEnv)"
pip install git+https://github.com/Nickp1993/Pych/
- Close this terminal
-
You have finished installation, continue with the "How to use" below to start a notebook
- Download the notebook files
- Click the green button above, and click download ZIP (or click here)
- Extract the ZIP-file.
- E.g. to
C:\4DC10\notebooks
- E.g. to
- Every time you want to start jupyter notebook:
- (Windows) Open the anaconda prompt (found in windows menu)
- (macOS) Open a terminal and enter
conda activate pychEnv
- In anaconda/terminal, set the path to that of your notebooks folder by entering
cd <path>
with<path>
the path of your notebooks folder. If you are not using your default drive (C:\
), usecd /D <path>
.- E.g.
cd C:\4DC10\notebooks
, orcd /D F:\4DC10\notebooks
- E.g.
- Enter
jupyter notebook
- Wait till a local server has started, your browser should open it automatically, if not, try clicking this links
- Open one of the notebooks (files with an
.ipynb
extension) - In the menubar, click kernel > change kernel > Python (pychEnv)
- You can now use this notebook!
- You can now click run to execute the cells of the notebook one-by-one (jupyter notebooks work top-down)
- Click this link for information on how jupyter notebook works
- Most errors are caused by not following the How to install instruction carefully enough.
- If you get the error
No module named 'PyCh'
when you try to run the commandfrom PyCh import *
, then PyCh has likely not been installed correctly. - The same goes if you get a
Numpy importerror
. - Make sure you open
Anaconda Prompt (Anaconda3)
and not another version (such asAnaconda Prompt
without Anaconda3)! - If you get a
EnvironmentNotWritableError
orError [WinError 2]
during installation, try running the anaconda prompt as administrator, and then try installing again. - If you get a
OpenSSL
orCondaSSLError
, the solution is as follows:- Find your anaconda installation directory (e.g.
C:\ProgramData\Anaconda3
orC:\Users\<username>\Anaconda3
) - Go to the subdirectory
\Anaconda3\Library\bin\
and copy the fileslibcrypto-1_1-x64.dll
andlibssl-1_1-x64.dll
. - Paste these files in the following subdirectory:
\Anaconda3\DLLs\
.
- Find your anaconda installation directory (e.g.
- If you get an error code 128 while executing
pip install git+https://github.com/Nickp1993/Pych/
, you can instead try the following command:pip install https://github.com/Nickp1993/PyCh/archive/master.tar.gz
. - If you had a previous installation of Anaconda, this could cause issues. If so, contact a TA for help. The easiest solution generally is a clean install of Anaconda.
- WINError 225: Temporarily disable your antivirus while performing the installation.