尝试psycopg2通过Pip在Mavericks 10.9上安装时出现以下错误:
clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
Run Code Online (Sandbox Code Playgroud)
不确定如何继续并在此处和其他地方搜索此特定错误.任何帮助深表感谢!
以下是pip的完整输出:
$ pip install psycopg2
Downloading/unpacking psycopg2
Downloading psycopg2-2.5.2.tar.gz (685kB): 685kB downloaded
Running setup.py (path:/private/var/folders/0z/ljjwsjmn4v9_zwm81vhxj69m0000gn/T/pip_build_tino/psycopg2/setup.py) egg_info for package psycopg2
Installing collected packages: psycopg2
Running setup.py install for psycopg2
building 'psycopg2._psycopg' extension
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.5.2 (dt dec pq3 …Run Code Online (Sandbox Code Playgroud) 我有一个Numpy数组类型的矩阵.我如何将其作为图像写入磁盘?任何格式都有效(png,jpeg,bmp ......).一个重要的限制是PIL不存在.
我在shell中使用此命令来安装PIL:
easy_install PIL
Run Code Online (Sandbox Code Playgroud)
然后我跑去python输入:import PIL.但我得到这个错误:
Traceback (most recent call last):
File "<console>", line 1, in <module>
ImportError: No module named PIL
Run Code Online (Sandbox Code Playgroud)
我从未遇到过这样的问题,您怎么看?
我试过谷歌搜索和查找其他人的问题.但是,我仍然找不到在mac os x 10.7.2 Lion上安装PIL(for python 2.6或2.7)的清晰/简单配方.
我尝试安装PIL但出错,我该怎么办?
$ Command
Result
------------
$ pip install PIL
Collecting PIL
Could not find a version that satisfies the requirement PIL (from versions: )
No matching distribution found for PIL
--------------------------------------------------------------------
$ pip install PIL --allow-unverified PIL --allow-all-external
DEPRECATION: --allow-all-external has been deprecated and will be removed in the future. Due to changes in the repository protocol, it no longer has any effect.
DEPRECATION: --allow-unverified has been deprecated and will be removed in the future. Due to changes in the …Run Code Online (Sandbox Code Playgroud) 我环顾四周阅读文档,发现没有办法或解决方案,所以我在这里问.是否有任何软件包可以使用Python将JPG图像转换为PNG图像?
我想使用python将一些base64编码的png图像转换为jpg.我知道如何从base64解码回原始:
import base64
pngraw = base64.decodestring(png_b64text)
Run Code Online (Sandbox Code Playgroud)
但是我现在如何将其转换为jpg?只是将pngraw写入文件显然只给我一个png文件.我知道我可以使用PIL,但我该如何做呢?谢谢!
当我运行以下命令时
from tkinter import *
from PIL import ImageTk, Image
root.mainloop()
Run Code Online (Sandbox Code Playgroud)
我有
Traceback (most recent call last):
File "image_viewer.py", line 2, in <module>
from PIL import ImageTk, Image
ImportError: No module named PIL
Run Code Online (Sandbox Code Playgroud)
但我已经安装了 Pillow,一切都很好。