-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpython-pyenv-setup.txt
68 lines (47 loc) · 2.32 KB
/
python-pyenv-setup.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
I very strongly urge all Python developers to always use Pyenv to manage Python installations
and Python virtual environments. I have found it to be far better than any other method in
general and in fact the only way to consistently match versions correctly for any serious
Python developer who works on a lot of projects, each of which requires different versions.
Pyenv turns a difficult situation into a joy, and you will always have exactly the python
version and the exact set of module version to match every code base you work with. Best of
all, it is effortless and even automatic to switch the version and environment.
In nearly all of my projects, I use a .python-version file and I prefix all of my virtual
environment names with "ve.", so the virtual environment for this project is named:
ve.kafkastack
-------------
INSTRUCTIONS:
-------------
My latest Python 3 (thanks to Pyenv) is currently 3.11.1 and I create the Pyenv Virtualenv
virtual environment as follows:
--------
➜ kafkastack git:(main) ✗ pyenv versions
pyenv: version `ve.kafkastack' is not installed (set by /Users/username/REPOS/kafkastack/.python-version)
system
2.7.18
3.11.1
➜ kafkastack git:(main) ✗ pyenv virtualenv 3.11.1 ve.kafkastack
--------
(ve.kafkastack) ➜ kafkastack git:(main) ✗ pyenv versions
system
2.7.18
3.11.1
3.11.1/envs/ve.kafkastack
* ve.kafkastack (set by /Users/username/REPOS/kafkastack/.python-version)
(ve.kafkastack) ➜ kafkastack git:(main) ✗
--------
TODO: Continue instructions here on how to upgrade tools and then install Python dependencies.
pip install --upgrade pip
pip install --upgrade setuptools
pip install --upgrade wheel
pip install -r requirements.txt
TODO: Maybe install some newer equivalents of pylint, autopep8, rope, etc/similar
TODO: Maybe make a setup.sh
------------------------------
# TODO: We can write most Python code as a library for this application. If we do that, the following old notes
# are helpful. TODO: Update these instructions. See Pyrithm for examples.
# Install this project's package
# For development, we will install this project's package using the -e option
# so that pip will install it into the venv using symlinks. In this way we can
# make changes to the module which will be picked up upon each new execution
# using the module.
python3 -m pip install -e .