Get a List of Keys From a Dictionary in Both Python 2 and Python 3, keyspython

Source: Internet
Author: User
Tags python mysql virtualenv

Get a List of Keys From a Dictionary in Both Python 2 and Python 3, keyspython

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 authentication ss 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
Using improve this question Asked Aug 4'15 at 20: 46ThriceGood2613
  Add a comment
3 Answersactiveoldestvotes
Up vote1down voteaccepted

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

And to install dependenciespython3Environment you runpip3 install package-name

Follow these steps for creating virtualenv in python3 environment:

virtualenv -p /usr/bin/python3 yourenvsource yourenv/bin/activatepip3 install mysql-connector

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.