Get a List of Keys From a Dictionary in Both Python 2 and Python 3
2016-08-17 14:24
615 查看
http://askubuntu.com/questions/656610/trying-to-install-mysql-connector-for-python-3?rq=1
trying to install mysql-connector for python 3
up vote0down votefavorite | 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! software-installation python mysql python3
| ||
add a comment |
3 Answers
activeoldestvotesup vote1down voteaccepted | Ah! The problem you seem to be facing is you can't create virtualenv with python3. And to install dependencies for python3environment 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 |
相关文章推荐
- How to return dictionary keys as a list in Python 3.3
- Get the content of an Iframe in Javascript – crossbrowser solution for both IE and Firefox
- Get the content of an Iframe in Javascript – crossbrowser solution for both IE and Firefox
- How to Get a List of Class Attributes in Python
- Get a list of network interfaces and their IP addresses in C
- Get the content of an Iframe in Javascript – crossbrowser solution for both IE and Firefox
- The study of list ,tuple and conditional statement in Python(20170905)
- Get Remote Machines Last Boot Time From A List Of Machines And Write To Excel - 如何获得远程主机的启动时间
- Get the content of an Iframe in Javascript – crossbrowser solution for both IE and Firefox
- The best way to get unique elements of a list in Python
- Leetcode_remove-nth-node-from-end-of-list(c++ and python version)
- Get the content of an Iframe in Javascript – crossbrowser solution for both IE and Firefox
- 从内部和外部的js文件中获取ASPX页面的控件ClientID(get control reference from inline and external javascript)
- Get File Name from File Path in Python | Code Comments
- How can I get the IPv4 address of an interface in linux from C code ?
- Python Dictionary and List
- string - How to get the filename without the extension from a path in Python? - Stack Overflow
- warning: do not list domain haha.com.cn in BOTH mydestination and virtual_mailbox_domains
- Get and display the size of file and directory in Linux system using du command 获取和现实linux文件大小(三)
- Row wise initialized variable in OBIEE 11g and VALUELISTOF function