How to fix error with freetype while installing all packages from a requirements.txt file?

If you are using Linux OS: Remove matplotlib==1.3.1 from requirements.txt Try to install matplotlib with sudo apt-get install python-matplotlib Install all packages again from requirements.txt For Python 2: run pip install -r requirements.txt For Python 3: run pip3 install -r requirements.txt pip freeze > requirements.txt If you are using Windows OS: python -m pip install … Read more

Automatically create file ‘requirements.txt’

You can use the following code to generate a requirements.txt file: pip install pipreqs pipreqs /path/to/project The benefits of using pipreqs from its GitHub. Why not pip freeze? pip freeze only saves the packages that are installed with pip install in your environment. pip freeze saves all packages in the environment including those that you … Read more

Equivalent of `package.json’ and `package-lock.json` for `pip`

There are at least three good options available today: Poetry uses pyproject.toml and poetry.lock files, much in the same way that package.json and lock files work in the JavaScript world. This is now my preferred solution. Pipenv uses Pipfile and Pipfile.lock, also much like you describe the JavaScript files. Both Poetry and Pipenv do more … Read more

What does pip-compile do? What is its use? (how do I maintain the contents of my requirements.txt file?)

You want to be able to lock down the versions of all of the packages that your Python code depends on in your requirements.txt file. You want this file to include versions for not just the direct dependencies that your code imports directly, but also versions for all of the transitive dependencies as well…that is, … Read more

Check if requirements are up to date

Pip has this functionality built-in. Assuming that you’re inside your virtualenv type: $ pip list –outdated psycopg2 (Current: 2.5.1 Latest: 2.5.2) requests (Current: 2.2.0 Latest: 2.2.1) $ pip install -U psycopg2 requests After that new versions of psycopg2 and requests will be downloaded and installed. Then: $ pip freeze > requirements.txt And you are done. … Read more

Check if requirements are up to date

Pip has this functionality built-in. Assuming that you’re inside your virtualenv type: $ pip list –outdated psycopg2 (Current: 2.5.1 Latest: 2.5.2) requests (Current: 2.2.0 Latest: 2.2.1) $ pip install -U psycopg2 requests After that new versions of psycopg2 and requests will be downloaded and installed. Then: $ pip freeze > requirements.txt And you are done. … Read more

Check if my Python has all required packages

UPDATE: An up-to-date and improved way to do this is via distutils.text_file.TextFile. See Acumenus’ answer below for details. ORIGINAL: The pythonic way of doing it is via the pkg_resources API. The requirements are written in a format understood by setuptools. E.g: Werkzeug>=0.6.1 Flask Django>=1.3 The example code: import pkg_resources from pkg_resources import DistributionNotFound, VersionConflict # … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)