Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Data Visualization with Bokeh Getting and Displaying Data Getting Started with Bokeh

Error in Terminal when trying to install requirements.txt.

Trying to install the requirements.txt file in the terminal throws an error. I've tried manually installing each separately, NumPy and Pandas on their own throw an error as well. I thought maybe the error was coming from having Conda and Anaconda installed from previous courses so lastly I created a virtualenv and tried to install the requirements.txt within its own environment and still errors generated. I noticed that NumPy was installed but for a new version. I've included some snippets from the Terminal. Any help here is greatly appreciated.

(project1_env) patricks-mbp-2:Environments patrickbrusven$ pip install pandas==0.20.1
Collecting pandas==0.20.1
  Using cached pandas-0.20.1.tar.gz (10.3 MB)
Requirement already satisfied: python-dateutil>=2 in ./project1_env/lib/python3.8/site-packages (from pandas==0.20.1) (2.8.1)
Collecting pytz>=2011k
  Using cached pytz-2020.1-py2.py3-none-any.whl (510 kB)
Requirement already satisfied: numpy>=1.7.0 in ./project1_env/lib/python3.8/site-packages (from pandas==0.20.1) (1.19.0)
Requirement already satisfied: six>=1.5 in ./project1_env/lib/python3.8/site-packages (from python-dateutil>=2->pandas==0.20.1) (1.15.0)
Building wheels for collected packages: pandas
  Building wheel for pandas (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/patrickbrusven/Environments/project1_env/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/zv/yhn2qb9n6mq5rjz3tgn2mvsh0000gn/T/pip-install-c99m_if8/pandas/setup.py'"'"'; __file__='"'"'/private/var/folders/zv/yhn2qb9n6mq5rjz3tgn2mvsh0000gn/T/pip-install-c99m_if8/pandas/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/zv/yhn2qb9n6mq5rjz3tgn2mvsh0000gn/T/pip-wheel-z906jjan
       cwd: /private/var/folders/zv/yhn2qb9n6mq5rjz3tgn2mvsh0000gn/T/pip-install-c99m_if8/pandas/
/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8/cpython/pystate.h:81:15: note: 'curexc_traceback' declared here
      PyObject *curexc_traceback;
                ^
  fatal error: too many errors emitted, stopping now [-ferror-limit=]
  19 warnings and 20 errors generated.
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for pandas
  Running setup.py clean for pandas
Failed to build pandas
Installing collected packages: pytz, pandas
    Running setup.py install for pandas ... error
    ERROR: Command errored out with exit status 1:
     command: /Users/patrickbrusven/Environments/project1_env/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/zv/yhn2qb9n6mq5rjz3tgn2mvsh0000gn/T/pip-install-c99m_if8/pandas/setup.py'"'"'; __file__='"'"'/private/var/folders/zv/yhn2qb9n6mq5rjz3tgn2mvsh0000gn/T/pip-install-c99m_if8/pandas/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/zv/yhn2qb9n6mq5rjz3tgn2mvsh0000gn/T/pip-record-foc4nhdb/install-record.txt --single-version-externally-managed --compile --install-headers /Users/patrickbrusven/Environments/project1_env/include/site/python3.8/pandas
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/patrickbrusven/Environments/project1_env/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/zv/yhn2qb9n6mq5rjz3tgn2mvsh0000gn/T/pip-install-c99m_if8/pandas/setup.py'"'"'; __file__='"'"'/private/var/folders/zv/yhn2qb9n6mq5rjz3tgn2mvsh0000gn/T/pip-install-c99m_if8/pandas/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/zv/yhn2qb9n6mq5rjz3tgn2mvsh0000gn/T/pip-record-foc4nhdb/install-record.txt --single-version-externally-managed --compile --install-headers /Users/patrickbrusven/Environments/project1_env/include/site/python3.8/pandas Check the logs for full command output.
(project1_env) patricks-mbp-2:Environments patrickbrusven$ pip list
Package         Version
--------------- ---------
bokeh           0.12.5
certifi         2020.6.20
chardet         3.0.4
idna            2.5
Jinja2          2.11.2
MarkupSafe      1.1.1
numpy           1.19.0
pip             20.1.1
python-dateutil 2.8.1
pytz            2020.1
PyYAML          5.3.1
requests        2.17.3
setuptools      47.3.1
six             1.15.0
tornado         6.0.4
urllib3         1.21.1
wheel           0.34.2

1 Answer

Tom Nguyen
Tom Nguyen
33,500 Points

You would need to create a file called requirements.txt. I got it from bokeh documentation.

requirements.txt
PyYAML>=3.10
python-dateutil>=2.1
Jinja2>=2.7
numpy>=1.11.3
pillow>=7.1.0
packaging>=16.8
tornado>=5.1
typing_extensions >=3.7.4

After that you would be able to run the command.

python3 -m pip3 install -r requirements.txt