First python ① Environment construction with pythonbrew & Hello World !!

background

I will participate in an in-house study session on the theme of "Let's make a Web system in a language that I have never touched". Since I am in charge of investigating python, I will summarize the contents of the investigation. First of all, from the environment construction.

Development environment

Environment maintenance of python

There is also a way to drop the source and install it in Official, With pythonbrew, you can install multiple versions of python, and it doesn't pollute the environment too much. (It feels like Ruby's RVM), so build the environment with pythonbrew.

First, install pythonbrew. This time install as multi-user.

$ git clone https://github.com/utahta/pythonbrew
$ cd pythonbrew
$ sudo ./pythonbrew-install

Install python 3.3.0. If you want to use sudo, you can use the sudo pybrew command, but I got an error. I wonder if it's a PATH problem. .. ..

$ sudopybrew install --force 3.3.0
-bash: sudo PYTHONBREW_ROOT=/usr/local/pythonbrew PATH=/usr/local/pythonbrew/bin:/usr/local/rvm/gems/ruby-1.9.3-p448/bin:/usr/local/rvm/gems/ruby-1.9.3-p448@global/bin:/usr/local/rvm/rubies/ruby-1.9.3-p448/bin:/usr/local/rvm/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/vagrant/bin /usr/local/pythonbrew/bin/pythonbrew:There is no such file or directory

There is no help for it, so install as root. It seems to have worked.

$ sudo su -
# pythonbrew install --force 3.3.0
# pythonbrew switch 3.3.0
# python --version
Python 3.3.0
# which python
/usr/local/pythonbrew/pythons/Python-3.3.0/bin/python

HelloWorld!! Let's try the customary Hello World. Save the following code as helloworld.py.

helloworld.py


print("Hello World")

Execute. Hello World was done properly! !!

# python helloworld.py 
HelloWorld!!

By the way, if you execute it only with the python command, it will be in interactive mode, and you can also do Hello World as follows.

# python
Python 3.3.0 (default, Jul  8 2013, 09:11:06) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> print("HelloWorld!!")
HelloWorld!!

Recommended Posts

First python ① Environment construction with pythonbrew & Hello World !!
Python starting with Hello world!
Python3 environment construction with pyenv-virtualenv (CentOS 7.3)
pytorch @ python3.8 environment construction with pipenv
Environment construction (python)
Python --Environment construction
Python environment construction
python environment construction
[Ubuntu 18.04] Python environment construction with pyenv + pipenv
Let's get along with Python # 0 (Environment construction)
Hello World and face detection with OpenCV 4.3 + Python
Collecting information from Twitter with Python (Environment construction)
Hello World with gRPC / go in Docker environment
From Kivy environment construction to displaying Hello World
python windows environment construction
[AWS] Create a Python Lambda environment with CodeStar and do Hello World
homebrew python environment construction
hello world with ctypes
Python development environment construction
Hello World with nginx + uwsgi + python on EC2
Python environment with docker-compose
Hello, World with Docker
python2.7 development environment construction
Django's first Hello World
Mac environment construction Python
From Python environment construction to virtual environment construction with anaconda
Hello world with flask
Virtual environment with Python 3.6
Python environment construction @ Win7
[Python] OpenCV environment construction with Docker (cv2.imshow () also works)
Data analysis environment construction with Python (IPython notebook + Pandas)
Web application made with Python3.4 + Django (Part.1 Environment construction)
QGIS3 Python plugin development environment construction with VSCode (macOS)
Python + Anaconda + Pycharm environment construction
Install Python environment with Anaconda
Draw hello world with mod_wsgi
Hello World with Flask + Hamlish
Manage python environment with virtualenv
Python environment construction (Windows10 + Emacs)
First neuron simulation with NEURON + Python
Build python3 environment with ubuntu 16.04
ML environment construction with Miniconda
Python environment construction For Mac
Prepare python3 environment with Docker
Build python environment with direnv
Python3 environment construction (for beginners)
Python environment construction and TensorFlow
Python environment construction under Windows7 environment
Environment construction of python2 & 3 (OSX)
[LDAP environment construction: 7] Add / search / change / delete users with Python
python / tensorflow beginners build jupyter + tensorflow environment and do Hello World
Environment construction of python and opencv
Python environment construction memo on Windows 10
Anaconda python environment construction on Windows 10
Build python virtual environment with virtualenv
Setup modern Python environment with Homebrew
Python + Unity Reinforcement learning environment construction
ruby environment construction with aws EC2
Hello, world! With virtual CAN communication
I checked Mac Python environment construction
Build Mysql + Python environment with docker