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

BUG: requests not installed #23

Closed
rstoneback opened this issue Jun 14, 2021 · 6 comments
Closed

BUG: requests not installed #23

rstoneback opened this issue Jun 14, 2021 · 6 comments
Labels
bug Something isn't working

Comments

@rstoneback
Copy link
Collaborator

New conda environment. Ran python setup.py develop on code in #18. Upon attempted import I get an error about a lack of requests.

In [1]: import pysat

In [2]: gps = pysat.Instrument('cosmic', 'gps', 'ionprf', update_files=True)
pysat ERROR: unable to locate or import module for platform cosmic, name gps
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
~/Code/pysat/pysat/_instrument.py in _assign_attrs(self, by_name, inst_module, tag, inst_id)
   1195                 try:
-> 1196                     inst = importlib.import_module(mod)
   1197                 except ImportError as ierr:

~/opt/anaconda3/envs/testingcdaac/lib/python3.8/importlib/__init__.py in import_module(name, package)
    126             level += 1
--> 127     return _bootstrap._gcd_import(name[level:], package, level)
    128 

~/opt/anaconda3/envs/testingcdaac/lib/python3.8/importlib/_bootstrap.py in _gcd_import(name, package, level)

~/opt/anaconda3/envs/testingcdaac/lib/python3.8/importlib/_bootstrap.py in _find_and_load(name, import_)

~/opt/anaconda3/envs/testingcdaac/lib/python3.8/importlib/_bootstrap.py in _find_and_load_unlocked(name, import_)

~/opt/anaconda3/envs/testingcdaac/lib/python3.8/importlib/_bootstrap.py in _call_with_frames_removed(f, *args, **kwds)

~/opt/anaconda3/envs/testingcdaac/lib/python3.8/importlib/_bootstrap.py in _gcd_import(name, package, level)

~/opt/anaconda3/envs/testingcdaac/lib/python3.8/importlib/_bootstrap.py in _find_and_load(name, import_)

~/opt/anaconda3/envs/testingcdaac/lib/python3.8/importlib/_bootstrap.py in _find_and_load_unlocked(name, import_)

~/opt/anaconda3/envs/testingcdaac/lib/python3.8/importlib/_bootstrap.py in _call_with_frames_removed(f, *args, **kwds)

~/opt/anaconda3/envs/testingcdaac/lib/python3.8/importlib/_bootstrap.py in _gcd_import(name, package, level)

~/opt/anaconda3/envs/testingcdaac/lib/python3.8/importlib/_bootstrap.py in _find_and_load(name, import_)

~/opt/anaconda3/envs/testingcdaac/lib/python3.8/importlib/_bootstrap.py in _find_and_load_unlocked(name, import_)

~/opt/anaconda3/envs/testingcdaac/lib/python3.8/importlib/_bootstrap.py in _load_unlocked(spec)

~/opt/anaconda3/envs/testingcdaac/lib/python3.8/importlib/_bootstrap_external.py in exec_module(self, module)

~/opt/anaconda3/envs/testingcdaac/lib/python3.8/importlib/_bootstrap.py in _call_with_frames_removed(f, *args, **kwds)

~/Code/pysatCDAAC/pysatCDAAC/__init__.py in <module>
----> 1 from pysatCDAAC import instruments  # noqa F401

~/Code/pysatCDAAC/pysatCDAAC/instruments/__init__.py in <module>
      3 for inst in __all__:
----> 4     exec("from pysatCDAAC.instruments import {x}".format(x=inst))

~/Code/pysatCDAAC/pysatCDAAC/instruments/__init__.py in <module>

~/Code/pysatCDAAC/pysatCDAAC/instruments/cosmic_gps.py in <module>
     48 import os
---> 49 import requests
     50 import tarfile

ModuleNotFoundError: No module named 'requests'

During handling of the above exception, another exception occurred:

ImportError                               Traceback (most recent call last)
<ipython-input-2-6bfefd1ca5a1> in <module>
----> 1 gps = pysat.Instrument('cosmic', 'gps', 'ionprf', update_files=True)

~/Code/pysat/pysat/_instrument.py in __init__(self, platform, name, tag, inst_id, clean_level, update_files, pad, orbit_info, inst_module, directory_format, file_format, temporary_file_list, strict_time_flag, ignore_empty_files, labels, custom, **kwargs)
    231 
    232                 # Look to module for instrument functions and defaults
--> 233                 self._assign_attrs(by_name=True, tag=self.tag,
    234                                    inst_id=self.inst_id)
    235             elif (platform is None) and (name is None):

~/Code/pysat/pysat/_instrument.py in _assign_attrs(self, by_name, inst_module, tag, inst_id)
   1200                     estr = estr.format(self.platform, self.name)
   1201                     logger.error(estr)
-> 1202                     raise ImportError(ierr)
   1203         elif inst_module is not None:
   1204             # User supplied an object with relevant instrument routines

ImportError: No module named 'requests'
@rstoneback
Copy link
Collaborator Author

requests is listed in setup.cfg and in requirements.txt....

@jklenzing
Copy link
Member

I thought that requirements are only auto-installed when installing from pip

@rstoneback
Copy link
Collaborator Author

I thought requirements were installed with a python setup.py blah with the exception if a package was already there, but out of version spec, it isn't updated.

@jklenzing jklenzing added the bug Something isn't working label Oct 22, 2021
@jklenzing
Copy link
Member

Just created a new conda environment (python 3.7) and tried the above steps, have not been able to duplicate the bug.

@jklenzing
Copy link
Member

@rstoneback, this issue was pre-v0.0.2 release (July 7). Looking through the previous version, it seems that install_requires was set up incorrectly in setup.cfg : https://github.com/pysat/pysatCDAAC/blob/v0.0.1/setup.cfg

The whole [options] section is tabbed over, which I think gets ignored when looking for requirements. I think this can be closed, unless you've seen this issue elsewhere. Sorry, forgot to bring this up at the meeting today.

@rstoneback
Copy link
Collaborator Author

rstoneback commented Oct 27, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants