Notices that your command line now has a different prompt: (virtualenv_name)$ pip install numpy Now you can do whatever you want inside this virtualenv and you won’t mess up your system. To enter the virtualenv do: $ cd virtualenv_name $ source bin/activate It will create a directory with the environment. To create a virtualenv named virtualenv_name (use whatever you want) do the following. With virtualenv you can have both projects on the same computer without them clashing. This allows separated versions for different purposes to exist in the same computer.įor instance let’s say you have to do some work on a Python project but you also want to do some basic testing or play a little with some new code where you might need some different packages but only for that purposes. To check type $ python -version Python 3.7.0 Use Python Virtual Environments ( ^top)Ī nice functionality in Python are Virtual Environments (virtualenv) where you can create somewhat of a sandbox to play and/or work. So to use python-3.7 (or 3.6, just change 37 for 36) by default use this command on the command line: $ sudo port select - set python python37 With that command there are now two versions of Python in the system and typing python in the command line would use the original version. To install python-3.6 on the command line do this: $ sudo port install python36 To install python-3.7 on the command line do this: $ sudo port install python37 To install it follow the instructions on their site: MacPorts. So I installed a newer version using MacPorts which is a package manager for the Mac, some people don’t like it but it works fine for me. It already has a Python install in it but it’s a fairly old Python version: 2.7. I am currently using Python on my Mac (macOS). Table of Contents Python * Python Install * Use Python Virtual Environments IDE Setup - Atom * Atom install * All Atom Installs via Command Line * Atom Theme * Atom minimap * Atom minimap - Other minimap packages * Atom - Install atom-ide-ui + ide-python * atom-beautify * atom-python-virtualenv * font So… (conclusion) Python ( ^top) Python install ( ^top)
0 Comments
Leave a Reply. |