Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/365.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法在virtualenv中安装mySQL python_Python_Python 2.7_Pip_Virtualenv_Mysql Python - Fatal编程技术网

无法在virtualenv中安装mySQL python

无法在virtualenv中安装mySQL python,python,python-2.7,pip,virtualenv,mysql-python,Python,Python 2.7,Pip,Virtualenv,Mysql Python,当我尝试在virtualenv中安装MySQL-python(pip-install-MySQL-python)时,我得到以下错误(截短到最后几行) 谷歌曾告诉我需要安装python-devel,尽管当我运行yum安装python-devel时,我会发现 Package python-devel-2.6.6-52.el6.x86_64 already installed and latest version Nothing to do 我在安装了python 2.6和2.7的CentOS 6.

当我尝试在virtualenv中安装MySQL-python(
pip-install-MySQL-python
)时,我得到以下错误(截短到最后几行)

谷歌曾告诉我需要安装
python-devel
,尽管当我运行
yum安装python-devel
时,我会发现

Package python-devel-2.6.6-52.el6.x86_64 already installed and latest version
Nothing to do
我在安装了python 2.6和2.7的CentOS 6.5机器上。我在我的VirtualNVS中使用Python2.7。我在运行
pip安装mySQL-python
时激活了virtualenv

我已经尝试过在激活和停用virtualenv的情况下运行
yum install python devel
,两次都会显示“ready installed”消息

这是否意味着Python27安装没有得到python-devel安装

另一个线程建议尝试
yum安装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-breaked
不起作用,它只是跳过了它)

解决:我需要运行
sudo-yum--enablerepo=remi-install-mysql-devel

然后,运行
pip-install-MySQL-python
工作正常(激活了我的virtualenv)

看到这个答案了吗

(我发誓我在发布前搜索了大约1.5小时)

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