Skip to content

fix(How To, Python): Code Snippet Markdown #60

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 27 additions & 18 deletions Python-Virtualenv.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,24 @@ Python Install
For comprehensive and up to date instructions for OSX installs look [here](http://docs.python-guide.org/en/latest/starting/install/osx/) but for simple cases the instructions below should help.

To install ``python3`` on OSX use
> brew install python3
```
brew install python3
```

or if ``python3`` is not supported by a required library use python 2.7

> brew install python
```
brew install python
```

On Debian and Ubuntu

> sudo aptitude install python3.5-dev

```
sudo aptitude install python3.5-dev
```
On Fedora

> sudo yum install python3.5-dev
```
sudo yum install python3.5-dev
```

Pip
---
Expand All @@ -33,20 +38,21 @@ Install or Upgrade pip
To install or upgrade pip, securely download [get-pip.py](https://bootstrap.pypa.io/get-pip.py). [[1](http://www.pip-installer.org/en/latest/installing.html#id5)]

Then run the following (which may require administrator access):

> $ python get-pip.py

```
$ python get-pip.py
```
If setuptools (or distribute) is not already installed, get-pip.py will install [setuptools](https://pypi.python.org/pypi/setuptools) for you. [[2](http://www.pip-installer.org/en/latest/installing.html#id6)]


On Debian and Ubuntu:

> $ sudo aptitude install python3-pip

```
$ sudo aptitude install python3-pip
```

On Fedora:

> $ sudo yum install python3-pip
```
$ sudo yum install python3-pip
```

If you need to use python 2.7 just remove the 3 from the commands.

Expand All @@ -57,10 +63,13 @@ Virtualenv is a tool that allows projects to have isolated environments on the s

Once you have virtualenvwrapper installed you can start a new virtualenv like so

> mkvirtualenv -p `which python3` --no-site-packages project_name

```
$ mkvirtualenv -p `which python3` --no-site-packages project_name
```
or if you have to use python 2

> mkvirtualenv -p `which python` --no-site-packages project_name
```
$ mkvirtualenv -p `which python` --no-site-packages project_name
```

The ``--no-site-packages`` option means that none of the system versions of your requirements will be used, which greatly decreases the risk of unexpected conflicts.