GithubHelp home page GithubHelp logo

Comments (8)

tsherwen avatar tsherwen commented on August 18, 2024 1

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.

tsherwen avatar tsherwen commented on August 18, 2024

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.

iriadigos avatar iriadigos commented on August 18, 2024

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.

tsherwen avatar tsherwen commented on August 18, 2024

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.

iriadigos avatar iriadigos commented on August 18, 2024

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.

iriadigos avatar iriadigos commented on August 18, 2024

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.

iriadigos avatar iriadigos commented on August 18, 2024

Finally, it works with the iris version '1.13.0'.
Thank you very much.

from ac_tools.

tsherwen avatar tsherwen commented on August 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.