Closed jinlx closed 5 years ago
Hello,
Are you importing whilst using an ipython command shell? If so, which version of python is your ipython running?
I have been able to reproduce the warning messages in python you reported by setting up a fresh environment, but not specifying ipython (3) is installed.
ephem package not installed
/users/ts551/scratch/conda_local/envs/py_2_7_master_MPL_II/lib/python2.7/site-packages/iris/unit.py:52: IrisDeprecation: iris.unit is deprecated in Iris v1.9. Please use cf_units (https://github.com/SciTools/cf_units) instead. warn_deprecated('iris.unit is deprecated in Iris v1.9. Please use
failed to import geopandas
failed to import rasterio
When importing AC_tools in ipython (python 3), there are 4 warning I would expect to see (pasted below). This is because I am partially maintaining back compatibility with python 2 to allow conversion of legacy GEOS-Chem bpch files to NetCDF via a iris backend (using PyGChem).
WARNING iris not imported
WARNING iris not imported
WARNING: Module not found error raised for: mpl_toolkits.basemap
WARNING: Module not found error raised for: mpl_toolkits.basemap
Tomas
Hi Tomas,
Thanks for the reply.
I am using python in ubuntu terminal and I set AC_tools in a clean environment. The python version I use is python3. So what I do to import AC_tools is simply
(AC_tools) cheyenne5 home/lixujin> python
Python 3.7.3 | packaged by conda-forge | (default, Mar 27 2019, 23:01:00)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import AC_tools
And then I get the information I show above after I install affine package.
>>> import AC_tools
failed to import geopandas
failed to import rasterio
I am not sure if it is caused by my installation process. I would also show my installation step just in case.
conda create -n AC_tools
conda activate AC_tools
git clone --recursive https://github.com/tsherwen/AC_tools.git
git submodule update --recursive
And then install additional packages
conda install -c conda-forge iris
conda install -c conda-forge pyhdf
conda install netCDF4
conda install basemap
conda install --channel conda-forge geopandas
conda install -c conda-forge rasterio
conda install -c anaconda ephem
Hope this imformation helps.
Lixu
Hello Lixu,
OK. I think I can see a possible issue. I would not recommend including basemap in your environment if you are using python3, as basemap is no longer maintained. I would recommend using cartopy for spatial plotting now.
One other question, does the prompt “>>>” return after the warning messages “failed to …”?
I successfully followed the steps you shared (and also included the install of xarray). When I excluded the install of basemap I got the error message below and when I included the basemap install I saw no warnings.
(AC_tools) [ts551@login1(viking) AC_tools]$ python
Python 3.7.3 | packaged by conda-forge | (default, Jul 1 2019, 21:52:21)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import AC_tools
WARNING: Module not found error raised for: mpl_toolkits.basemap
WARNING: Module not found error raised for: mpl_toolkits.basemap
>>>
I am slowly removing routines that use packages that were in use when AC_tools was used with python 2, including those for handling the bpch data format and basemap for plotting.
Does this help?
Tomas
Hi Tomas,
I do get “>>>” return after the warning messages “failed to …”. and there is no warning massage.
And I resintall it again and successfully import AC_tools without installing any other packages.
Thanks, Lixu
Hello Lixu,
Great. I'll update the messages to make it clearer that they are just warnings to alert the user and the package should still work fine without them, except for the few functions that require them.
Glad everything seems to be working now.
Cheers,
Tomas
Hi,
I install AC_tools by
python setup.py install
.However, I get this imformation when I try to import AC_tools
So I install affine, ephem, geopandas and raterio in the environment, expecting this bug could be fixed. But I still get error information below. I wonder if you have any suggestions on this kind of installation error.
My packages in the environment are listed below. Hope it helps.
Lixu