Created for
Created by
Next slides guides you through the process of installing the needed tools for DataScience/DataAnalysis in Python.
But if you are already comfortable with Anaconda (i.e. you can use conda) you can skip the next slides, and use the time to verify that your environment is setup correctly.
Note, we'll be using Python 3!
C:/Python3
or whatever you like
# check for python installed version:
python --versions
# check for pip installed version:
pip --version
python3
and pip3
instead.Nor to pass through the dependency hell
pip install --user pipenv
pip install --upgrade pipenv
pip uninstall pipenv
$ python -m site --user-base
# /home/username/.local
# add it to your ~/.profile or ~/.bashrc file, or:
$ export PATH=$PATH:/home/username/.local/bin
$ py -m site --user-site
#C:\Users\Username\AppData\Roaming\Python36\site-packages
# add to PATH:
$ C:\Users\Username\AppData\Roaming\Python36\Scripts
$ pipenv install packagename
### Create virtualenv with system's Python3 version:
$ pipenv --three
### activate the virtualenv
$ pipenv shell
### Exit the virtualenv
(...)$ exit
### Output virtualenv information
$ pipenv --venv
### Remove the virtualenv
$ pipenv --rm
All options available with: pipenv --help
Intro to Pipenv - A Package Manager for Python by Pretty Printed
Kenneth Reitz - Pipenv: The Future of Python Dependency Management - PyCon 2019
import matplotlib.pyplot as plt
import numpy as np
t = np.arange(0.0, 2.0, 0.01)
s = 1 + np.sin(2*np.pi*t)
plt.plot(t, s)
plt.xlabel('time (s)')
plt.ylabel('voltage (mV)')
plt.title('About as simple as it gets, folks')
plt.grid(True)
plt.savefig("test.png")
plt.show()
example from: matplotlib.org
# navigate...
$ cd your/project/folder
# make sure you are in it - list your files:
$ dir
# you have to see your 'simple_plot.py' listed
try to run the simple_plot.py program
$ python simple_plot.py
Traceback (most recent call last):
File "simple_plot.py", line 1, in <module>
import matplotlib.pyplot as plt
ImportError: No module named matplotlib.pyplot
Yes, an error occurs, because we do not have the required module (matplotlib) installed
We will install the required modules in a safe virtual environment by pipenv!
# install packages safely with pipenv:
$ pipenv install matplotlib
Creating a virtualenv for this project…
...
To activate this project`s virtualenv, run the following
pipenv shell
$ pipenv shell
Spawning environment shell...
pipenv
command.
# navigate to your project folder:
$ cd your/project/foolder/path
# activate the virtual environment:
$ pipenv shell
$ pipenv install numpy
$ pipenv install pandas
$ pipenv install matplotlib
$ pipenv install seaborn
jupyterlab
you'll have both the classic Jupyter Notebook as well as the new Jupyter Lab Interface.
$ pipenv install jupyterlab
git bash
, shell integration
and more Intro to Numerical Computing with NumPy (Beginner) | SciPy 2019 Tutorial | Alex Chabot-Leclerc
These slides are based on
customised version of
framework