- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我按照以下步骤在 virtualenv (Mac OSX) 中安装 kivy,并支持 sdl2
$ brew install sdl2 sdl2_image sdl2_ttf sdl2_mixer gstreamer
$ pip install -I Cython
$ USE_OSX_FRAMEWORKS=0 pip install kivy
但是当尝试运行基本文档代码时
from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label
from kivy.uix.textinput import TextInput
class LoginScreen(GridLayout):
def __init__(self, **kwargs):
super(LoginScreen, self).__init__(**kwargs)
self.cols = 2
self.add_widget(Label(text='User Name'))
self.username = TextInput(multiline=False)
self.add_widget(self.username)
self.add_widget(Label(text='password'))
self.password = TextInput(password=True, multiline=False)
self.add_widget(self.password)
class MyApp(App):
def build(self):
return LoginScreen()
if __name__ == '__main__':
MyApp().run()
我收到以下错误
[INFO ] [Logger ] Record log in /Users/manthansharma/.kivy/logs/kivy_16-08-25_68.txt
[INFO ] [Kivy ] v1.9.1
[INFO ] [Python ] v3.5.2 (default, Aug 16 2016, 05:35:40)
[GCC 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.31)]
[INFO ] [Factory ] 179 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_imageio, img_dds, img_gif (img_pygame, img_pil, img_ffpyplayer ignored)
[CRITICAL ] [Text ] Unable to find any valuable Text provider at all!
pygame - ImportError: No module named 'pygame'
File "/Users/manthansharma/virtualenvs/kivy/lib/python3.5/site-packages/kivy/core/__init__.py", line 59, in core_select_lib
fromlist=[modulename], level=0)
File "/Users/manthansharma/virtualenvs/kivy/lib/python3.5/site-packages/kivy/core/text/text_pygame.py", line 12, in <module>
import pygame
pil - ImportError: No module named 'PIL'
File "/Users/manthansharma/virtualenvs/kivy/lib/python3.5/site-packages/kivy/core/__init__.py", line 59, in core_select_lib
fromlist=[modulename], level=0)
File "/Users/manthansharma/virtualenvs/kivy/lib/python3.5/site-packages/kivy/core/text/text_pil.py", line 8, in <module>
from PIL import Image, ImageFont, ImageDraw
[CRITICAL ] [App ] Unable to get a Text provider, abort.
我还尝试在 KIVY_SDL2_PATH 中给出 sdl2.dylib 的路径,但没有得到任何结果,但使用 kivy.app 工作正常,但我想使用 virtualenv
最佳答案
我在我的新 Mac (Sierra) 上也遇到了类似的错误。我遵循了https://github.com/kivy/kivy/issues/4688的建议
并使用命令安装最新版本的 KivyUSE_OSX_FRAMEWORKS=0 pip install https://github.com/kivy/kivy/zipball/master
这对我有用,Kivy 现在使用 SDL2,而不是寻找 pygame。
以前,我要么需要 pygame,但在调整窗口大小时收到有关“Windows BMP 文件”的错误,或者如果我删除了 pygame,它找不到我用brew 安装的 SDL2。
关于macos - Virtualenv 中的 Kivy 对 SDL2 的支持,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39141563/
我有一个相对较大的项目,有很多依赖项,我想分发这个项目,但是安装这些依赖项有点痛苦,并且需要很长时间(pip install 需要相当长的时间)。所以我想知道是否有可能将整个 virtualenv 迁
我有一个 heroku 项目,我想与其他人分享。作为the instructions describe ,我使用 virtualenv 来管理环境和依赖项。有没有办法在新机器上从 requiremen
当我被迫更改我的项目目录名称时,我遇到了一个问题。 首先 Virtualenvwrapper 没有看到我的项目,所以我将 WORKON_HOME 的环境变量更改为新的项目目录。然后我可以激活我的环境。
你可以cd到YOUR_ENV/lib/pythonxx/site-packages/看看,但是有什么方便的方法吗? pip freeze 列出所有已安装的软件包,包括系统环境的软件包。 最佳答案 您可
我想使用 tox 在需要额外设置的项目上运行 py.test 除了将包安装到 virtualenv 之外。创建 virtualenv 并安装依赖项后,需要运行一些命令。 具体来说,我说的是使用 nod
背景:我正在 Mac OS High Sierra 上开发 Flaskr Web 项目。 正处于安装 Flask 阶段,我在安装 virtualenv 时遇到了问题: http://flask.poc
我在我的 ubuntu 电脑上制作了我的 virtualenv。我在那里开发了我的项目。 但我需要 move 我的环境,因为它包含所有包。因为目标机器无法通过网络连接到外部。我必须通过 USB mov
我在激活 virtualenv 时遇到问题。我在服务器上工作并使用 SSH 安全外壳。 我的最终目标是激活 virtualenv 并运行最新版本的 tensorflow 命令行如下: jeonguyo
我的 ~/Documents 中有一堆项目.我几乎只在 python 中工作,所以这些基本上都是 python 项目。每一个,例如~/Documents/foo有自己的 virtualenv,~/Do
我有 --no-site-packages 的 virtualenv选项。我在里面使用了scrapy。 Scrapy 通过 import libxml2 使用 libxml2 .如何使用 pip 在
在 virtualenvwrapper 中,有没有一种简单的方法可以列出我的计算机上的所有 virtualenv? (就像 yolk -l 那样列出当前虚拟环境中的所有 python 包?) 澄清:
本页命令行指令 https://github.com/plumi/plumi.app/blob/master/docs/INSTALL.rst 是“虚拟环境”。 即空格后有句号。 我找不到以这种方式在
我们可以创建一个 virtualenv 吗?从现有的 virtualenv 继承已安装的库? 详细说明: 我首先创建一个“引用”virtualenv,并添加库(固定版本): virtualenv re
我正在使用 sphinx记录我的软件。我正在使用 virtualenv用于安装。现在有些包只安装在虚拟环境中,sphinx 看不到。 我的 conf.py 中有此代码: # If extensions
这个问题在这里已经有了答案: Can existing virtualenv be upgraded gracefully? (5 个回答) 2年前关闭。 我已经使用 python 3.6 创建了一个
这看起来应该很简单: tasks: - name: install python packages pip: name=${item} virtualenv=~/buildbot-env wi
我已经看到了一些针对此问题的修复,但没有一个对我有用,但我认为是我的 virtualenvs 损坏了。我刚刚从 12.04 升级到 14.04,现在我所有的金字塔应用程序都不再工作了。 当我运行 ..
假设我有以下设置: mkdir test && cd test virtualenv .venv source .venv/bin/activate pip install django mkdir
我从 Github 帐户克隆了我的 Django 项目,并使用著名的命令 source nameofenv/bin/activate 激活了 virtualenv当我运行 python manage.
不久前我用 uwsgi/nginx 设置了一个 flask 站点,并设置了一个 virtualenv .. 我忘记了我设置的 venv 的名称,我找不到任何方法在当前目录中列出 virtualenv
我是一名优秀的程序员,十分优秀!