--wheel: Python package format
--Files containing Python code and shared libraries (* .whl
)
--If it depends on other packages, it is written in the metadata
/usr/lib/python3.x/site-package
)pip install numpy
https://semver.org/lang/ja/
Uses X.Y.Z
format versioning
X
) if API changes are incompatible,Y
),Z
).pip install "numpy==1.15"
--List the packages that depend on the file requirements.txt
and install them all together.
pip install -r requirements.txt
tensorflow == 1.15
--It does not work on 2.0 seriestensorflow == 2.0
--It does not work on 1.0 seriesYou cannot have multiple versions of a package installed on your system at the same time!
--I want to install a package for each project --Entered the standard from Python 3.3 --There was a package called virtualenv for Python 2.x
python3 -m venv path/to/new/venv #Create venv
source path/to/new/venv/bin/activate #activation
--Venv itself will be managed manually
--Typically, create a venv
directory directly under the project
--Official file format for Python project management
- PEP(Python Enhancement Proposals) 518
--Integrate packaging settings setup.py
, setup.cfg
and list of dependent packages requirements.txt
--Supported from pip 19.2
--You can pip install
from pypoetry.toml
without setup.py
--You can create a namespace tool. $ {Toolname}
for each tool and write your own settings.
--You no longer have to create a separate configuration file for each tool
--A tool that manages projects based on pyproject.toml
--poetry init
will generate pyproject.toml
――Creates and manages venv without permission
--poetry run [shell script]
runs the script under venv
--There is also an upload function to PyPI
[tool.poetry]
name = "hello"
version = "0.1.0"
description = "Hello Poetry!"
[tool.poetry.dependencies]
python = "^3.7" #You can also write a version of Python itself (just check if it meets)
numpy = "1.14" #I will write packages that depend on here
[tool.poetry.dev-dependencies]
[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"
Recommended Posts