[python] root에서는 라이브러리가 설치가 되는데 가상환경에서는 설치가 안될 때

깨미·2023년 5월 9일
0

Python

목록 보기
10/10

문제

특정 라이브러리를 설치할 때 root에서는 설치가 잘되던 라이브러리가 가상환경에서는 설치가 안되는 경우가 있다.

본인 같은 경우 gevent 라이브러리가 설치가 되지 않았다.

발생했던 에러 내용은 아래와 같다.

failed building wheel for gevent

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
Command "/home/ubuntu/venv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-8nmgknkw/gevent/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-ef3ss0wk-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/ubuntu/venv/include/site/python3.6/gevent" failed with error code 1 in /tmp/pip-build-8nmgknkw/gevent/

해결

pip를 업그레이드 하지 않았거나, pip 버전이 낮은 경우에 발생할 수 있다고 하여 다음 명령어를 실행하여 pip를 업그레이드 해보니 설치가 잘 된다 !

pip3 install --upgrade pip
profile
vis ta vie

0개의 댓글