|
|
|
|
|
by nonethewiser
1174 days ago
|
|
Install dependency. Save in requirements.txt. Includes sub dependencies that are system specific. Install from requirements.txt on different machine and get errors. Uninstall dependency and save to requirements.txt. Look at requirements.txt and see that sub decencies are still there. What is the right way to avoid these issues on Python? |
|
Keep your high-level dependencies in requirements.in.
Create a virtual environment using venv.
Run `pip-compile resolver=backtracking`. It autogenerates a requirements.txt file with all dependencies and sub-dependencies and their versions. This essentially acts as a lock file from other languages/frameworks.
Install from the autogenerated requirements.txt file in the venv virtual environment.
If a dependency changes, change in requirements.in, recompile the .txt file, and reinstall.