运行/usr/bin/python3 m pip install cImage后,pycharm中未解析的引用“cImage”

2024-09-27 23:15:12 发布

您现在位置:Python中文网/ 问答频道 /正文

问题解释

我知道/usr/bin/python3是我的翻译

enter image description here

所以我尝试安装我想要使用的软件包,它告诉我它已经安装好了

/usr/bin/python3 -m pip install cImage
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: cImage in /Users/Sam/Library/Python/3.7/lib/python/site-packages (2.0.2)
Requirement already satisfied: Pillow>=2.9.0 in /Users/Sam/Library/Python/3.7/lib/python/site-packages (from cImage) (7.1.2)
WARNING: You are using pip version 20.1.1; however, version 20.2 is available.
You should consider upgrading via the '/Applications/Xcode.app/Contents/Developer/usr/bin/python3 -m 

但是我也得到了一个错误,我有一个未解析的引用

enter image description here


额外信息

which pip3
/usr/bin/pip3
which python3
/usr/bin/python3

我的Python之路

python3 -c "import sys; print('\n'.join(sys.path))"

/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python37.zip
/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7
/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/lib-dynload
/Users/Sam/Library/Python/3.7/lib/python/site-packages
/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site-packages
/Library/Python/3.7/site-packages

我真的很想在我的电脑上安装一个python3和一个pip3,而不必担心所有这些不同的版本到处运行,似乎无法在正确的位置安装任何东西

我需要解决的是,我需要将cImage安装到我的/usr/bin/python中,以便在Pycharm中运行它


Tags: appdeveloperbinlibpackagesusrcontentslibrary
1条回答
网友
1楼 · 发布于 2024-09-27 23:15:12

documentation

cImage作为import image导入

import image

win = image.ImageWin(480, 640, "Image Processing")
original_image = image.FileImage('lcastle.gif')

width = original_image.get_width()
height = original_image.get_height()
print(width, height)

相关问题 更多 >

    热门问题