- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
当我尝试在 virtualenv 中安装 MySQL-python (pip install MySQL-python
) 时,出现以下错误(截断为最后几行)
_mysql.c: At top level:
_mysql.c:2551: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:2558: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c:2565: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:2572: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:2579: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:2642: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c:2642: error: initializer element is not constant
_mysql.c:2642: error: (near initialization for ‘_mysql_ResultObject_memberlist[0].offset’)
_mysql.c: In function ‘_mysql_ConnectionObject_getattr’:
_mysql.c:2666: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
error: command 'gcc' failed with exit status 1
谷歌搜索告诉我需要安装 python-devel
,虽然当我运行 yum install python-devel
时我得到了
Package python-devel-2.6.6-52.el6.x86_64 already installed and latest version
Nothing to do
我在 CentOS 6.5 机器上安装了 python 2.6 和 2.7。我在我的 virtualenvs 中使用 python 2.7。我在运行 pip install mySQL-python
时激活了 virtualenv。
我已经尝试运行 yum install python-devel
激活和停用 virtualenv,它两次都显示“已安装”消息。
这是否意味着 python 27 安装没有安装 python-devel
?
另一个线程建议尝试 yum install mysql-devel.x86_64
,尽管这给出了
Resolving Dependencies
--> Running transaction check
---> Package mysql-devel.x86_64 0:5.1.73-3.el6_5 will be installed
--> Processing Dependency: mysql = 5.1.73-3.el6_5 for package: mysql-devel-5.1.73-3.el6_5.x86_64
--> Finished Dependency Resolution
Error: Package: mysql-devel-5.1.73-3.el6_5.x86_64 (base)
Requires: mysql = 5.1.73-3.el6_5
Installed: mysql-5.5.40-1.el6.remi.x86_64 (@remi)
mysql = 5.5.40-1.el6.remi
Available: mysql-5.1.73-3.el6_5.x86_64 (base)
mysql = 5.1.73-3.el6_5
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
(使用 --skip-broken
不起作用,它只是跳过它)
最佳答案
已解决:我需要运行 sudo yum --enablerepo=remi install mysql-devel
然后,运行 pip install MySQL-python
成功了(我的 virtualenv 已激活)
查看此答案 https://serverfault.com/questions/601162/cant-install-mysql-devel-on-centos-6-5
(我发誓我在发布前搜索了大约 1.5 小时)
关于python - 无法在 virtualenv 中安装 mySQL-python,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26954417/
我有一个相对较大的项目,有很多依赖项,我想分发这个项目,但是安装这些依赖项有点痛苦,并且需要很长时间(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
我是一名优秀的程序员,十分优秀!