1
0
mirror of https://github.com/tiyn/wiki.git synced 2026-02-22 10:24:47 +01:00

python: added installation and vim support

This commit is contained in:
TiynGER
2020-12-09 00:52:18 +01:00
parent 50622a631f
commit c7c6b2442f
2 changed files with 64 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
# Python
[Python](https://www.python.org) is an interpreted general-purpose programming
language.
## Installation
You can install python using various ways.
With `pyenv` you can switch between different versions.
Install `pyenv` and `pyenv-virtualenv` and proceed with adding
```txt
export PATH=${HOME}/.pyenv/bin:$PATH
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
```
to your `~/.profile`.
You can then set and install your preferred version of python globally with
`pyenv install <version>` and `pyenv global <version>`.
Analog to managing python versions, `pipenv` can manage pip and package versions.
### Avoid Errors in Vim
Make sure to add
```vimscript
let g:python_host_prog = "/usr/bin/python2"
let g:python3_host_prog = "/usr/bin/python3"
```
to your `init.vim` to avoid usage of `pyenv`s version of python in autocompletion.
## IDE
### Vim
The steps to make Vim a python IDE are described in
[the vim section of this wiki](../linux/vim/python.md).