USF-IMARS / wv-land-cover

:earth_americas: Processing scripts for decision-tree land use classification on worldview 2 imagery
5 stars 5 forks source link

wv_classify_test.py error (seashell) #31

Closed lamchunying closed 4 years ago

lamchunying commented 4 years ago

============================================= ERRORS ============================================== ____ ERROR collecting wv_classify/wv_classifytest.py ____ ImportError while importing test module '/home1/bellalam/XSEDE/git_workspace/imagery_utils/wv2-processing/wv_classify/wv_classify_test.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: wv_classify/wv_classify_test.py:4: in from wv_classify.wv_classify import process_file E ImportError: cannot import name 'process_file' !!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!! ===================================== 1 error in 1.25 seconds =====================================

lamchunying commented 4 years ago

wv2-processing pytest

lamchunying commented 4 years ago

======================================= test session starts ======================================= platform linux -- Python 3.6.7, pytest-4.2.0, py-1.7.0, pluggy-0.8.1 rootdir: /home1/bellalam/XSEDE/git_workspace/imagery_utils/wv2-processing, inifile: collected 3 items / 1 errors / 2 selected

7yl4r commented 4 years ago

Can you try running pytest like this: python -m pytest instead of just pytest?

lamchunying commented 4 years ago

When I trypython -m pytest I receive /usr/bin/python: No module named pytest even though I had pip install pytest

7yl4r commented 4 years ago

This type of error can mean that you have multiple python installations; one pip is using and a different one when you call python. To figure this out you can compare the output of pip --version and python --version.

The "gold standard" way to avoid things like this is to have a python installation just for this one project. You may want to read through this articlehttps://docs.python-guide.org/dev/virtualenvs/ and play around with these tools a bit. I'm only familiar with virtualenv myself but should probably learn the others.


From: Bella Lam notifications@github.com Sent: Wednesday, April 15, 2020 1:47 AM To: USF-IMARS/wv2-processing wv2-processing@noreply.github.com Cc: Tylar tylarmurray@mail.usf.edu; Assign assign@noreply.github.com Subject: Re: [USF-IMARS/wv2-processing] wv_classify_test.py error (seashell) (#31)

This email originated from outside of USF. Do not click links or open attachments unless you recognize the sender or understand the content is safe.

When I trypython -m pytest I receive /usr/bin/python: No module named pytest even though I had pip install pytest

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHubhttps://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FUSF-IMARS%2Fwv2-processing%2Fissues%2F31%23issuecomment-613830124&data=02%7C01%7Ctylarmurray%40usf.edu%7C903dd03be1094d9045db08d7e1008015%7C741bf7dee2e546df8d6782607df9deaa%7C0%7C0%7C637225264571683122&sdata=U6JnzThG8qvwz7qNWUpSVPI40XdwH7hgYwR3P2yozjc%3D&reserved=0, or unsubscribehttps://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAAIAV7XXMPUYRUTJQAKRSQLRMVC7FANCNFSM4ME3CPNQ&data=02%7C01%7Ctylarmurray%40usf.edu%7C903dd03be1094d9045db08d7e1008015%7C741bf7dee2e546df8d6782607df9deaa%7C0%7C0%7C637225264571683122&sdata=ox9VFpm5WmiAR5Lio%2FQUyM6nvtPTNt9goIezse1xixE%3D&reserved=0.