-1

it's a new Flask project with requirement.txt:

  • flask
  • flask_pymongo
  • flask_pymongo
  • flask_cors
  • pyjwt
  • Flask-JWT-Extended
  • bcrypt

When i run pip install requirement.txt or pip install bcrypt here what i have

pip install bcrypt

Any solution please ?

  • 2
    First, [**PLEASE DO NOT POST TEXT AS IMAGES**](https://meta.stackoverflow.com/q/285551). Copy and paste the text into your question and use the code formatting tool to format it correctly. Images are not searchable, and can not be interpreted by screen readers for those with visual impairments. Use the [edit] link to modify your question. Second, did you read the error message? It tells you exactly what to do. – MattDMo Dec 23 '21 at 14:53
  • 1
    Please read the error message! It contains instructions. – Klaus D. Dec 23 '21 at 14:56
  • https://stackoverflow.com/search?q=%5Bpip%5D+error%3A+Microsoft+Visual+C%2B%2B+14.0+or+greater+is+required – phd Dec 23 '21 at 15:15

1 Answers1

2

The problem you're bumping up against is bcrypt has C++ / binary dependencies.

On some platforms it is very easy to obtain a compiler toolchain, such as clang or gcc, and suitable header files. On yours it might be somewhat inconvenient to obtain e.g. Microsoft Visual C++ 14.0. Pip is very good at handling python deps. Less so for complex binary deps. Conda was designed to offer good solutions to exactly this problem.

Get it from: https://docs.conda.io/projects/conda/en/latest/user-guide/install

Discard requirements.txt in favor of a new environment.yml file:

name: my-project  # or feel free to invent a better name :)

channels:
- conda-forge

dependencies:
- bcrypt
- flask
- flask-cors
- flask-jwt-extended
- flask-pymongo
- pip
- pyjwt
- python >= 3.9.9

Run conda env update:

Collecting package metadata (repodata.json): done
Solving environment: done

Downloading and Extracting ...
done
#
# To activate this environment, use
#
#     $ conda activate my-project

That "activate" command will alter your PATH, giving you a brand new python interpreter which has all needed libraries available to it. Have fun with your new project!

J_H
  • 17,926
  • 4
  • 24
  • 44