Python

mac에 Numpy, Pandas, Matplotlib 설치하기

yunny_world 2022. 5. 17. 15:09
python3 --version

python3 버전 확인

 

pip3 --version

pip3 버전 확인 

 

pip install

 

pip3 설치 안되어있으면 설치하기

 

pip3 install numpy

pip3로 numpy 설치

https://carpfish.tistory.com/entry/pip를-이용한-Numpy-설치python3

 

pip3 install pandas

pip3로 pandas 설치

https://carpfish.tistory.com/entry/pip를-이용한-Pandas-설치python3

 

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pandas/util/_tester.py", line 15, in test
    import pytest
ModuleNotFoundError: No module named 'pytest'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    pd.test()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pandas/util/_tester.py", line 17, in test
    raise ImportError("Need pytest>=5.0.1 to run tests") from err
ImportError: Need pytest>=5.0.1 to run tests

위와 같은 에러 떠서 pytest가 필요함을 깨닫고

pip3 install pytest

로 pytest 설치

 

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pandas/util/_tester.py", line 19, in test
    import hypothesis  # noqa:F401
ModuleNotFoundError: No module named 'hypothesis'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    pd.test()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pandas/util/_tester.py", line 21, in test
    raise ImportError("Need hypothesis>=3.58 to run tests") from err
ImportError: Need hypothesis>=3.58 to run tests

다음엔 위와 같은 에러 떠서 hypothesis가 필요함을 깨닫고

pip3 install hypothesis

로 hypothesis 설치

 

numpy, pandas 설치 후 pip3 버전 낮다고 알려줘서 업그레이드 했다.

pip3 install --upgrade pip

 

pip3 install matplotlib

pip3로 matplotlib 설치

https://www.geeksforgeeks.org/how-to-install-matplotlib-on-macos/