티스토리 뷰
Stack Overflow에 자주 검색, 등록되는 문제들과 제가 개발 중 찾아 본 문제들 중에서 나중에도 찾아 볼 것 같은 문제들을 정리하고 있습니다.
Stack Overflow에서 가장 먼저 확인하게 되는 가장 높은 점수를 받은 Solution과 현 시점에 도움이 될 수 있는 가장 최근에 업데이트(최소 점수 확보)된 Solution을 각각 정리하였습니다.
아래 word cloud를 통해 이번 포스팅의 주요 키워드를 미리 확인하세요.

pip installs packages successfully, but executables not found from command line
pip가 패키지를 성공적으로 설치하지만 command line에서 실행 파일을 찾을 수 없습니다.
문제 내용
I am working on mac OS X Yosemite, version 10.10.3.
나는 맥 OS X Yosemite 버전 10.10.3에서 일하고 있다.
I installed python2.7 and pip using macport as done in http://johnlaudun.org/20150512-installing-and-setting-pip-with-macports/
나는 macport를 사용하여 python 2.7과 pip를 설치했습니다. http://johnlaudun.org/20150512-installing-and-setting-pip-with-macports/
I can successfully install packages and import them inside my python environment and python scripts. However any executable associated with a package that can be called from the command line in the terminal are not found.
나는 성공적으로 패키지를 설치하고 내 파이썬 환경과 파이썬 스크립트 안에 가져올 수 있다. 그러나 터미널의 command line에서 호출할 수 있는 패키지와 연결된 실행 파일을 찾을 수 없습니다.
Does anyone know what might be wrong? (More details below)
뭐가 잘못됐는지 아는 사람 있나요? (자세한 내용은 아래 참조)
For example while installing a package called "rosdep" as instructed in http://wiki.ros.org/jade/Installation/Source
예를 들어 http://wiki.ros.org/jade/Installation/Source의 지침에 따라 "rosdep"이라는 패키지를 설치하는 동안
I can run: sudo pip install -U rosdep
which installs without errors and corresponding files are located in /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
I can run: sudo pip install - Urosdep 오류 없이 설치되며 해당 파일은 /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python 2.7/site-packages에 있습니다.
However if I try to run : sudo rosdep init
, it gives an error : "sudo: rosdep: command not found"
하지만 내가 실행을 시도하면, sudo rosdepit. "sudo: rosdep: command not found" 오류가 표시됩니다.
This is not a package specific error. I get this for any package installed using pip on my computer. I even tried adding
이것은 패키지별 오류가 아닙니다. 나는 내 컴퓨터에 pip를 사용하여 설치된 모든 패키지에 대해 이것을 받는다. 나는 심지어 추가를 시도했다.
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
to my $PATH
. But the executables are not found on the command line, even though the packages work perfectly from within python.
내 $PATH로. 그러나 패키지가 파이썬 내에서 완벽하게 작동하더라도 실행 파일은 명령줄에서 찾을 수 없습니다.
높은 점수를 받은 Solution
I know the question asks about macOS, but here is a solution for Linux users who arrive here via Google.
MacOS에 대해 묻는 질문은 알지만, 여기 구글을 통해 이곳에 도착한 리눅스 사용자들을 위한 해결책이 있다.
I was having the issue described in this question, having installed the pdfx package via pip.
저는 pip를 통해 pdfx 패키지를 설치하여 이 질문에 설명된 문제를 가지고 있었습니다.
When I ran it however, nothing...
하지만 내가 실행했을 때는 아무것도...
pip list | grep pdfx
pdfx (1.3.0)
Yet:
그러나:
which pdfx
pdfx not found
The problem on Linux is that pip install ...
drops scripts into ~/.local/bin
and this is not on the default Debian/Ubuntu $PATH
.
Linux의 문제는 pip install...이(가) 스크립트를 ~/.local/bin으로 삭제하고 이 스크립트가 기본 Debian/Ubuntu $PATH에 없다는 것입니다.
Here's a GitHub issue going into more detail: https://github.com/pypa/pip/issues/3813
다음은 GitHub 문제에 대한 자세한 내용입니다. https://github.com/pypa/pip/issues/3813
To fix, just add ~/.local/bin
to your $PATH
, for example by adding the following line to your .bashrc
file:
수정하려면 예를 들어 다음 줄을 .bashrc 파일에 추가하여 $PATH에 ~/.local/bin을 추가하십시오.
export PATH="$HOME/.local/bin:$PATH"
After that, restart your shell and things should work as expected.
그 후에, 당신의 쉘을 다시 시작하면, 예상대로 잘 작동할 것이다.
가장 최근 달린 Solution
Windows and Python 3.9 from MS Store
MS Store의 Windows 및 Python 3.9
I have a different path with python -m site --user-base
and python -m site
- yes, the second command without --user-base
to get all sites - as the other answers here state:
나는 python -m site --user-base와 python -m site - 네, 모든 사이트를 가져오는 --user-base가 없는 두 번째 명령어를 가지고 있습니다. 다른 대답은 다음과 같습니다.
C:\Users\<your User>\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages
Why is my path different
왜 나의 길은 다른가요?
Because I installed python
from MS Store
MS Store에서 python을 설치했기 때문이다.
Solution
해결책
Put the above path in your path and replace site-packages
with scripts
경로에 위의 경로를 입력하고 사이트 패키지를 스크립트로 바꿉니다.
출처 : https://stackoverflow.com/questions/35898734/pip-installs-packages-successfully-but-executables-not-found-from-command-line
'개발 > 파이썬' 카테고리의 다른 글
열 값을 기준으로 데이터 프레임에서 행을 선택하려면 어떻게 해야 합니까? (0) | 2022.11.28 |
---|---|
Pandas에서 데이터 프레임의 행을 반복하는 방법 (0) | 2022.11.28 |
Requests 패키지를 사용할 때 SSL InsecurePlatform 오류 발생 (0) | 2022.11.28 |
ImportError: 'django.core.urlresolvers'라는 모듈이 없습니다. (0) | 2022.11.28 |
동적으로 가져온 모듈에서 동적 인스턴스 생성하기 (0) | 2022.11.28 |