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

Add requests package to setup.py #40

Closed
asparke2 opened this issue Jan 10, 2024 · 3 comments
Closed

Add requests package to setup.py #40

asparke2 opened this issue Jan 10, 2024 · 3 comments
Assignees

Comments

@asparke2
Copy link
Member

Issue overview

The requests package is not imported by another dependency when pip installing buildstock-query. Unclear poe

Current Behavior

The library does not work after installing via setup.py because of missing requests dependency

Expected Behavior

The library works after installing via setup.py

@rajeee
Copy link
Collaborator

rajeee commented Jan 10, 2024

@asparke2 Can you add a minimal reproducible example?
I created a new python environment, installed requests library and then installed buildstock-query

conda create -n test_env python=3.10
conda activate test_env
pip install requests
pip install git+https://github.com/NREL/buildstock-query

I was then able to import both buildstock_query and requests.

from buildstock_query import BuildStockQuery
import requests  # no error

@asparke2
Copy link
Member Author

@rajeee remove the pip install requests from your minimal example and run from buildstock_query import BuildStockQuery and you get:

>>> from buildstock_query import BuildStockQuery
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\aparker\Anaconda3\envs\test_env\lib\site-packages\buildstock_query\__init__.py", line 63, in <module>
    from buildstock_query.main import BuildStockQuery
  File "C:\Users\aparker\Anaconda3\envs\test_env\lib\site-packages\buildstock_query\main.py", line 7, in <module>
    from buildstock_query.tools import UpgradesAnalyzer
  File "C:\Users\aparker\Anaconda3\envs\test_env\lib\site-packages\buildstock_query\tools\__init__.py", line 1, in <module>
    from .upgrades_analyzer import UpgradesAnalyzer
  File "C:\Users\aparker\Anaconda3\envs\test_env\lib\site-packages\buildstock_query\tools\upgrades_analyzer.py", line 13, in <module>
    from buildstock_query.tools.logic_parser import LogicParser
  File "C:\Users\aparker\Anaconda3\envs\test_env\lib\site-packages\buildstock_query\tools\logic_parser.py", line 7, in <module>
    from buildstock_query.file_getter import OpenOrDownload
  File "C:\Users\aparker\Anaconda3\envs\test_env\lib\site-packages\buildstock_query\file_getter.py", line 1, in <module>
    import requests
ModuleNotFoundError: No module named 'requests'

Basically what I'm saying is that requests needs to be added to setup.py since it's a runtime dependency of buildstock-query. A user shouldn't have to manually pip install it separately.

@rajeee
Copy link
Collaborator

rajeee commented Jan 10, 2024

Oh duh! Your Issue title was clear enough. Got confused by the description!
#41

@rajeee rajeee closed this as completed Jan 10, 2024
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