Closed NewGraphEnvironment closed 3 years ago
Definitely try WSL, this should help a lot.
Windows command for setting environment is SET
, not export
.
https://superuser.com/questions/79612/setting-and-getting-windows-environment-variables-from-the-command-prompt
First step would be try converting the line endings from unix to windows but I'm not sure
Not sure but probably the issue is that your environment variables aren't set (although I'm not sure how to evaluate your screen shot). Try specifying the db directly with the db_url option:
bcdata bc2pg bc-airports --db_url postgresql://postgres:postgres@localhost:5432/postgis
still planning on looking into this. thanks for keeping the issue open for now
Another 24.75hrs later. no luck. 🤮
not your problem. bcdata bc2pg bc-airports --db_url postgresql://postgres:postgres@localhost:5432/postgis
actually works on my windows command line now but couldn't set env variables there. Installed wsl
and separate pg
instance but cant connect through bcdata
. So insanely difficult for me to figure it out for some reason. I feel like such a loser.
If you create & share a shell script I can point to any issues I can spot.
This will set up the env variables in windows command prompt.
SET PGHOST=localhost
SET PGUSER=posgres
SET PGDATABASE=mydb
SET PGPORT=5432
SET DATABASE_URL=postgresql://%PGUSER%:mypassword@%PGHOST%:%PGPORT%/%PGDATABASE%
sent a invite to a repo i made to try to keep track of what was going on. pg_wsl_setup.Rmd has some of the outputs I get when trying to connect in wsl. Might be something that jumps out at you as incompetent but I doubt it. Its going to be hard to follow
@NewGraphEnvironment - I think you got this sorted?
Yes. I can’t quite remember what went on but using wsl2 on window and the virt env that ships with bcfishpass worked
Incredible tool. Hope to get it running. Working on installing this to windows. So far i have done the following. I am not experienced with most of these tools so please pardon my ignorance and newbieisms.
I did not:
I did:
https://github.com/smnorris/bcfishobs.git
When trying to run 01_load.bat from the Anaconda prompt at cd bcfishobs and within the bcfp virt env issue arose at:
(bcfp) C:\scripts\bcfishobs>ogr2ogr -f PostgreSQL "PG:host=$PGHOST user=$PGUSER dbname=$PGDATABASE port=$PGPORT" -lco OVERWRITE=YES -lco SCHEMA=whse_fish -nln wdic_waterbodies_load -nlt NONE whse_fish.wdic_waterbodies.csv
fails with
tried
export PGOGR='host=localhost user=postgres dbname=postgres password=postgres port=5432'
and
export PGHOST=localhost
etc.as per README.md on bcfishpass to no prevail with message
'export' is not recognized as an internal or external command
below is a screen shot of my env variables. Should they have dollar signs in front of them perhaps?
line 45 of 01_load.bat fails
psql -c "CREATE TABLE whse_fish.fiss_obstacles_unpublished (id integer ..........
due to unexpected line endings. Could not seem to find a solution other than re-writing the command with no spaces and copying into the terminal directly. This worked but is there another way that you know of?bcdata bc2pg WHSE_FISH.FISS_OBSTACLES_PNT_SP --fid FISH_OBSTACLE_POINT_ID
fails with the following error message: Any idea what might be going wrong? Thank you!