diff --git a/.gitignore b/.gitignore
index 9348cb703..9021ffb09 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,3 +20,11 @@ test/results/*
doc/_build/
+
+build/
+
+dist/
+
+pypsa.egg-info/
+
+files.txt
diff --git a/doc/installation.rst b/doc/installation.rst
index eab457582..38831f33e 100644
--- a/doc/installation.rst
+++ b/doc/installation.rst
@@ -24,5 +24,7 @@ In a unix-based environment these packages can be obtained with the
To install PyPSA, you need to download the code from the `PyPSA github
-repository `_ and then add the
-directory to your python path.
+repository `_ and then go to the
+local repository and run::
+
+ python setup.py install
diff --git a/__init__.py b/pypsa/__init__.py
similarity index 100%
rename from __init__.py
rename to pypsa/__init__.py
diff --git a/components.py b/pypsa/components.py
similarity index 100%
rename from components.py
rename to pypsa/components.py
diff --git a/descriptors.py b/pypsa/descriptors.py
similarity index 100%
rename from descriptors.py
rename to pypsa/descriptors.py
diff --git a/io.py b/pypsa/io.py
similarity index 100%
rename from io.py
rename to pypsa/io.py
diff --git a/opf.py b/pypsa/opf.py
similarity index 100%
rename from opf.py
rename to pypsa/opf.py
diff --git a/pf.py b/pypsa/pf.py
similarity index 100%
rename from pf.py
rename to pypsa/pf.py
diff --git a/setup.cfg b/setup.cfg
new file mode 100644
index 000000000..2a9acf13d
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,2 @@
+[bdist_wheel]
+universal = 1
diff --git a/setup.py b/setup.py
new file mode 100644
index 000000000..2a7f011e9
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,29 @@
+
+
+
+from setuptools import setup, find_packages
+from codecs import open
+
+
+with open('README.rst', encoding='utf-8') as f:
+ long_description = f.read()
+
+setup(
+ name='pypsa',
+ version='0.2',
+ author='Tom Brown (FIAS), Jonas Hoersch (FIAS)',
+ author_email='brown@fias.uni-frankfurt.de',
+ description='Python for Power Systems Analysis',
+ long_description=long_description,
+ url='https://github.com/FRESNA/PyPSA',
+ license='GPLv2',
+ packages=find_packages(exclude=['doc', 'test']),
+ install_requires=['numpy','pyomo','scipy'],
+ classifiers=[
+ 'Development Status :: 3 - Alpha',
+ 'Environment :: Console',
+ 'Intended Audience :: Science/Research',
+ 'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
+ 'Natural Language :: English',
+ 'Operating System :: OS Independent',
+ ])