Python中文
首页
教程
问答
标签
搜索
登录
注册
mysql连接器安装在python 2.6中,但不安装在2.7上
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<p>红帽是我的操作系统。默认情况下,它运行<code>python2.6</code>。但是,我需要安装<code>python2.7</code>。我是在<a href="http://developerblog.redhat.com/2013/02/14/setting-up-django-and-python-2-7-on-red-hat-enterprise-6-the-easy-way/" rel="nofollow">this post</a>之后安装的。现在,当我跑步时:</p> <pre><code>$ python -V Python 2.7.5 </code></pre> <p>然而</p> <pre><code>$ sudo python -V Python 2.6.6 </code></pre> <p>所以,我在安装库时遇到问题。 我试图通过以下方式安装<code>mysql-connector</code>:</p> <ul> <li><code>pip install mysql-connector-python</code></li> <li>在<a href="http://dev.mysql.com/doc/connector-python/en/connector-python-installation-binary.html" rel="nofollow">installation guide for source distribution</a>之后</li> <li>跟随<a href="http://dev.mysql.com/doc/connector-python/en/connector-python-installation-source-unix.html" rel="nofollow">installation guide for binary distribution</a></li> </ul> <p>但是,python 2.7版本上没有安装mysql连接器模块。如果我跑:</p> <pre><code>$ python >>> import mysql.connector ImportError: No module named mysql.connector </code></pre> <p>如何在python 2.7版本上安装mysql模块?</p> <p><strong>编辑</strong></p> <p>其他信息:</p> <pre><code>$ which pip /usr/bin/pip $ sudo which pip /usr/bin/pip $ which easy_install /opt/rh/python27/root/usr/bin/easy_install $ sudo which easy_install /usr/bin/easy_install /usr/bin/ $ ls -al pip -rwxr-xr-x. 1 root root 281 Feb 7 11:07 pip /opt/rh/python27/root/usr/bin $ ls -al easy_install -rwxr-xr-x. 1 root root 344 Aug 16 11:40 easy_install </code></pre>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<p>您应该在python2.7.5环境中安装pip。之后pip安装将按预期工作</p>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
plt.savefig不会覆盖现有文件
3 回答
plt.savefig不保存图像
10 回答
plt.savefig在jupyter笔记本中不起作用
10 回答
plt.savefig在从另一个fi调用时停止工作
7 回答
plt.savefig在调用plt.show之前保存空数字
4 回答
plt.save不创建png文件
7 回答
plt.scatter overlay分类数据帧列
5 回答
Plt.Scatter:如何添加title、xlabel和ylab
10 回答
plt.scatter()绘图与Matplotlib中的plt.plot()绘图类似
3 回答
plt.scatter错误'NoneType'对象在成功运行后没有属性'sqrt'
4 回答
plt.set_title()中的标题字符串有误
5 回答
plt.show()
1 回答
plt.show()不在Jupyter笔记本上渲染任何内容
3 回答
plt.show()不打印plt.plot only plt.scatter
6 回答
plt.show()不显示三维散射图像
1 回答
plt.show()不显示任何内容
10 回答
plt.show()不显示数据,而是保留它供下一个图表使用(spyder)
4 回答
plt.show()使终端挂起
7 回答
plt.show()无法使用此代码
5 回答
plt.show()没有打开新的图形风
10 回答