How to operate once you've set your machine up with Python Wrangler.
Python Wrangler helps you install Python in a nice, pleasant, perfect way. But what do you do once you’re done? Read on!
If you visit the command line and type
python, it will run your “good” Python.
pip install should work fine, but since we’re not using Anaconda some of the more technical packages might be trouble for Windows users.
These packages need to be compiled - converted from source code into actual runnable code - which needs extra software installed on Windows. Download and install the Visual Studio Build Tools from Microsoft and you should be good to go.
When you run the installer it’ll make you jump through some hoops, what you want to install is the Visual Studio C++ Build Tools.
Using wheel files
If it still doesn’t work or you’re too lazy to install the build tools, we can also install using wheels, which has already been compiled for us. First, install the
wheel package to be able to install using wheel files.
pip install wheel
Then, download the package you need from Christopher Gohlke’s Unofficial Windows Binaries page. With Python 3.6 and 32-bit Windows, the file you want should end in
cd to your Downloads folder and install it using
pip. It should look something like this:
cd Downloads pip install pandas‑0.22.0‑cp36‑cp36m‑win32.whl
If you used Python previously, you’re probably familiar with virtualenv. Well, fun update: stop using it!! Now pipenv is the official recommendation from Python.org, and it’s awesome.
pipenv installto create a virtual environment
pipenv shellto activate it
pip install ...the packages you need
python ...just like normal
That’s basically it, but you can visit https://github.com/pypa/pipenv for more details.
For OS X, We’re using pyenv to manage different versions of Python. To switch to 2.7, use the following command.
pyenv install 2.7 pyenv shell 2.7
Once you exit the shell, you’ll be back to your default Python. And you only need to use
pyenv install the first time.
Python Launcher comes installed automatically with newer versions of Python 3, and allows you to use the
py command runs whatever the latest version of Python you have is. If you’ve also installed Python 2, you can use it with
-2.7 to run your script using Python 2. For example:
py -2 something.py
You can install Python 2 from Python.org, just scroll down and keep a sharp eye out.