http://askubuntu.com/questions/656610/trying-to-install-mysql-connector-for-python-3?rq=1

my experience is minimal with Linux so i need a little help!

i am trying to install the python mysql-connector for python3.2, i was able to use pip to install it for python2.7 with 'pip install mysql-connector'. To install it for python 3 i believe you have to use the python3 pip instead of the python2 pip, i read that somewhere but im not sure if its correct, does the python3 pip know to get the correct connector or do you have to specify the specific version like 'pip install mysql-connector1.2'.

anyways, i was finding it difficult to get the py3 pip, then i came across a post advising the use of 'virtualenv' to make it easier to work with different versions of python. This post:

How to install pip for python 3 in ubuntu 12.04 LTS

says to create the virtual environment, activate it and then proceed to pip install whatever package you need. however, when i get as far as pip install it doesnt seem to get the mysql-connector that i need, and running 'pip --version' from inside the virtualenv it tells me that the python2.7 pip is being used.

i've tried other things to try get pip3 such as 'easy-install pip3' which doesnt seem to work either.

Is this the only route to take to get the correct mysql-connector? or is there another way i can get pip3 (for py3.2)?

thanks, any advice greatly appreciated!

asked Aug 4 '15 at 20:46
 

3 Answers

Ah! The problem you seem to be facing is you can't create virtualenv with python3.

And to install dependencies for python3 environment you run pip3 install package-name

Follow these steps for creating virtualenv in python3 environment:

virtualenv -p /usr/bin/python3 yourenv
source yourenv/bin/activate
pip3 install mysql-connector

Get a List of Keys From a Dictionary in Both Python 2 and Python 3的更多相关文章

  1. 【LeetCode】650. 2 Keys Keyboard 只有两个键的键盘(Python)

    作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 递归 素数分解 日期 题目地址:https://le ...

  2. How to return dictionary keys as a list in Python 3.3

    http://btmiller.com/2015/04/13/get-list-of-keys-from-dictionary-in-python-2-and-3.html Get a List of ...

  3. C#集合--Dictionary

    字典(dictionary)是一个集合,其中每个元素都是一个键/值对.字典(Dictionaries)是常用于查找和排序的列表. .NET Framework通过IDictionary接口和IDict ...

  4. js实现Dictionary

    js是有Dictionary对象的,只是只有在IE浏览器下可以使用. var dic = new ActiveXObject("Scripting.Dictionary"); 但是 ...

  5. 集合的概念 Stack和Queue Dictionary ArrayList和List<T>方法及用法

    Stack和stack<T>方法一样// 管理方式: 后进先出 LIFO 栈// Stack<string> s=new Stack<string>();//(放一 ...

  6. C# 集合类 :(Array、 Arraylist、List、Hashtable、Dictionary、Stack、Queue)

    我们用的比较多的非泛型集合类主要有 ArrayList类 和 HashTable类.我们经常用HashTable 来存储将要写入到数据库或者返回的信息,在这之间要不断的进行类型的转化,增加了系统装箱和 ...

  7. [转] C#中的Dictionary的使用

    txw1958 的 原文 说明    必须包含名空间System.Collection.Generic     Dictionary里面的每一个元素都是一个键值对(由二个元素组成:键和值)     键 ...

  8. 泛型Dictionary的用法详解

    泛型最常见的用途是泛型集合,命名空间System.Collections.Generic 中包含了一些基于泛型的集合类,使用泛型集合类可以提供更高的类型安全性,还有更高的性能,避免了非泛型集合的重复的 ...

  9. C#中如何查找Dictionary中的重复值

    简介 在这篇帮助文档中,我将向你展示如何实现c#里字典中重复值的查找.你知道的对于一个老鸟来说,这是非常简单的代码.但是尽管如此,这也是一篇对c#初学者非常有用的帮助文档. 背景 多数程序员对小型数据 ...

随机推荐

  1. javascript日常总结

    如何去除掉inline-block元素之间的默认间距 前几天写一个页面 1 2 3 4 div{width:900px;} div li{ display:inline-block; width:30 ...

  2. EF架构~CodeFirst自关联表的插入

    回到目录 这个文章对之前EF的一个补充,对于一些自关联表的添加,如果你建立了表约束确实有这种问题,一般主键为整形自增,父ID为可空,这时,在添加时如果不为ID赋值,结果就会出错. 错误: 无法确定依赖 ...

  3. Memcache分布式部署方案

    基础环境 其实基于PHP扩展的Memcache客户端实际上早已经实现,而且非常稳定.先解释一些名词,Memcache是danga.com的一个开源项目,可以类比于MySQL这样的服务,而PHP扩展的M ...

  4. Atitit 图像清晰度 模糊度 检测 识别 评价算法 原理

    Atitit 图像清晰度 模糊度 检测 识别 评价算法 原理 1.1. 图像边缘一般都是通过对图像进行梯度运算来实现的1 1.2. Remark: 1 1.3.  1.失焦检测. 衡量画面模糊的主要方 ...

  5. fir.im Weekly - 2016 开年技术干货分享

    开年上班,北上广的技术er 陆续重返"人间".看到别人已返工写代码,竟然有种慌慌的感觉(ง •̀_•́)ง 勤奋好学如你,fir.im weekly 送上最新一波技术分享供你 &q ...

  6. eclipse提交项目到github

    1.在https://github.com   new repository 2.在eclipse中new project  比如:Test项目 3.右击"Test"->Te ...

  7. 深入理解PHP内核(十)变量及数据类型-类型提示的实现

    原文链接:http://www.orlion.ga/253/ PHP是弱类型语言,向方法传递参数时也并不严格检查数据类型.不过有时候需要判断传递到方法中的参数,为此PHP中提供了一些函数来判断数据的类 ...

  8. heroku部署java web项目

    一.开发 在本地eclipse创建maven web项目(此时可以当成正常的javaweb项目开发即可.注意添加servlet依赖,此时不用添加jetty依赖) 二.部署前准备 1.首先在pom.xm ...

  9. 移动web开发之像素和DPR

    × 目录 [1]定义 [2]分类 [3]缩放[4]DPR 前面的话 像素在web开发中几乎天天用到,但到底什么是像素,移动端和桌面端的像素有区别吗,缩放对像素有影响吗,视网膜屏幕和像素有什么关系?关于 ...

  10. NYOJ 99单词拼接(有向图的欧拉(回)路)

    /* NYOJ 99单词拼接: 思路:欧拉回路或者欧拉路的搜索! 注意:是有向图的!不要当成无向图,否则在在搜索之前的判断中因为判断有无导致不必要的搜索,以致TLE! 有向图的欧拉路:abs(In[i ...