Open DOptimusPrime opened 1 year ago
Why did you delete all of the questions on the issue template? They are there for a reason. That reason is that we need that information to give you any useful kind of answer. Please answer these questions and then we'll see if we can help:
#### Installation method/steps
- Installation method (conda, pip wheel, from source, etc...)
- How did you install PROJ? Where is it installed?
- Please provide all commands/steps you used to install pyproj and PROJ.
#### Environment Information
- pyproj version you are attempting to install
- PROJ version (Execute `proj` command and give version here.)
- Python version (`python -c "import sys; print(sys.version.replace('\n', ' '))"`)
- Operation System Information (`python -c "import platform; print(platform.platform())"`)
Rel. 8.1.1, September 1st, 2021 usage: PROJ [-bdeEfiIlmorsStTvVwW [args]] [+opt[=arg] ...] [file ...]
This is my environment information:
3.9.15 | packaged by conda-forge | (main, Nov 22 2022, 08:39:05) [MSC v.1929 64 bit (AMD64)]
Windows-10-10.0.22621-SP0
I installed it through conda-forge:
These are all the package.:
Thank you. Are you activating your conda environment before using it?
Side note: I'm a little surprised you're getting such an old version of pyproj, although that's not the problem here most likely. When you created your environment did you specify any version limits for any of your dependencies?
Yes. This is what I needed to run my code so pyproj came as a dependency: networkx== 2.6.2 shapely== 1.7.1 geopandas== 0.9.0 numpy==1.20.3 That is why my version of pyproj is so old.
Is that "Yes" to the activation question? The various PROJ directory environment variables are meant to be set on environment activation.
Yes. I think because I installed an older version version of geopandas it came with an older version of proj. I don't know if I answered your question correctly
Ok, so at some point you are running conda activate chur2
? Ok. There is a small-ish chance that something has been fixed since this older version of pyproj in the conda-forge builds, but it is hard to say. I didn't see anything obvious in the commit history on conda-forge. Let me see if I can reproduce the warnings on my linux box. It could also be that I'm just completely missing something so @snowman2 could probably answer this too.
I run the following: conda activate chur2 conda install -c conda-forge networkx== 2.6.2 shapely== 1.7.1 geopandas== 0.9.0 numpy== 1.20.3 fiona netcdf4 That was how I isntalled my packages. Thank you for your help
If you run python -c "import pyproj"
do you see the warning?
Edit: I'm trying to figure out the smallest amount of code to reproduce the warning. I'm not seeing it on linux with these package versions, but it wouldn't surprise me that Windows builds have an issue that linux doesn't.
It works fine: (chur2) C:\Users\hdela>python -c "import pyproj"
(chur2) C:\Users\hdela>python Python 3.9.15 | packaged by conda-forge | (main, Nov 22 2022, 08:39:05) [MSC v.1929 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. import pyproj
Well the warning you were getting is supposed to show up in pyproj/__init__.py
when you import it so I'm not sure why you would stop getting it now. You could do:
python -c "import warnings; warnings.simplefilter('error'); import pyproj"
but I wouldn't guess it would be a problem. So perhaps one of the other packages is interfering with pyproj? What order do you import things in your script? Also, it looks like you might be using some multiprocessing, is that right?
Yes I am using some multiprocessing. These are the other import statement: import sys
import numpy as np import pandas as pd import csv import pickle import math import os import json import uuid import shutil import threading
from scipy.stats import norm from time import strftime, time import time import cProfile, pstats, io from pstats import SortKey
from osgeo.gdalconst import * from osgeo import osr, ogr, gdal import geopandas as gpd import subprocess import matplotlib.pyplot as plt import matplotlib.cm as cm from mpl_toolkits.axes_grid1.inset_locator import inset_axes
import matplotlib as mpl
from fiona import collection, open as fiona_open from shapely.geometry import mapping, shape, Point, LineString
Do you think is it that warning that is making python to look for that folder on my old machine. The last line of the error message where FileNotFoundError: [Errno 2] No such file or directory: b'C:/Users/dhoussou/chur/Chur/Engine/Data/SourceData/precipitation/MeteoSwiss/RdisaggH_ch01r.swisscors_200703010100_200704010000.nc' That's the path on my old machine. I do not think but I am using a new machine so I am confused why that is? Do you think it has something to do with PROJ. I have looked through my code and I don't think I provided any path to my old machine so I am a bit confused.
Did you copy your old machine's environment to your new machine?
No I don't think that warning has anything to do with your incorrect netcdf path being used besides that both issues could be pointing to the same problem: something got copied or configured incorrectly when switching to the new machine.
Note: Even with that set of imports in a python file and with:
import warnings
warnings.simplefilter("always")
I don't see a pyproj warning on my linux environment.
Providing a Minimal Reproducible Example may help to debug the issue: https://stackoverflow.com/help/minimal-reproducible-example
I am running this code but for, I realized that the FileNotFound Error is happening because it is looking for a file on another old computer? how do I solve that issue? Is it related to the Pyproj warning:
My environment variables: C:\Users\hdela.conda\envs\chur2\Lib\site-packages\pyproj C:\Users\hdela.conda\envs\chur2\Library\share\proj