카테고리 없음

env에서 뭐가 안 될 때

잡담연구소 2021. 8. 31. 16:10

개빡친다

ssh 접속해서 그냥 할 땐 설치가 잘 됐는데 env에 들어가서 하니 잘 안됐다. 

error: invalid command 'bdist_wheel'
  
  ----------------------------------------
  Failed building wheel for google-crc32c
  Running setup.py clean for google-crc32c
Failed to build google-crc32c
Installing collected packages: google-crc32c, google-resumable-media, charset-normalizer, idna, certifi, urllib3, requests, six, protobuf, googleapis-common-protos, pyasn1, rsa, pyasn1-modules, cachetools, setuptools, google-auth, google-api-core, google-cloud-core, google-cloud-storage, pfile
  Running setup.py install for google-crc32c ... error
    Complete output from command /home/hyerinoh/abusing-experiment/env/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-afadtaxl/google-crc32c/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-v5yxu1n9-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/hyerinoh/abusing-experiment/env/include/site/python3.7/google-crc32c:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.7
    creating build/lib.linux-x86_64-3.7/google_crc32c
    copying src/google_crc32c/_checksum.py -> build/lib.linux-x86_64-3.7/google_crc32c
    copying src/google_crc32c/cext.py -> build/lib.linux-x86_64-3.7/google_crc32c
    copying src/google_crc32c/__config__.py -> build/lib.linux-x86_64-3.7/google_crc32c
    copying src/google_crc32c/__init__.py -> build/lib.linux-x86_64-3.7/google_crc32c
    copying src/google_crc32c/python.py -> build/lib.linux-x86_64-3.7/google_crc32c
    running build_ext
    building 'google_crc32c._crc32c' extension
    creating build/temp.linux-x86_64-3.7
    creating build/temp.linux-x86_64-3.7/src
    creating build/temp.linux-x86_64-3.7/src/google_crc32c
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/hyerinoh/abusing-experiment/env/include -I/usr/include/python3.7m -c src/google_crc32c/_crc32c.c -o build/temp.linux-x86_64-3.7/src/google_crc32c/_crc32c.o
    src/google_crc32c/_crc32c.c:3:10: fatal error: crc32c/crc32c.h: No such file or directory
     #include <crc32c/crc32c.h>
              ^~~~~~~~~~~~~~~~~
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    
    ----------------------------------------
Command "/home/hyerinoh/abusing-experiment/env/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-afadtaxl/google-crc32c/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-v5yxu1n9-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/hyerinoh/abusing-experiment/env/include/site/python3.7/google-crc32c" failed with error code 1 in /tmp/pip-build-afadtaxl/google-crc32c/

이런 에러가 뜨길래 

검색을 했더니 python-dev를 설치해야한다고 한다. 

근데 알고보니,,,!!! 

그냥 pip version이 안맞아서 그런 거 였다. ^^ 

 

오늘의 교훈 


항상 env를 만들고 난 후에는, pip upgrade를 하자 

 

+ 추가 

왜 env를 만들고 나면 맨 처음 pip 버전이 애매하게 9.0.3일까? 

pip upgrade를 하면 21까지 업그레이드가 되는데 왜 초기가 애매하게 9.0.3일까? 

그것의 비밀은 ensurepip에 숨겨져있다

https://stackoverflow.com/questions/61796417/why-does-venv-contain-an-older-version-of-pip-9-0-3