Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error of expected str, bytes or os.PathLike object, not NoneType #81

Open
Niilavarnam opened this issue Aug 2, 2024 · 1 comment
Open

Comments

@Niilavarnam
Copy link

Niilavarnam commented Aug 2, 2024

Hello!

I want to use nco to process netcdf files. I have debian, and I have created a virtual environment, and I have installed nco with pip install. And it installed fine. But I don't know why it doesn't work, not even the example of the web https://pypi.org/project/nco/:

from nco import Nco
nco = Nco()
temperatures = nco.ncra(input='input.nc', returnCdf=True).variables['T'][:]

this is the error I get:
Traceback (most recent call last):
File "/home/tlopez/Work_BEC/02_Python/BEC_Script/t_Try_Code.py", line 2, in
nco = Nco()
^^^^^
File "/home/usr-t/Work/Python/Script/lib/python3.11/site-packages/nco/nco.py", line 55, in init
self.nco_path = os.path.split(shutil.which("ncks"))[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 103, in split
TypeError: expected str, bytes or os.PathLike object, not NoneType

@hmb1
Copy link
Collaborator

hmb1 commented Aug 2, 2024

HI Niilavarnam
You need to have the ncks operators in your path (the env variable PATH).
In terminal try typing ncks and see what you get ?

....Henry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants