hotosm / raw-data-api

Raw Data API is a set of high-performant APIs for transforming and exporting OpenStreetMap (OSM) data in different GIS file formats
https://hotosm.github.io/raw-data-api/
GNU Affero General Public License v3.0
25 stars 34 forks source link

Installing Python Libraries #228

Open KafayatYusuf opened 8 months ago

KafayatYusuf commented 8 months ago

Describe the bug No guide about installation of python libraries such as fastapi , psycopg2, slowapi, humanize, psutil etc in the local IDE

To Reproduce Steps to reproduce the behavior:

  1. Go to 'main.py'
  2. Run 'line 22'
  3. Scroll down to 'Terminal'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots image

Desktop (please complete the following information):

Additional context Without running pip install psycopg2 in the terminal IDE, it shows error every now and then

KafayatYusuf commented 8 months ago

Bug to be fixed by installing of python libraries

tony-nyagah commented 8 months ago

The steps for local installation are in docs/src/installation/local.md.
You can create a virtual environment then run pip install -r requirements.txt while in the root folder which will install the dependencies.
I hope this helps.

robel16 commented 8 months ago

Hello, @KafayatYusuf, @spwoodcock, I want to work on this issue can you assign me, please?

spwoodcock commented 8 months ago

Most dependencies should install easily with pip.

Psycopg2 is slightly more complex as it requires underlying system libraries to be installed too. There is good documentation about this https://www.psycopg.org/docs/install.html#build-prerequisites

Is there anything else specifically that you feel needs to be addressed?

Including in an install guide might be possible - feel free to work on this & Kshitij can review / decide on if the package needs it 👍

robel16 commented 8 months ago

Hello, @spwoodcock , @kshitijrajsharma if I add the psycopg2 in the requirement.txt file would it solve this issue? where should I add the Documentation

kshitijrajsharma commented 8 months ago

Psycopg2 is in requirements.txt . As sam mentioned in order to install psycopg2 using pip it requires to build binary first , We can simply mention this in documentation and redirect user to installation doc that psycopg2 has .

robel16 commented 8 months ago

Thank you for your Response @kshitijrajsharma I created the PR based on your and Sam's instruction can you Review it please Issue 228

robel16 commented 8 months ago

Hello @kshitijrajsharma can you please review my PR so that I can proceed to another issue