Comments (8)
Please could I check what (if any) error messages you get when you paste in the following lines?
import pygchem
from pygchem import datasets
import pygchem.datafields as datasets
I just checked and PyChem version I have from running the same process is '0.3.0dev' and the iris version is '1.13.0'. You may need to force the iris version to be the same, as I think some large happened at v2.
from ac_tools.
Hello @iriadigos,
Thanks for writing.
Yes. To use the iris backend via PyGChem in AC_tools, you need to run in a python 2 environment. This is due to PyGChem. AC_tools should install fine in Python 2 environment. Is your install of AC_tools not successful in a python2 environment?
When using the convert_to_netCDF function, you need to be in a Python2 environment. For doing anything else using AC_tools, I would recommend using a python3 environment.
from ac_tools.
No, I am not able to install AC_tools in a python2 environment. This is the error:
ERROR: Package 'AC-tools' requires a different Python: 2.7.17 not in '>=3.5'
from ac_tools.
OK. You are installing via the pip method listed on the README, correct?
I've not re-installed a AC_tools in python2 since switching to the pip method. I think the second approach listed on the wiki should work. Would be able to give that a go?
I am assuming you have successfully installed PyGChem and iris in your Python2 environment already?
from ac_tools.
I have successfully installed AC_tools with the second approach.
PyGChem 0.3.0 and iris 2.2.1 are also installed in the environment.
But again, I have the same error when executing "convert_to_netCDF" function:
Creating a netCDF from 1 file(s). This can take some time...
Traceback (most recent call last):
File "", line 1, in
ds=AC.convert_to_netCDF(folder=folder,bpch_file_type='trac_avg.*')
File "/home/i/irs11/miniconda3/envs/py27/lib/python2.7/site-packages/AC_tools-0.1.1-py2.7.egg/AC_tools/bpch2netCDF.py", line 62, in convert_to_netCDF
file_type=bpch_file_type, verbose=verbose)
File "/home/i/irs11/miniconda3/envs/py27/lib/python2.7/site-packages/AC_tools-0.1.1-py2.7.egg/AC_tools/bpch2netCDF.py", line 209, in bpch_to_netCDF
bpch_data = datasets.load(bpch_files)
NameError: global name 'datasets' is not defined
from ac_tools.
Importing pygchem does not show any error. However, the other two lines show these errors:
`from pygchem import datasets
Traceback (most recent call last):
File "", line 1, in
from pygchem import datasets
File "/home/i/irs11/miniconda3/envs/py27/lib/python2.7/site-packages/PyGChem-0.3.0.dev0-py2.7.egg/pygchem/datasets.py", line 97, in
_load_backend(DEFAULT_BACKEND)
File "/home/i/irs11/miniconda3/envs/py27/lib/python2.7/site-packages/PyGChem-0.3.0.dev0-py2.7.egg/pygchem/datasets.py", line 41, in _load_backend
.format(backend_name))
File "/home/i/irs11/miniconda3/envs/py27/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/home/i/irs11/miniconda3/envs/py27/lib/python2.7/site-packages/PyGChem-0.3.0.dev0-py2.7.egg/pygchem/dataset_backends/backend_iris.py", line 27, in
import iris.unit
ImportError: No module named unit
import pygchem.datafields as datasets
Traceback (most recent call last):
File "", line 1, in
import pygchem.datafields as datasets
ImportError: No module named datafields`
from ac_tools.
Finally, it works with the iris version '1.13.0'.
Thank you very much.
from ac_tools.
Good to hear!
I will add some information on this to the README to help others who encounter this in the future.
from ac_tools.
Related Issues (20)
- Make PDFs (e.g. of plots etc) are searchable
- Add links to papers using code directly or indirectly
- Allow for a list of variables to be read in as a dictionary instead of GC_var approach HOT 1
- Ensure use of consistent and concise naming convention for functions
- Improve scalability of reads of many NetCDF files via xarray/dask
- Conda no longer able to build from yaml file HOT 1
- AC_tools in python2 environment installation
- test_convert_to_netCDF / "test_files" dir issue?
- re-build map_plot as plot_map, combing updates from branch 74 HOT 1
- Add code to do a set of benchmark comparisons HOT 1
- Create a nice encompasing species class HOT 3
- Make sure all function follow PEP6 HOT 2
- Tidy up all existing functions, remove vestigial/non-general ones.
- Update read of GEOS-Chem output to use xarray HOT 1
- fall to import modules after installation HOT 5
- Speed up creation of species class objects
- Include basic bpch diagnostics in AC_tools for NetCDF too HOT 2
- Test suite raising errors
- install_requires in setup.py does not correctly capture project dependencies HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ac_tools.