我已经安装了(通过PIP/终端) GETCH,但是python在我告诉它时不会识别它。
import getch我在苹果电脑上
sudo pip install https://pypi.python.org/packages/source/g/getch/getch-1.0-python2.tar.gz#md5=586ea0f1f16aa094ff6a30736ba03c50
The directory '/Users/aaronoliver/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/aaronoliver/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting https://pypi.python.org/packages/source/g/getch/getch-1.0-python2.tar.gz#md5=586ea0f1f16aa094ff6a30736ba03c50
Downloading getch-1.0-python2.tar.gz
Requirement already satisfied (use --upgrade to upgrade): getch==1.0 from https://pypi.python.org/packages/source/g/getch/getch-1.0-python2.tar.gz#md5=586ea0f1f16aa094ff6a30736ba03c50 in /Library/Python/2.7/site-packages发布于 2016-11-10 01:16:02
您标记了这个问题3.x,但getch安装的证据清楚地表明它已安装在site-packages中,为2.7。您还为pip提供了一个指向Python2tarball的显式路径。
为Python的一个版本安装包并不会安装其他版本的包。运行pip3来安装Python3的软件包(根据安装程序的不同,它可能被命名为pip-3.5等)。如果没有安装pip3,python3 -mensurepip应该添加它(取决于Python次要版本),否则您必须手动安装它。无论哪种方式,一旦您拥有了pip3,您只需要正确地安装该软件包:
sudo pip3 install getchhttps://stackoverflow.com/questions/40514769
复制相似问题